Skip to content

Commit 961a9da

Browse files
committed
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.
1 parent e732550 commit 961a9da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/electrum/src/bdk_electrum_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
422422
) -> Result<(), Error> {
423423
let mut no_dup = HashSet::<Txid>::new();
424424
for tx in &tx_update.txs {
425-
if no_dup.insert(tx.compute_txid()) {
425+
if !tx.is_coinbase() && no_dup.insert(tx.compute_txid()) {
426426
for vin in &tx.input {
427427
let outpoint = vin.previous_output;
428428
let vout = outpoint.vout;

0 commit comments

Comments
 (0)