| 216 | } |
| 217 | |
| 218 | static struct chain_event **find_txos_for_tx(const tal_t *ctx, |
| 219 | struct db *db, |
| 220 | struct bitcoin_txid *txid) |
| 221 | { |
| 222 | struct db_stmt *stmt; |
| 223 | |
| 224 | stmt = db_prepare_v2(db, SQL("SELECT" |
| 225 | " e.id" |
| 226 | ", e.account_id" |
| 227 | ", a.name" |
| 228 | ", e.origin" |
| 229 | ", e.tag" |
| 230 | ", e.credit" |
| 231 | ", e.debit" |
| 232 | ", e.output_value" |
| 233 | ", e.currency" |
| 234 | ", e.timestamp" |
| 235 | ", e.blockheight" |
| 236 | ", e.utxo_txid" |
| 237 | ", e.outnum" |
| 238 | ", e.spending_txid" |
| 239 | ", e.payment_id" |
| 240 | ", e.ignored" |
| 241 | ", e.stealable" |
| 242 | ", e.ev_desc" |
| 243 | " FROM chain_events e" |
| 244 | " LEFT OUTER JOIN accounts a" |
| 245 | " ON e.account_id = a.id" |
| 246 | " WHERE e.utxo_txid = ?" |
| 247 | " ORDER BY " |
| 248 | " e.utxo_txid" |
| 249 | ", e.outnum" |
| 250 | ", e.spending_txid NULLS FIRST" |
| 251 | ", e.blockheight")); |
| 252 | |
| 253 | db_bind_txid(stmt, 0, txid); |
| 254 | return find_chain_events(ctx, take(stmt)); |
| 255 | } |
| 256 | |
| 257 | struct fee_sum **calculate_onchain_fee_sums(const tal_t *ctx, struct db *db) |
| 258 | { |
no test coverage detected