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

Function db_scids

wallet/wallet.c:3982–4001  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3980
3981/* Turns "SELECT blockheight, txindex, outnum" into scids */
3982static const struct short_channel_id *db_scids(const tal_t *ctx,
3983 struct db_stmt *stmt STEALS)
3984{
3985 struct short_channel_id *res = tal_arr(ctx, struct short_channel_id, 0);
3986
3987 while (db_step(stmt)) {
3988 struct short_channel_id scid;
3989 u64 blocknum, txnum, outnum;
3990 bool ok;
3991 blocknum = db_col_int(stmt, "blockheight");
3992 txnum = db_col_int(stmt, "txindex");
3993 outnum = db_col_int(stmt, "outnum");
3994 ok = mk_short_channel_id(&scid, blocknum, txnum, outnum);
3995
3996 assert(ok);
3997 tal_arr_expand(&res, scid);
3998 }
3999 tal_free(stmt);
4000 return res;
4001}
4002
4003const struct short_channel_id *
4004wallet_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