diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 3b35f9b7ff..511178ecc2 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -848,16 +848,11 @@ std::string CMasternodePayments::ToString() const return info.str(); } -bool CMasternodePayments::IsEnoughData(int nMnCount) { - if(GetBlockCount() > nMnCount * nStorageCoeff && GetBlockCount() > nMinBlocksToStore) - { - float nAverageVotes = (MNPAYMENTS_SIGNATURES_TOTAL + MNPAYMENTS_SIGNATURES_REQUIRED) / 2; - if(GetVoteCount() > nMnCount * nStorageCoeff * nAverageVotes && GetVoteCount() > nMinBlocksToStore * nAverageVotes) - { - return true; - } - } - return false; +bool CMasternodePayments::IsEnoughData() +{ + float nAverageVotes = (MNPAYMENTS_SIGNATURES_TOTAL + MNPAYMENTS_SIGNATURES_REQUIRED) / 2; + int nStorageLimit = GetStorageLimit(); + return GetBlockCount() > nStorageLimit && GetVoteCount() > nStorageLimit * nAverageVotes; } int CMasternodePayments::GetStorageLimit() diff --git a/src/masternode-payments.h b/src/masternode-payments.h index 3fa3683366..cb7efa3192 100644 --- a/src/masternode-payments.h +++ b/src/masternode-payments.h @@ -205,7 +205,7 @@ public: int GetBlockCount() { return mapMasternodeBlocks.size(); } int GetVoteCount() { return mapMasternodePaymentVotes.size(); } - bool IsEnoughData(int nMnCount); + bool IsEnoughData(); int GetStorageLimit(); void UpdatedBlockTip(const CBlockIndex *pindex); diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 0099efdb7e..766e895f7c 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -296,7 +296,7 @@ void CMasternodeSync::ProcessTick() // check for data // if mnpayments already has enough blocks and votes, switch to the next asset // try to fetch data from at least two peers though - if(nRequestedMasternodeAttempt > 1 && mnpayments.IsEnoughData(mnpayments.GetStorageLimit())) { + if(nRequestedMasternodeAttempt > 1 && mnpayments.IsEnoughData()) { LogPrintf("CMasternodeSync::Process -- nTick %d nRequestedMasternodeAssets %d -- found enough data\n", nTick, nRequestedMasternodeAssets); SwitchToNextAsset(); return;