mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
miner crash due to blockchain db close
This commit is contained in:
parent
cc318ff8db
commit
31272f12b3
1 changed files with 4 additions and 0 deletions
|
|
@ -288,6 +288,10 @@ func (self *worker) makeCurrent() {
|
||||||
current.ownedAccounts = accountAddressesSet(accounts)
|
current.ownedAccounts = accountAddressesSet(accounts)
|
||||||
|
|
||||||
parent := self.chain.GetBlock(current.block.ParentHash())
|
parent := self.chain.GetBlock(current.block.ParentHash())
|
||||||
|
if parent == nil {
|
||||||
|
// in case geth quits the blockchain db can be closed and this returns nil
|
||||||
|
return
|
||||||
|
}
|
||||||
current.coinbase.SetGasPool(core.CalcGasLimit(parent))
|
current.coinbase.SetGasPool(core.CalcGasLimit(parent))
|
||||||
|
|
||||||
self.current = current
|
self.current = current
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue