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

Function wallet_transaction_height

wallet/wallet.c:5306–5325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5304}
5305
5306u32 wallet_transaction_height(struct wallet *w, const struct bitcoin_txid *txid)
5307{
5308 u32 blockheight;
5309 struct db_stmt *stmt = db_prepare_v2(
5310 w->db, SQL("SELECT blockheight FROM transactions WHERE id=?"));
5311 db_bind_txid(stmt, txid);
5312 db_query_prepared(stmt);
5313
5314 if (!db_step(stmt)) {
5315 tal_free(stmt);
5316 return 0;
5317 }
5318
5319 if (!db_col_is_null(stmt, "blockheight"))
5320 blockheight = db_col_int(stmt, "blockheight");
5321 else
5322 blockheight = 0;
5323 tal_free(stmt);
5324 return blockheight;
5325}
5326
5327struct bitcoin_txid *wallet_transactions_by_height(const tal_t *ctx,
5328 struct wallet *w,

Callers

nothing calls this directly

Calls 6

db_bind_txidFunction · 0.85
db_query_preparedFunction · 0.85
db_stepFunction · 0.85
tal_freeFunction · 0.85
db_col_is_nullFunction · 0.85
db_col_intFunction · 0.85

Tested by

no test coverage detected