Skip to content

Commit

Permalink
masternodesync: decrease mnw sync threshold to 4 peers.
Browse files Browse the repository at this point in the history
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: bitcoin#2659
Rebased-From: 7020310
  • Loading branch information
furszy committed Dec 14, 2021
1 parent cfc15b6 commit d95fb9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/masternode-sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit d95fb9b

Please sign in to comment.