core: improved chainDb using sequential keys

This commit is contained in:
zsfelfoldi
2016-04-05 15:22:04 +02:00
parent 5a458da42a
commit f9917c8c7b
24 changed files with 727 additions and 366 deletions

View File

@ -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
}