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

Function db_scids

wallet/wallet.c:5125–5144  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

5123
5124/* Turns "SELECT blockheight, txindex, outnum" into scids */
5125static const struct short_channel_id *db_scids(const tal_t *ctx,
5126 struct db_stmt *stmt STEALS)
5127{
5128 struct short_channel_id *res = tal_arr(ctx, struct short_channel_id, 0);
5129
5130 while (db_step(stmt)) {
5131 struct short_channel_id scid;
5132 u64 blocknum, txnum, outnum;
5133 bool ok;
5134 blocknum = db_col_int(stmt, "blockheight");
5135 txnum = db_col_int(stmt, "txindex");
5136 outnum = db_col_int(stmt, "outnum");
5137 ok = mk_short_channel_id(&scid, blocknum, txnum, outnum);
5138
5139 assert(ok);
5140 tal_arr_expand(&res, scid);
5141 }
5142 tal_free(stmt);
5143 return res;
5144}
5145
5146const struct short_channel_id *
5147wallet_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