aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync.go
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 /eth/sync.go
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 'eth/sync.go')
-rw-r--r--eth/sync.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/eth/sync.go b/eth/sync.go
index 52f7e90e7..23cf18c8d 100644
--- a/eth/sync.go
+++ b/eth/sync.go
@@ -162,7 +162,8 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
return
}
// Make sure the peer's TD is higher than our own. If not drop.
- td := pm.blockchain.GetTd(pm.blockchain.CurrentBlock().Hash())
+ currentBlock := pm.blockchain.CurrentBlock()
+ td := pm.blockchain.GetTd(currentBlock.Hash(), currentBlock.NumberU64())
if peer.Td().Cmp(td) <= 0 {
return
}