mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
Fixed reset head chain to block number for rollback block hash feature.
This commit is contained in:
parent
19c6b8410e
commit
59793060f6
1 changed files with 8 additions and 0 deletions
|
|
@ -179,6 +179,14 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
eth.blockchain.Rollback([]common.Hash{curBlock.Hash()})
|
eth.blockchain.Rollback([]common.Hash{curBlock.Hash()})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if prevBlock != nil {
|
||||||
|
err := eth.blockchain.SetHead(prevBlock.NumberU64())
|
||||||
|
if err != nil {
|
||||||
|
log.Crit("Err Rollback", "err", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if eth.protocolManager, err = NewProtocolManager(eth.chainConfig, config.SyncMode, config.NetworkId, eth.eventMux, eth.txPool, eth.engine, eth.blockchain, chainDb); err != nil {
|
if eth.protocolManager, err = NewProtocolManager(eth.chainConfig, config.SyncMode, config.NetworkId, eth.eventMux, eth.txPool, eth.engine, eth.blockchain, chainDb); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue