Use correct context for chainHeadRetrieval (#6678)

* Use correct context for chainHeadRetrieval
* Merge refs/heads/master into fix-context
This commit is contained in:
Preston Van Loon 2020-07-22 09:20:20 -07:00 committed by GitHub
parent 647599e87f
commit 62ae22e3f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,7 +226,7 @@ func (bs *Server) StreamChainHead(_ *ptypes.Empty, stream ethpb.BeaconChain_Stre
select {
case event := <-stateChannel:
if event.Type == statefeed.BlockProcessed {
res, err := bs.chainHeadRetrieval(bs.Ctx)
res, err := bs.chainHeadRetrieval(stream.Context())
if err != nil {
return status.Errorf(codes.Internal, "Could not retrieve chain head: %v", err)
}