Skip to content

Commit

Permalink
RPC: Use db.headBlock in getBlock (#4473)
Browse files Browse the repository at this point in the history
* use headBlock in getBlock
* Merge branch 'master' into use-db-headblock
  • Loading branch information
prestonvanloon authored and prylabs-bulldozer[bot] committed Jan 10, 2020
1 parent eae2268 commit 6aa9295
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion beacon-chain/rpc/validator/proposer.go
Expand Up @@ -36,7 +36,10 @@ func (vs *Server) GetBlock(ctx context.Context, req *ethpb.BlockRequest) (*ethpb
}

// Retrieve the parent block as the current head of the canonical chain.
parent := vs.HeadFetcher.HeadBlock()
parent, err := vs.BeaconDB.HeadBlock(ctx)
if err != nil {
return nil, err
}

parentRoot, err := ssz.HashTreeRoot(parent.Block)
if err != nil {
Expand Down

0 comments on commit 6aa9295

Please sign in to comment.