diff --git a/.cirrus.yml b/.cirrus.yml index 384b6734..1aa5751d 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,7 +8,7 @@ task: EXECUTOR_WORKERS: 3 VERBOSE: 0 LOG_LEVEL: debug - TIMEOUT: 300 + TIMEOUT: 120 matrix: - name: 'Misc functional tests' env: diff --git a/src/bitcoin/electrum/mod.rs b/src/bitcoin/electrum/mod.rs index 42f067eb..f9c32dd2 100644 --- a/src/bitcoin/electrum/mod.rs +++ b/src/bitcoin/electrum/mod.rs @@ -162,9 +162,7 @@ impl Electrum { } else { log::info!("Performing full scan."); // Either local_chain has height 0 or we want to trigger a full scan. - // In both cases, the scan should be from the genesis block. - let genesis_block = local_chain_tip.get(0).expect("must contain genesis block"); - let mut request = FullScanRequest::from_chain_tip(genesis_block) + let mut request = FullScanRequest::from_chain_tip(local_chain_tip.clone()) .cache_graph_txs(self.bdk_wallet.graph()); for (k, spks) in self.bdk_wallet.index().all_unbounded_spk_iters() { @@ -193,6 +191,9 @@ impl Electrum { chain_update.height() ); + log::debug!("Full local chain: {:?}", self.local_chain()); + log::debug!("Full chain update: {:?}", chain_update); + // Increment the sync count and apply changes. self.sync_count = self.sync_count.checked_add(1).expect("must fit"); if let Some(keychain_update) = keychain_update { diff --git a/tests/test_chain.py b/tests/test_chain.py index b4bf5960..30027bbb 100644 --- a/tests/test_chain.py +++ b/tests/test_chain.py @@ -208,7 +208,7 @@ def test_rescan_edge_cases(lianad, bitcoind): """Remine the chain from given height, shifting the txs by one block.""" delta = bitcoind.rpc.getblockcount() - height + 1 assert delta > 2 - h = bitcoind.rpc.getblockhash(initial_tip["height"]) + h = bitcoind.rpc.getblockhash(height) bitcoind.rpc.invalidateblock(h) bitcoind.generate_block(1) for tx in txs: