]> git.bitcoin.ninja Git - rust-lightning/commit
Dedup `confirmed_txs` `Vec`
authorElias Rohrer <dev@tnull.de>
Tue, 19 Mar 2024 14:30:16 +0000 (15:30 +0100)
committerElias Rohrer <dev@tnull.de>
Thu, 21 Mar 2024 16:41:26 +0000 (17:41 +0100)
commitb71c6e2f6701f0e0f1b4c92db00772edbc4d262d
tree04fe9cd8bbbafa80391dcbaf3bd86644925c1cbc
parent2f581104b236eace500d3f8153ee5c5dafa42390
Dedup `confirmed_txs` `Vec`

Previously, we would just push to the `confirmed_txs` `Vec`, leading to
redundant `Confirm::transactions_confirmed` calls, especially now that
we re-confirm previously disconnected spends.

Here, we ensure that we don't push additional `ConfirmedTx` entries if
already one with matching `Txid` is present. This not only gets rid of
the spurious `transactions_confirmed` calls (which are harmless), but
more importantly saves us from issuing unnecessary network calls, which
improves latency.
lightning-transaction-sync/src/common.rs
lightning-transaction-sync/src/electrum.rs
lightning-transaction-sync/src/esplora.rs