aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync.go
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 /eth/sync.go
parent5a458da42ae9a6525989c2d4515c6fa573ba8f8c (diff)
downloadgo-tangerine-f9917c8c7b6d16daadebd72977e56a8adc0382b0.tar
go-tangerine-f9917c8c7b6d16daadebd72977e56a8adc0382b0.tar.gz
go-tangerine-f9917c8c7b6d16daadebd72977e56a8adc0382b0.tar.bz2
go-tangerine-f9917c8c7b6d16daadebd72977e56a8adc0382b0.tar.lz
go-tangerine-f9917c8c7b6d16daadebd72977e56a8adc0382b0.tar.xz
go-tangerine-f9917c8c7b6d16daadebd72977e56a8adc0382b0.tar.zst
go-tangerine-f9917c8c7b6d16daadebd72977e56a8adc0382b0.zip
core: improved chainDb 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
}