eth: fix data race accessing peer.td

This commit is contained in:
Péter Szilágyi
2015-06-09 14:56:27 +03:00
parent 44147d057d
commit f86707713c
3 changed files with 33 additions and 14 deletions

View File

@ -208,7 +208,7 @@ 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.chainman.Td()) <= 0 {
if peer.Td().Cmp(pm.chainman.Td()) <= 0 {
return
}
// FIXME if we have the hash in our chain and the TD of the peer is