forked from Qortal/qortal
Moved version check above getMinBlockchainPeers() check, so that nodes with old versions aren't counted.
This commit is contained in:
parent
c4cbb64643
commit
af9b536dd9
@ -644,11 +644,15 @@ 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);
|
||||||
|
|
||||||
|
// Disregard peers that are on an old version
|
||||||
|
peers.removeIf(hasOldVersion);
|
||||||
|
|
||||||
checkRecoveryModeForPeers(peers);
|
checkRecoveryModeForPeers(peers);
|
||||||
if (recoveryMode) {
|
if (recoveryMode) {
|
||||||
peers = Network.getInstance().getHandshakedPeers();
|
peers = Network.getInstance().getHandshakedPeers();
|
||||||
peers.removeIf(hasOnlyGenesisBlock);
|
peers.removeIf(hasOnlyGenesisBlock);
|
||||||
peers.removeIf(hasMisbehaved);
|
peers.removeIf(hasMisbehaved);
|
||||||
|
peers.removeIf(hasOldVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check we have enough peers to potentially synchronize
|
// Check we have enough peers to potentially synchronize
|
||||||
@ -661,9 +665,6 @@ public class Controller extends Thread {
|
|||||||
// 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);
|
||||||
|
|
||||||
// Disregard peers that are on an old version
|
|
||||||
peers.removeIf(hasOldVersion);
|
|
||||||
|
|
||||||
final int peersBeforeComparison = peers.size();
|
final int peersBeforeComparison = peers.size();
|
||||||
|
|
||||||
// Request recent block summaries from the remaining peers, and locate our common block with each
|
// Request recent block summaries from the remaining peers, and locate our common block with each
|
||||||
|
Loading…
Reference in New Issue
Block a user