aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorzsfelfoldi <zsfelfoldi@gmail.com>2016-04-05 21:22:04 +0800
committerzsfelfoldi <zsfelfoldi@gmail.com>2016-06-07 22:38:56 +0800
commitf9917c8c7b6d16daadebd72977e56a8adc0382b0 (patch)
treeeb11524c618a44dbd499918761ba176a9addba58 /miner
parent5a458da42ae9a6525989c2d4515c6fa573ba8f8c (diff)
downloaddexon-f9917c8c7b6d16daadebd72977e56a8adc0382b0.tar.gz
dexon-f9917c8c7b6d16daadebd72977e56a8adc0382b0.tar.zst
dexon-f9917c8c7b6d16daadebd72977e56a8adc0382b0.zip
core: improved chainDb using sequential keys
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go4
1 files changed, 2 insertions, 2 deletions
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)