aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-09-21 20:36:29 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-10-19 15:03:09 +0800
commitc33cc382b3561ca91871111933f81653bfd8532f (patch)
tree0749dd4e4ebd66efe1272ee984e4dda06b4462be /eth/sync.go
parent92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8 (diff)
downloadgo-tangerine-c33cc382b3561ca91871111933f81653bfd8532f.tar
go-tangerine-c33cc382b3561ca91871111933f81653bfd8532f.tar.gz
go-tangerine-c33cc382b3561ca91871111933f81653bfd8532f.tar.bz2
go-tangerine-c33cc382b3561ca91871111933f81653bfd8532f.tar.lz
go-tangerine-c33cc382b3561ca91871111933f81653bfd8532f.tar.xz
go-tangerine-c33cc382b3561ca91871111933f81653bfd8532f.tar.zst
go-tangerine-c33cc382b3561ca91871111933f81653bfd8532f.zip
core: support inserting pure header chains
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 5a2031c68..6295083e2 100644
--- a/eth/sync.go
+++ b/eth/sync.go
@@ -160,7 +160,8 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
return
}
// Make sure the peer's TD is higher than our own. If not drop.
- if peer.Td().Cmp(pm.blockchain.Td()) <= 0 {
+ td := pm.blockchain.GetTd(pm.blockchain.CurrentBlock().Hash())
+ if peer.Td().Cmp(td) <= 0 {
return
}
// Otherwise try to sync with the downloader