IsCaughtUp requires a peer
This commit is contained in:
parent
9247b0fbd2
commit
9357e8ecf8
|
@ -130,6 +130,11 @@ func (pool *BlockPool) IsCaughtUp() bool {
|
||||||
height := pool.height
|
height := pool.height
|
||||||
pool.mtx.Unlock()
|
pool.mtx.Unlock()
|
||||||
|
|
||||||
|
// Need at least 1 peer to be considered caught up.
|
||||||
|
if len(pool.peers) == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
pool.peersMtx.Lock()
|
pool.peersMtx.Lock()
|
||||||
maxPeerHeight := 0
|
maxPeerHeight := 0
|
||||||
for _, peer := range pool.peers {
|
for _, peer := range pool.peers {
|
||||||
|
|
Loading…
Reference in New Issue