aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-06-13 21:16:09 +0800
committerGitHub <noreply@github.com>2016-06-13 21:16:09 +0800
commita38be3eb488a349693a9c9905ab015278281f8db (patch)
tree34fa99ba38f421d9c7ffd308ed544cd5053df228 /miner
parent73c028c40a4f1336a0ab4b9773be0a9d7719777f (diff)
parentf9917c8c7b6d16daadebd72977e56a8adc0382b0 (diff)
downloadgo-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar
go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.gz
go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.bz2
go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.lz
go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.xz
go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.zst
go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.zip
Merge pull request #2455 from zsfelfoldi/chaindb
core: improved chain db performance by 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)