From 5e9a472fc7a5e018d80906b6abd5339acd7e25c1 Mon Sep 17 00:00:00 2001 From: ajaysehwal Date: Sat, 28 Nov 2026 13:51:47 +0530 Subject: [PATCH] Report failed bitcoind block syncs as errors `SpvClient::poll_best_tip` returns `(ChainTip::Better(_), false)` when it found a better chain tip but couldn't connect any block towards it, for example because fetching the blocks failed. We ignored that case, so the poll still bumped the wallet sync timestamps and `sync_wallets` reported success while the node fell behind the chain. Log the failure and return `TxSyncFailed` instead, as we already do when polling itself fails. --- src/chain/bitcoind.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chain/bitcoind.rs b/src/chain/bitcoind.rs index fe0047e6a7..cb06eeeec6 100644 --- a/src/chain/bitcoind.rs +++ b/src/chain/bitcoind.rs @@ -518,6 +518,10 @@ impl BitcoindChainSource { log_trace!(self.logger, "Finished polling best tip in {}ms", elapsed_ms); *self.latest_chain_tip.write().expect("lock") = Some(tip); }, + Ok((ChainTip::Better(tip), false)) => { + log_error!(self.logger, "Failed to sync to new chain tip at height {}", tip.height); + return Err(Error::TxSyncFailed); + }, Ok(_) => {}, Err(e) => { log_error!(self.logger, "Failed to poll for chain data: {:?}", e);