From f9917c8c7b6d16daadebd72977e56a8adc0382b0 Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Tue, 5 Apr 2016 15:22:04 +0200 Subject: core: improved chainDb using sequential keys --- miner/worker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'miner/worker.go') diff --git a/miner/worker.go b/miner/worker.go index fe759560c..09cf6b6aa 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -272,7 +272,7 @@ func (self *worker) wait() { go self.mux.Post(core.NewMinedBlockEvent{Block: block}) } else { work.state.Commit() - parent := self.chain.GetBlock(block.ParentHash()) + parent := self.chain.GetBlock(block.ParentHash(), block.NumberU64()-1) if parent == nil { glog.V(logger.Error).Infoln("Invalid block found during mining") continue @@ -319,7 +319,7 @@ func (self *worker) wait() { self.mux.Post(core.ChainHeadEvent{Block: block}) self.mux.Post(logs) } - if err := core.WriteBlockReceipts(self.chainDb, block.Hash(), receipts); err != nil { + if err := core.WriteBlockReceipts(self.chainDb, block.Hash(), block.NumberU64(), receipts); err != nil { glog.V(logger.Warn).Infoln("error writing block receipts:", err) } }(block, work.state.Logs(), work.receipts) -- cgit