diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-04-07 16:03:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 16:03:11 +0800 |
commit | cc13d576f07fb6803e09fb42880591a67b8b0ef6 (patch) | |
tree | 6b2371c34416e3697443d836aab3a1f7fc32e77a /core/headerchain.go | |
parent | 71fdaa42386173da7bfa13f1728c394aeeb4eb01 (diff) | |
parent | 158d603528d2ba36b633a8f22a2bff8329f69717 (diff) | |
download | dexon-cc13d576f07fb6803e09fb42880591a67b8b0ef6.tar dexon-cc13d576f07fb6803e09fb42880591a67b8b0ef6.tar.gz dexon-cc13d576f07fb6803e09fb42880591a67b8b0ef6.tar.bz2 dexon-cc13d576f07fb6803e09fb42880591a67b8b0ef6.tar.lz dexon-cc13d576f07fb6803e09fb42880591a67b8b0ef6.tar.xz dexon-cc13d576f07fb6803e09fb42880591a67b8b0ef6.tar.zst dexon-cc13d576f07fb6803e09fb42880591a67b8b0ef6.zip |
Merge pull request #13870 from karalabe/miners-fixes
all: clean up various error handling in core and the miner
Diffstat (limited to 'core/headerchain.go')
-rw-r--r-- | core/headerchain.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/headerchain.go b/core/headerchain.go index e2d0ff5b1..f58afc6ca 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -137,7 +137,7 @@ func (hc *HeaderChain) WriteHeader(header *types.Header) (status WriteStatus, er // Calculate the total difficulty of the header ptd := hc.GetTd(header.ParentHash, number-1) if ptd == nil { - return NonStatTy, ParentError(header.ParentHash) + return NonStatTy, consensus.ErrUnknownAncestor } localTd := hc.GetTd(hc.currentHeaderHash, hc.currentHeader.Number.Uint64()) externTd := new(big.Int).Add(header.Difficulty, ptd) @@ -246,7 +246,7 @@ func (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header, checkFreq int) } // If the header is a banned one, straight out abort if BadHashes[header.Hash()] { - return i, BadHashError(header.Hash()) + return i, ErrBlacklistedHash } // Otherwise wait for headers checks and ensure they pass if err := <-results; err != nil { |