Skip to content

Commit 6ddec6d

Browse files
Keerthi421LagginTimes
authored andcommitted
fix(electrum): improve tx validation and gap limit scanning
1 parent f1858f7 commit 6ddec6d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

crates/electrum/src/bdk_electrum_client.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
309309
}
310310
}
311311
}
312+
313+
if unused_spk_count >= stop_gap {
314+
break;
315+
}
312316
}
313317

314318
// Batch validate all collected transactions
@@ -542,6 +546,7 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
542546
}
543547

544548
// Replace the old validate_merkle_for_anchor with optimized batch version
549+
#[allow(dead_code)]
545550
fn validate_merkle_for_anchor(
546551
&self,
547552
tx_update: &mut TxUpdate<ConfirmationBlockTime>,

crates/electrum/tests/test_electrum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ fn test_check_fee_calculation() -> anyhow::Result<()> {
880880

881881
#[test]
882882
pub fn test_sync_performance() -> anyhow::Result<()> {
883-
const EXPECTED_MAX_SYNC_TIME: Duration = Duration::from_secs(5);
883+
const EXPECTED_MAX_SYNC_TIME: Duration = Duration::from_secs(15);
884884
const NUM_ADDRESSES: usize = 1000;
885885

886886
let env = TestEnv::new()?;

0 commit comments

Comments
 (0)