mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
ld: Do not blindly add rebroadcasts to outgoing_tx set
The list of outgoing transactions was growing with every rebroadcast. Now we just check whether it is already in the list and don't add it anymore Changelog-Fixed: ld: Reduce identification of own transactions to not slow down over time, reducing block processing time Suggested-by: Matt Whitlock <@whitslack>
This commit is contained in:
@@ -208,6 +208,13 @@ static void broadcast_done(struct bitcoind *bitcoind,
|
||||
if (otx->failed_or_success) {
|
||||
otx->failed_or_success(otx->channel, success, msg);
|
||||
tal_free(otx);
|
||||
} else if (we_broadcast(bitcoind->ld->topology, &otx->txid)) {
|
||||
log_debug(
|
||||
bitcoind->ld->topology->log,
|
||||
"Not adding %s to list of outgoing transactions, already "
|
||||
"present",
|
||||
type_to_string(tmpctx, struct bitcoin_txid, &otx->txid));
|
||||
tal_free(otx);
|
||||
} else {
|
||||
/* For continual rebroadcasting, until channel freed. */
|
||||
tal_steal(otx->channel, otx);
|
||||
|
||||
Reference in New Issue
Block a user