aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-06-30 17:14:43 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-06-30 17:14:43 +0800
commitd8fe64acaa94fc5a12e53cec110e57cace52ced9 (patch)
tree0ecce1385d1ed0e60ba69e8bc1234109c6c09b28 /miner
parent7625b07dd9a2a7b5c5a504c1276eea04596ac871 (diff)
downloadgo-tangerine-d8fe64acaa94fc5a12e53cec110e57cace52ced9.tar
go-tangerine-d8fe64acaa94fc5a12e53cec110e57cace52ced9.tar.gz
go-tangerine-d8fe64acaa94fc5a12e53cec110e57cace52ced9.tar.bz2
go-tangerine-d8fe64acaa94fc5a12e53cec110e57cace52ced9.tar.lz
go-tangerine-d8fe64acaa94fc5a12e53cec110e57cace52ced9.tar.xz
go-tangerine-d8fe64acaa94fc5a12e53cec110e57cace52ced9.tar.zst
go-tangerine-d8fe64acaa94fc5a12e53cec110e57cace52ced9.zip
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.
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go2
1 files changed, 1 insertions, 1 deletions
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