Skip to content

Commit

Permalink
fix(electrum): fixed chain sync issue
Browse files Browse the repository at this point in the history
Fixed a logic error in `construct_update_tip` in `electrum_ext.rs` that caused
the local chain tip to always be a block behind the newest confirmed block.
  • Loading branch information
LagginTimes committed Oct 3, 2023
1 parent fe65431 commit 330dfc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/electrum/src/electrum_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ fn construct_update_tip(
// Atomically fetch the latest `ASSUME_FINAL_DEPTH` count of blocks from Electrum. We use this
// to construct our checkpoint update.
let mut new_blocks = {
let start_height = new_tip_height.saturating_sub(ASSUME_FINAL_DEPTH);
let start_height = (new_tip_height + 1).saturating_sub(ASSUME_FINAL_DEPTH);
let hashes = client
.block_headers(start_height as _, ASSUME_FINAL_DEPTH as _)?
.headers
Expand Down

0 comments on commit 330dfc5

Please sign in to comment.