From d8fe64acaa94fc5a12e53cec110e57cace52ced9 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Tue, 30 Jun 2015 11:14:43 +0200 Subject: core, miner: added queued write to WriteBlock This fixes an issue with the lru cache not being available when calling WriteBlock. WriteBlock previously always assumed to be called from the InsertChain where the lru cache was always created prior to calling WriteBlock. When being called from the worker this could lead in to a nil pointer exception being thrown and causing database corruption. --- miner/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'miner/worker.go') diff --git a/miner/worker.go b/miner/worker.go index 0971bd957..f06b6afa1 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -233,7 +233,7 @@ func (self *worker) wait() { continue } - _, err := self.chain.WriteBlock(block) + _, err := self.chain.WriteBlock(block, false) if err != nil { glog.V(logger.Error).Infoln("error writing block to chain", err) continue -- cgit v1.2.3