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

Function db_scids

wallet/wallet.c:5065–5084  ·  view source on GitHub ↗

Turns "SELECT blockheight, txindex, outnum" into scids */

Source from the content-addressed store, hash-verified

5063
5064/* Turns "SELECT blockheight, txindex, outnum" into scids */
5065static const struct short_channel_id *db_scids(const tal_t *ctx,
5066 struct db_stmt *stmt STEALS)
5067{
5068 struct short_channel_id *res = tal_arr(ctx, struct short_channel_id, 0);
5069
5070 while (db_step(stmt)) {
5071 struct short_channel_id scid;
5072 u64 blocknum, txnum, outnum;
5073 bool ok;
5074 blocknum = db_col_int(stmt, "blockheight");
5075 txnum = db_col_int(stmt, "txindex");
5076 outnum = db_col_int(stmt, "outnum");
5077 ok = mk_short_channel_id(&scid, blocknum, txnum, outnum);
5078
5079 assert(ok);
5080 tal_arr_expand(&res, scid);
5081 }
5082 tal_free(stmt);
5083 return res;
5084}
5085
5086const struct short_channel_id *
5087wallet_utxoset_get_spent(const tal_t *ctx, struct wallet *w,

Callers 2

wallet_utxoset_get_spentFunction · 0.85

Calls 4

db_stepFunction · 0.85
db_col_intFunction · 0.85
mk_short_channel_idFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected