Sync mn list and mnw list from 3 peers max (#2169)

Should solve issues with initial sync and reduce load/bandwidth in general.
This commit is contained in:
UdjinM6 2018-07-08 00:19:54 +03:00 committed by GitHub
parent 2c303cdb11
commit 2474d9cb8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -259,6 +259,12 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
return;
}
// request from three peers max
if (nRequestedMasternodeAttempt > 2) {
connman.ReleaseNodeVector(vNodesCopy);
return;
}
// only request once from each peer
if(netfulfilledman.HasFulfilledRequest(pnode->addr, "masternode-list-sync")) continue;
netfulfilledman.AddFulfilledRequest(pnode->addr, "masternode-list-sync");
@ -303,6 +309,12 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
return;
}
// request from three peers max
if (nRequestedMasternodeAttempt > 2) {
connman.ReleaseNodeVector(vNodesCopy);
return;
}
// only request once from each peer
if(netfulfilledman.HasFulfilledRequest(pnode->addr, "masternode-payment-sync")) continue;
netfulfilledman.AddFulfilledRequest(pnode->addr, "masternode-payment-sync");