From 07da9d720b4f1016052ea7d194cc30b9fa31822e Mon Sep 17 00:00:00 2001 From: Taka Goto Date: Wed, 16 Jan 2019 10:16:06 -0600 Subject: [PATCH] fix get headers when less than 100 fetched --- pkg/geth/blockchain.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/geth/blockchain.go b/pkg/geth/blockchain.go index 77872f06..e30b2233 100644 --- a/pkg/geth/blockchain.go +++ b/pkg/geth/blockchain.go @@ -95,9 +95,11 @@ func (blockChain *BlockChain) getPOWHeaders(blockNumbers []int64) (headers []cor } for _, POWHeader := range POWHeaders { - header, _ := blockChain.headerConverter.Convert(&POWHeader, POWHeader.Hash().String()) + if POWHeader.Number != nil { + header, _ := blockChain.headerConverter.Convert(&POWHeader, POWHeader.Hash().String()) - headers = append(headers, header) + headers = append(headers, header) + } } return headers, err