Skip to content

Commit

Permalink
fix(esplora): check recent blocks are not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
rustaceanrob committed Nov 19, 2024
1 parent 3bc45b5 commit f3efbda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/esplora/src/async_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ async fn chain_update(
local_tip: &CheckPoint,
anchors: &BTreeSet<(ConfirmationBlockTime, Txid)>,
) -> Result<CheckPoint, Error> {
if latest_blocks.is_empty() {
return Ok(local_tip.clone());
}
let mut point_of_agreement = None;
let mut conflicts = vec![];
for local_cp in local_tip.iter() {
Expand Down
3 changes: 3 additions & 0 deletions crates/esplora/src/blocking_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ fn chain_update(
local_tip: &CheckPoint,
anchors: &BTreeSet<(ConfirmationBlockTime, Txid)>,
) -> Result<CheckPoint, Error> {
if latest_blocks.is_empty() {
return Ok(local_tip.clone());
}
let mut point_of_agreement = None;
let mut conflicts = vec![];
for local_cp in local_tip.iter() {
Expand Down

0 comments on commit f3efbda

Please sign in to comment.