From d95fb9b59ae94057f27975559704369490e52e36 Mon Sep 17 00:00:00 2001 From: furszy Date: Wed, 1 Dec 2021 22:43:20 -0300 Subject: [PATCH] masternodesync: decrease mnw sync threshold to 4 peers. MNW initial sync is mostly for historical reasons, get +20k items per peer (+120k items total for the previous threshold of 6) is a high amount of duplicated data relayed over the wire. 89k is still very high but.. it's something that we have to live with until v6.0. Github-Pull: #2659 Rebased-From: 70203103e18b5e0dc95bc80fa8b1ae5fc761fec1 --- src/masternode-sync.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 6dfdeb62273e2..c58443c57f8d7 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -411,7 +411,7 @@ bool CMasternodeSync::SyncWithNode(CNode* pnode, bool fLegacyMnObsolete) // timeout if (lastMasternodeWinner == 0 && - (RequestedMasternodeAttempt >= MASTERNODE_SYNC_THRESHOLD * 3 || GetTime() - nAssetSyncStarted > MASTERNODE_SYNC_TIMEOUT * 5)) { + (RequestedMasternodeAttempt >= MASTERNODE_SYNC_THRESHOLD * 2 || GetTime() - nAssetSyncStarted > MASTERNODE_SYNC_TIMEOUT * 5)) { if (sporkManager.IsSporkActive(SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT)) { syncTimeout("MASTERNODE_SYNC_MNW"); } else { @@ -425,8 +425,8 @@ bool CMasternodeSync::SyncWithNode(CNode* pnode, bool fLegacyMnObsolete) return false; } - // Don't request mnw initial sync to more than 6 randomly ordered peers in this round. - if (RequestedMasternodeAttempt >= MASTERNODE_SYNC_THRESHOLD * 3) return false; + // Don't request mnw initial sync to more than 4 randomly ordered peers in this round. + if (RequestedMasternodeAttempt >= MASTERNODE_SYNC_THRESHOLD * 2) return false; // Request mnw sync if we haven't requested it yet. if (pnode->HasFulfilledRequest("mnwsync")) return true;