forked from Qortal/qortal
Relax minimum peer conditions for synchronization
This commit is contained in:
parent
cb7df0c5c1
commit
06794ab36c
@ -452,14 +452,17 @@ public class Controller extends Thread {
|
|||||||
// Disregard peers that don't have a recent block
|
// Disregard peers that don't have a recent block
|
||||||
peers.removeIf(hasNoRecentBlock);
|
peers.removeIf(hasNoRecentBlock);
|
||||||
|
|
||||||
|
// Check we have enough peers to potentially synchronize
|
||||||
|
if (peers.size() < Settings.getInstance().getMinBlockchainPeers())
|
||||||
|
return;
|
||||||
|
|
||||||
// Disregard peers that have no block signature or the same block signature as us
|
// Disregard peers that have no block signature or the same block signature as us
|
||||||
peers.removeIf(hasNoOrSameBlock);
|
peers.removeIf(hasNoOrSameBlock);
|
||||||
|
|
||||||
// Disregard peers that are on the same block as last sync attempt and we didn't like their chain
|
// Disregard peers that are on the same block as last sync attempt and we didn't like their chain
|
||||||
peers.removeIf(hasInferiorChainTip);
|
peers.removeIf(hasInferiorChainTip);
|
||||||
|
|
||||||
// Check we have enough peers to potentially synchronize
|
if (peers.isEmpty())
|
||||||
if (peers.size() < Settings.getInstance().getMinBlockchainPeers())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Pick random peer to sync with
|
// Pick random peer to sync with
|
||||||
|
Loading…
x
Reference in New Issue
Block a user