MCPcopy Create free account
hub / github.com/ElementsProject/lightning / wallet_htlcs_next

Function wallet_htlcs_next

wallet/wallet.c:6612–6649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6610}
6611
6612struct wallet_htlc_iter *wallet_htlcs_next(struct wallet *w,
6613 struct wallet_htlc_iter *iter,
6614 struct short_channel_id *scid,
6615 u64 *htlc_id,
6616 int *cltv_expiry,
6617 enum side *owner,
6618 struct amount_msat *msat,
6619 struct sha256 *payment_hash,
6620 enum htlc_state *hstate,
6621 u64 *created_index,
6622 u64 *updated_index)
6623{
6624 if (!db_step(iter->stmt))
6625 return tal_free(iter);
6626
6627 if (iter->scid.u64 != 0)
6628 *scid = iter->scid;
6629 else {
6630 if (db_col_is_null(iter->stmt, "channels.scid"))
6631 *scid = db_col_short_channel_id(iter->stmt, "channels.alias_local");
6632 else {
6633 *scid = db_col_short_channel_id(iter->stmt, "channels.scid");
6634 db_col_ignore(iter->stmt, "channels.alias_local");
6635 }
6636 }
6637 *htlc_id = db_col_u64(iter->stmt, "h.channel_htlc_id");
6638 if (db_col_int(iter->stmt, "h.direction") == DIRECTION_INCOMING)
6639 *owner = REMOTE;
6640 else
6641 *owner = LOCAL;
6642 *msat = db_col_amount_msat(iter->stmt, "h.msatoshi");
6643 db_col_sha256(iter->stmt, "h.payment_hash", payment_hash);
6644 *cltv_expiry = db_col_int(iter->stmt, "h.cltv_expiry");
6645 *hstate = db_col_int(iter->stmt, "h.hstate");
6646 *created_index = db_col_u64(iter->stmt, "h.id");
6647 *updated_index = db_col_u64(iter->stmt, "h.updated_index");
6648 return iter;
6649}
6650
6651u64 wallet_get_rune_next_unique_id(const tal_t *ctx, struct wallet *wallet)
6652{

Callers 2

wallet_htlcs_firstFunction · 0.85
json_listhtlcsFunction · 0.85

Calls 9

db_stepFunction · 0.85
tal_freeFunction · 0.85
db_col_is_nullFunction · 0.85
db_col_short_channel_idFunction · 0.85
db_col_ignoreFunction · 0.85
db_col_u64Function · 0.85
db_col_intFunction · 0.85
db_col_amount_msatFunction · 0.85
db_col_sha256Function · 0.85

Tested by

no test coverage detected