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.
This commit is contained in:
Jeffrey Wilcke
2015-06-30 11:14:43 +02:00
parent 7625b07dd9
commit d8fe64acaa
2 changed files with 19 additions and 16 deletions

View File

@ -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