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 Nov 8, 2023
1 parent 2f2f138 commit d58f13d
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 d58f13d

Please sign in to comment.