[release/1.4.6] eth: don't accept transactions until we sync up with the network

(cherry picked from commit 32559ccad1)
This commit is contained in:
Péter Szilágyi
2016-06-02 15:54:07 +03:00
parent 058c5fe960
commit ecb8e23e88
3 changed files with 13 additions and 4 deletions

View File

@@ -174,6 +174,8 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
if err := pm.downloader.Synchronise(peer.id, peer.Head(), peer.Td(), mode); err != nil {
return
}
atomic.StoreUint32(&pm.synced, 1) // Mark initial sync done
// If fast sync was enabled, and we synced up, disable it
if atomic.LoadUint32(&pm.fastSync) == 1 {
// Disable fast sync if we indeed have something in our chain