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

Function wallet_transactions_by_height

wallet/wallet.c:4252–4272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4250}
4251
4252struct bitcoin_txid *wallet_transactions_by_height(const tal_t *ctx,
4253 struct wallet *w,
4254 const u32 blockheight)
4255{
4256 struct db_stmt *stmt;
4257 struct bitcoin_txid *txids = tal_arr(ctx, struct bitcoin_txid, 0);
4258 int count = 0;
4259 stmt = db_prepare_v2(
4260 w->db, SQL("SELECT id FROM transactions WHERE blockheight=?"));
4261 db_bind_int(stmt, 0, blockheight);
4262 db_query_prepared(stmt);
4263
4264 while (db_step(stmt)) {
4265 count++;
4266 tal_resize(&txids, count);
4267 db_col_txid(stmt, "id", &txids[count-1]);
4268 }
4269 tal_free(stmt);
4270
4271 return txids;
4272}
4273
4274void wallet_channeltxs_add(struct wallet *w, struct channel *chan,
4275 const int type, const struct bitcoin_txid *txid,

Callers 1

remove_tipFunction · 0.85

Calls 5

db_bind_intFunction · 0.85
db_query_preparedFunction · 0.85
db_stepFunction · 0.85
db_col_txidFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected