Skip to content

Commit 20b374e

Browse files
committed
Fix error parsing & clean up cbf checks
1 parent 1920b38 commit 20b374e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

client/src/source.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ impl BitcoinRpc {
356356
}
357357

358358
fn parse_error_bytes(status: StatusCode, res_bytes: &[u8]) -> BitcoinRpcError {
359-
let parsed_response: Result<JsonRpcResponse<String>, serde_json::Error> =
359+
let parsed_response: Result<JsonRpcResponse<Option<String>>, serde_json::Error> =
360360
serde_json::from_slice(&res_bytes);
361361

362362
match parsed_response {

client/src/wallets.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ impl RpcWallet {
563563
source.clone(),
564564
num_workers);
565565

566-
567566
let mut wallet_tip = {
568567
let tip = wallet.local_chain().tip();
569568
ChainAnchor {
@@ -574,10 +573,12 @@ impl RpcWallet {
574573

575574
let mut shutdown_recv = shutdown.subscribe();
576575

577-
let mut cbf_sync = CompactFilterSync::new(&wallet);
578-
if !cbf {
576+
let mut cbf_sync = if cbf {
577+
Some(CompactFilterSync::new(&wallet))
578+
} else {
579579
fetcher.start(wallet_tip);
580-
}
580+
None
581+
};
581582

582583
let mut synced_at_least_once = false;
583584
let mut last_mempool_check = Instant::now();
@@ -607,7 +608,7 @@ impl RpcWallet {
607608
}
608609

609610
// Compact Filter Sync:
610-
if cbf && !cbf_sync.synced() {
611+
if let Some(cbf_sync) = cbf_sync.as_mut() {
611612
cbf_sync.sync_next(&mut wallet, &source, &mut wallet_progress)?;
612613

613614
// Once compact filter sync is complete

0 commit comments

Comments
 (0)