| 361 | } |
| 362 | |
| 363 | static void replay_watch_tx(struct channel *channel, |
| 364 | u32 blockheight, |
| 365 | const struct bitcoin_tx *tx TAKES) |
| 366 | { |
| 367 | struct replay_tx *rtx = tal(channel->onchaind_replay_watches, struct replay_tx); |
| 368 | bitcoin_txid(tx, &rtx->txid); |
| 369 | rtx->blockheight = blockheight; |
| 370 | rtx->tx = clone_bitcoin_tx(rtx, tx); |
| 371 | |
| 372 | /* We might already be watching, in which case don't re-add! */ |
| 373 | if (replay_tx_hash_get(channel->onchaind_replay_watches, &rtx->txid)) |
| 374 | tal_free(rtx); |
| 375 | else |
| 376 | replay_tx_hash_add(channel->onchaind_replay_watches, rtx); |
| 377 | } |
| 378 | |
| 379 | /* We've finished replaying, turn any txs left into live watches */ |
| 380 | static void convert_replay_txs(struct channel *channel) |
no test coverage detected