MCPcopy Create free account
hub / github.com/ElementsProject/lightning / replay_watch_tx

Function replay_watch_tx

lightningd/onchain_control.c:363–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363static 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 */
380static void convert_replay_txs(struct channel *channel)

Callers 2

replay_blockFunction · 0.85
onchaind_funding_spentFunction · 0.85

Calls 3

clone_bitcoin_txFunction · 0.85
tal_freeFunction · 0.85
bitcoin_txidClass · 0.70

Tested by

no test coverage detected