| 254 | } |
| 255 | |
| 256 | static void record_mutual_close(const struct tx_parts *tx, |
| 257 | const u8 *remote_scriptpubkey, |
| 258 | u32 blockheight) |
| 259 | { |
| 260 | /* FIXME: if we ever change how closes happen, this will |
| 261 | * need to be updated as there's no longer 1 output |
| 262 | * per peer */ |
| 263 | for (size_t i = 0; i < tal_count(tx->outputs); i++) { |
| 264 | struct bitcoin_outpoint out; |
| 265 | |
| 266 | if (!wally_tx_output_scripteq(tx->outputs[i], |
| 267 | remote_scriptpubkey)) |
| 268 | continue; |
| 269 | |
| 270 | out.n = i; |
| 271 | out.txid = tx->txid; |
| 272 | record_external_output(&out, |
| 273 | amount_sat(tx->outputs[i]->satoshi), |
| 274 | blockheight, |
| 275 | mk_mvt_tags(MVT_TO_THEM)); |
| 276 | break; |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | |
| 281 | static void record_channel_deposit(struct tracked_output *out, |
no test coverage detected