Make fast_sync=true by default, with more relaxed conditions

This commit is contained in:
Jae Kwon
2015-12-31 00:32:54 -08:00
parent 94194fea46
commit 5a8a9bfd69
2 changed files with 3 additions and 4 deletions

View File

@ -131,14 +131,13 @@ func (pool *BlockPool) IsCaughtUp() bool {
pool.mtx.Unlock()
pool.peersMtx.Lock()
numPeers := len(pool.peers)
maxPeerHeight := 0
for _, peer := range pool.peers {
maxPeerHeight = MaxInt(maxPeerHeight, peer.height)
}
pool.peersMtx.Unlock()
return numPeers >= 3 && (height > 0 || time.Now().Sub(pool.startTime) > 30*time.Second) && (maxPeerHeight == 0 || height == maxPeerHeight)
return (height > 0 || time.Now().Sub(pool.startTime) > 5*time.Second) && (maxPeerHeight == 0 || height == maxPeerHeight)
}
// We need to see the second block's Validation to validate the first block.