node/pkg/ethereum: fix a bug discovered in testnet

This commit is contained in:
Jeff Schroeder 2022-06-24 12:33:57 -04:00 committed by Evan Gray
parent e728b524b4
commit cb73b7b718
1 changed files with 6 additions and 1 deletions

View File

@ -244,7 +244,12 @@ func (e *PollImpl) getBlock(ctx context.Context, number *big.Int) (*common.NewBl
zap.String("requested_block", numStr), zap.Error(err))
return nil, err
}
if m.Number == nil {
e.logger.Error("failed to unmarshal block", zap.String("eth_network", e.BaseEth.NetworkName),
zap.String("requested_block", numStr),
)
return nil, fmt.Errorf("failed to unmarshal block: Number is nil")
}
n := big.Int(*m.Number)
return &common.NewBlock{
Number: &n,