Do not create mnb until sync is finished (#2122)

We don't relay mnb if sync is still in progress. Creating mnb without
relaying it only increases inconsistency and leads to user confusion.
Unifying conditions for creation and relaying fixes this.
This commit is contained in:
UdjinM6 2018-06-18 19:08:00 +03:00 committed by GitHub
parent b98643c27d
commit b7c326115e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -368,8 +368,8 @@ bool CMasternodeBroadcast::Create(const std::string& strService, const std::stri
return false;
};
//need correct blocks to send ping
if (!fOffline && !masternodeSync.IsBlockchainSynced())
// Wait for sync to finish because mnb simply won't be relayed otherwise
if (!fOffline && !masternodeSync.IsSynced())
return Log("Sync in progress. Must wait until sync is complete to start Masternode");
if (!CMessageSigner::GetKeysFromSecret(strKeyMasternode, keyMasternodeNew, pubKeyMasternodeNew))