Skip to content

Check recent blocks are not empty #1725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
Comment on lines +214 to +216
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include docs explaining why we are doing this.

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
Loading