Skip to content

Commit

Permalink
tier two: do not request single missing mn entries until the initial …
Browse files Browse the repository at this point in the history
…sync process is completed.
  • Loading branch information
furszy committed Oct 27, 2021
1 parent 156b6a9 commit 5dd052c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,10 @@ void CMasternodePayments::ProcessMessageMasternodePayments(CNode* pfrom, std::st
// If it's not a DMN, then it could be a non-synced MN.
// Let's try to request the MN to the node.
// (the AskForMN() will only broadcast it every 10 min).
mnodeman.AskForMN(pfrom, winner.vinMasternode);

// But, only ask for missing items after the initial syncing process is complete
// otherwise will think a full sync succeeded when they return a result
if (pfrom && masternodeSync.IsSynced()) mnodeman.AskForMN(pfrom, winner.vinMasternode);
}
return;
}
Expand Down
6 changes: 4 additions & 2 deletions src/masternodeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,10 @@ int CMasternodeMan::ProcessMNPing(CNode* pfrom, CMasternodePing& mnp)
}

// something significant is broken or mn is unknown,
// we might have to ask for a masternode entry once
AskForMN(pfrom, mnp.vin);
// we might have to ask for the mn entry (while we aren't syncing).
if (masternodeSync.IsSynced()) {
AskForMN(pfrom, mnp.vin);
}

// All good
return 0;
Expand Down

0 comments on commit 5dd052c

Please sign in to comment.