From 0944b352156fcd797a5c199a462ccaed3761db0a Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Thu, 7 Nov 2024 00:33:51 +0800 Subject: [PATCH] fix(electrum): prevent `fetch_prev_txout` from querying coinbase transactions \`fetch_prev_txout\` should not try to query the prevouts of coinbase transactions, as it may result in the Electrum server returning an error which would cause the overall `sync` to fail. --- crates/electrum/src/bdk_electrum_client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/electrum/src/bdk_electrum_client.rs b/crates/electrum/src/bdk_electrum_client.rs index f9e53bff..eb1d43e3 100644 --- a/crates/electrum/src/bdk_electrum_client.rs +++ b/crates/electrum/src/bdk_electrum_client.rs @@ -422,7 +422,7 @@ impl BdkElectrumClient { ) -> Result<(), Error> { let mut no_dup = HashSet::::new(); for tx in &tx_update.txs { - if no_dup.insert(tx.compute_txid()) { + if !tx.is_coinbase() && no_dup.insert(tx.compute_txid()) { for vin in &tx.input { let outpoint = vin.previous_output; let vout = outpoint.vout; -- 2.49.0