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

Function wallet_transaction_get

wallet/wallet.c:5223–5244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5221}
5222
5223struct bitcoin_tx *wallet_transaction_get(const tal_t *ctx, struct wallet *w,
5224 const struct bitcoin_txid *txid)
5225{
5226 struct bitcoin_tx *tx;
5227 struct db_stmt *stmt = db_prepare_v2(
5228 w->db, SQL("SELECT rawtx FROM transactions WHERE id=?"));
5229 db_bind_txid(stmt, txid);
5230 db_query_prepared(stmt);
5231
5232 if (!db_step(stmt)) {
5233 tal_free(stmt);
5234 return NULL;
5235 }
5236
5237 if (!db_col_is_null(stmt, "rawtx"))
5238 tx = db_col_tx(ctx, stmt, "rawtx");
5239 else
5240 tx = NULL;
5241
5242 tal_free(stmt);
5243 return tx;
5244}
5245
5246u32 wallet_transaction_height(struct wallet *w, const struct bitcoin_txid *txid)
5247{

Callers 5

json_unreserveinputsFunction · 0.85
psbt_using_utxosFunction · 0.85
watch_topology_changedFunction · 0.85
handle_splice_lookup_txFunction · 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_txFunction · 0.85

Tested by

no test coverage detected