| 271 | } |
| 272 | |
| 273 | static void record_mutual_close(const struct tx_parts *tx, |
| 274 | const u8 *remote_scriptpubkey, |
| 275 | u32 blockheight) |
| 276 | { |
| 277 | /* FIXME: if we ever change how closes happen, this will |
| 278 | * need to be updated as there's no longer 1 output |
| 279 | * per peer */ |
| 280 | for (size_t i = 0; i < tal_count(tx->outputs); i++) { |
| 281 | struct bitcoin_outpoint out; |
| 282 | |
| 283 | if (!wally_tx_output_scripteq(tx->outputs[i], |
| 284 | remote_scriptpubkey)) |
| 285 | continue; |
| 286 | |
| 287 | out.n = i; |
| 288 | out.txid = tx->txid; |
| 289 | record_external_output(&out, |
| 290 | amount_sat(tx->outputs[i]->satoshi), |
| 291 | blockheight, |
| 292 | TO_THEM); |
| 293 | break; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | |
| 298 | static void record_channel_deposit(struct tracked_output *out, |
no test coverage detected