Skip to content

Commit

Permalink
Fix eth_getBlockByHash not working for HEAD (moonbeam-foundation#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadkaouk committed Mar 14, 2024
1 parent 8c90bb7 commit f55fd07
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/mapping-sync/src/kv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ where
current_syncing_tips.append(&mut leaves);
}

let best_hash = client.info().best_hash;
if SyncStrategy::Parachain == strategy
&& !frontier_backend
.mapping()
.is_synced(&best_hash)?
{
// Add best block to current_syncing_tips
current_syncing_tips.push(best_hash);
}

let mut operating_header = None;
while let Some(checking_tip) = current_syncing_tips.pop() {
if let Some(checking_header) = fetch_header(
Expand Down

0 comments on commit f55fd07

Please sign in to comment.