From 31272f12b34af569ae2f5acd53f4d624d2bee30c Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Tue, 26 May 2015 14:33:11 +0200 Subject: [PATCH] miner crash due to blockchain db close --- miner/worker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index 5e4ff7510f..eb8fe90057 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -288,6 +288,10 @@ func (self *worker) makeCurrent() { current.ownedAccounts = accountAddressesSet(accounts) 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)) self.current = current