Description
In rescan_with_block_filters (crates/floresta-node/src/json_rpc/server.rs, ~L616) matched blocks are downloaded with:
for block in blocks {
if let Ok(Some(block)) = node.get_block(block).await {
let height = chain.get_block_height(&block.block_hash()).unwrap().unwrap();
wallet.block_process(&block, height);
}
}
NodeInterface::get_block resolves three ways: Ok(Some), Ok(None) (peer replied NOTFOUND), and Err(RecvError) (responder dropped — e.g. MAX_INFLIGHT_REQUESTS reached or peer disconnected). The if let Ok(Some(..)) silently discards the latter two, so a matched block that momentarily fails to download is dropped from the rescan and never retried — the wallet permanently misses the transactions it carried, even though the rescan reports success.
Impact
On bandwidth/peer-constrained setups (notably the Android port, jvsena42/mandacaru#81) users see wallet history missing transactions after a "successful" rescan and must re-run rescanblockchain many times — each pass logs a different set of rescan filter hits as different blocks happen to succeed.
Suggested fix
Retry failed fetches (bounded, with backoff) so one rescan processes every matched block; surface a count of any blocks still unreachable after the cap. Reference implementation: jvsena42/Floresta-mandacaru#17.
Note: the reference PR targets a fork ~1 month behind master, so it may need light adaptation (e.g. the recent address-derivation centralization).
Description
In
rescan_with_block_filters(crates/floresta-node/src/json_rpc/server.rs, ~L616) matched blocks are downloaded with:NodeInterface::get_blockresolves three ways:Ok(Some),Ok(None)(peer replied NOTFOUND), andErr(RecvError)(responder dropped — e.g.MAX_INFLIGHT_REQUESTSreached or peer disconnected). Theif let Ok(Some(..))silently discards the latter two, so a matched block that momentarily fails to download is dropped from the rescan and never retried — the wallet permanently misses the transactions it carried, even though the rescan reports success.Impact
On bandwidth/peer-constrained setups (notably the Android port, jvsena42/mandacaru#81) users see wallet history missing transactions after a "successful" rescan and must re-run
rescanblockchainmany times — each pass logs a different set ofrescan filter hitsas different blocks happen to succeed.Suggested fix
Retry failed fetches (bounded, with backoff) so one rescan processes every matched block; surface a count of any blocks still unreachable after the cap. Reference implementation: jvsena42/Floresta-mandacaru#17.
Note: the reference PR targets a fork ~1 month behind master, so it may need light adaptation (e.g. the recent address-derivation centralization).