Merge pull request #230 from ngtuna/double-validation-fix-1

double validation bugfix
This commit is contained in:
Tuna 2018-10-23 17:35:07 +07:00 committed by GitHub
commit 3b4106fc12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -191,7 +191,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
// Hook double validation
doubleValidateHook := func(block *types.Block) error {
snap, err := c.GetSnapshot(eth.blockchain, block.Header())
parentBlk := eth.blockchain.GetBlockByHash(block.ParentHash())
snap, err := c.GetSnapshot(eth.blockchain, parentBlk.Header())
if err != nil {
if err == consensus.ErrUnknownAncestor {
log.Warn("Block chain forked.", "error", err)