Skip to content

Commit

Permalink
Use fast head in http_api
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Jun 28, 2022
1 parent 4ffdb41 commit 7199425
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ pub fn serve<T: BeaconChainTypes>(
chain: Arc<BeaconChain<T>>| async move {
match *network_globals.sync_state.read() {
SyncState::SyncingFinalized { .. } => {
let head_slot = chain.canonical_head.read().head_slot();
let head_slot = chain.fast_canonical_head().head_slot;

let current_slot =
chain.slot_clock.now_or_genesis().ok_or_else(|| {
Expand Down Expand Up @@ -1691,7 +1691,7 @@ pub fn serve<T: BeaconChainTypes>(
.and_then(
|network_globals: Arc<NetworkGlobals<T::EthSpec>>, chain: Arc<BeaconChain<T>>| {
blocking_json_task(move || {
let head_slot = chain.canonical_head.read().head_slot();
let head_slot = chain.fast_canonical_head().head_slot;
let current_slot = chain.slot_clock.now_or_genesis().ok_or_else(|| {
warp_utils::reject::custom_server_error("Unable to read slot clock".into())
})?;
Expand Down

0 comments on commit 7199425

Please sign in to comment.