Skip to content

Commit

Permalink
[BUG][TierTwo] Clear fulfilled requests when mnsync fails
Browse files Browse the repository at this point in the history
the current asset should be checked, not the "next" one.
Github-Pull: #2559
Rebased-From: db36fb8
  • Loading branch information
random-zebra authored and furszy committed Sep 19, 2021
1 parent 5a2e0d1 commit 754177e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/masternode-sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,13 @@ int CMasternodeSync::GetNextAsset(int currentAsset)

void CMasternodeSync::SwitchToNextAsset()
{
if (RequestedMasternodeAssets == MASTERNODE_SYNC_INITIAL ||
RequestedMasternodeAssets == MASTERNODE_SYNC_FAILED) {
ClearFulfilledRequest();
}
const int nextAsset = GetNextAsset(RequestedMasternodeAssets);
if (nextAsset == MASTERNODE_SYNC_FINISHED) {
LogPrintf("%s - Sync has finished\n", __func__);
} else if (nextAsset == MASTERNODE_SYNC_FAILED) {
ClearFulfilledRequest();
}
RequestedMasternodeAssets = nextAsset;
RequestedMasternodeAttempt = 0;
Expand Down

0 comments on commit 754177e

Please sign in to comment.