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

Function wallet_transaction_height

wallet/wallet.c:4203–4222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4201}
4202
4203u32 wallet_transaction_height(struct wallet *w, const struct bitcoin_txid *txid)
4204{
4205 u32 blockheight;
4206 struct db_stmt *stmt = db_prepare_v2(
4207 w->db, SQL("SELECT blockheight FROM transactions WHERE id=?"));
4208 db_bind_txid(stmt, 0, txid);
4209 db_query_prepared(stmt);
4210
4211 if (!db_step(stmt)) {
4212 tal_free(stmt);
4213 return 0;
4214 }
4215
4216 if (!db_col_is_null(stmt, "blockheight"))
4217 blockheight = db_col_int(stmt, "blockheight");
4218 else
4219 blockheight = 0;
4220 tal_free(stmt);
4221 return blockheight;
4222}
4223
4224struct txlocator *wallet_transaction_locate(const tal_t *ctx, struct wallet *w,
4225 const struct bitcoin_txid *txid)

Callers 3

get_tx_depthFunction · 0.85
rebroadcast_txsFunction · 0.85
onchaind_funding_spentFunction · 0.85

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