Skip to content

Commit c7ff3c4

Browse files
committed
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>
1 parent f2291c4 commit c7ff3c4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightningd/chaintopology.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ static void broadcast_done(struct bitcoind *bitcoind,
208208
if (otx->failed_or_success) {
209209
otx->failed_or_success(otx->channel, success, msg);
210210
tal_free(otx);
211+
} else if (we_broadcast(bitcoind->ld->topology, &otx->txid)) {
212+
log_debug(
213+
bitcoind->ld->topology->log,
214+
"Not adding %s to list of outgoing transactions, already "
215+
"present",
216+
type_to_string(tmpctx, struct bitcoin_txid, &otx->txid));
217+
tal_free(otx);
211218
} else {
212219
/* For continual rebroadcasting, until channel freed. */
213220
tal_steal(otx->channel, otx);

0 commit comments

Comments
 (0)