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

Function wallet_transaction_get

wallet/wallet.c:4180–4201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4178}
4179
4180struct bitcoin_tx *wallet_transaction_get(const tal_t *ctx, struct wallet *w,
4181 const struct bitcoin_txid *txid)
4182{
4183 struct bitcoin_tx *tx;
4184 struct db_stmt *stmt = db_prepare_v2(
4185 w->db, SQL("SELECT rawtx FROM transactions WHERE id=?"));
4186 db_bind_txid(stmt, 0, txid);
4187 db_query_prepared(stmt);
4188
4189 if (!db_step(stmt)) {
4190 tal_free(stmt);
4191 return NULL;
4192 }
4193
4194 if (!db_col_is_null(stmt, "rawtx"))
4195 tx = db_col_tx(ctx, stmt, "rawtx");
4196 else
4197 tx = NULL;
4198
4199 tal_free(stmt);
4200 return tx;
4201}
4202
4203u32 wallet_transaction_height(struct wallet *w, const struct bitcoin_txid *txid)
4204{

Callers 3

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