| 59 | } |
| 60 | |
| 61 | static struct chain_event **find_txos_for_tx(const tal_t *ctx, |
| 62 | const struct bkpr *bkpr, |
| 63 | struct command *cmd, |
| 64 | const struct bitcoin_txid *txid) |
| 65 | { |
| 66 | return chain_events_from_sql(ctx, bkpr, cmd, |
| 67 | SELECT_CHAIN_EVENTS |
| 68 | /* utxo is txid:outnum */ |
| 69 | " WHERE utxo LIKE '%s:%%'" |
| 70 | " AND created_index <= %"PRIu64 |
| 71 | " ORDER BY " |
| 72 | " utxo" |
| 73 | ", spending_txid NULLS FIRST" |
| 74 | ", blockheight", |
| 75 | fmt_bitcoin_txid(tmpctx, txid), |
| 76 | bkpr->chainmoves_index); |
| 77 | } |
| 78 | |
| 79 | static struct txo_pair *new_txo_pair(const tal_t *ctx) |
| 80 | { |
no test coverage detected