There is a bug in mnw fix, so... fix the fix (should be &&
not ||
) (#837)
Also make `nMinBlocksToStore` and `nStorageCoeff` const
This commit is contained in:
parent
4d55bc9666
commit
fb1ffded70
@ -677,10 +677,10 @@ int CMasternodePayments::GetNewestBlock()
|
||||
}
|
||||
|
||||
bool CMasternodePayments::IsEnoughData(int nMnCount) {
|
||||
if(GetBlockCount() > nMnCount * nStorageCoeff || GetBlockCount() > nMinBlocksToStore)
|
||||
if(GetBlockCount() > nMnCount * nStorageCoeff && GetBlockCount() > nMinBlocksToStore)
|
||||
{
|
||||
float nAverageVotes = (MNPAYMENTS_SIGNATURES_TOTAL + MNPAYMENTS_SIGNATURES_REQUIRED) / 2;
|
||||
if(GetVoteCount() > nMnCount * nStorageCoeff * nAverageVotes || GetVoteCount() > nMinBlocksToStore * nAverageVotes)
|
||||
if(GetVoteCount() > nMnCount * nStorageCoeff * nAverageVotes && GetVoteCount() > nMinBlocksToStore * nAverageVotes)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -199,8 +199,8 @@ public:
|
||||
class CMasternodePayments
|
||||
{
|
||||
private:
|
||||
int nMinBlocksToStore;
|
||||
float nStorageCoeff;
|
||||
const int nMinBlocksToStore;
|
||||
const float nStorageCoeff;
|
||||
|
||||
// Keep track of current block index
|
||||
const CBlockIndex *pCurrentBlockIndex;
|
||||
@ -210,9 +210,7 @@ public:
|
||||
std::map<int, CMasternodeBlockPayees> mapMasternodeBlocks;
|
||||
std::map<uint256, int> mapMasternodesLastVote; //Hash(BEGIN(prevout.hash), END(prevout.n)), nBlockHeight
|
||||
|
||||
CMasternodePayments() {
|
||||
nMinBlocksToStore = 4000;
|
||||
nStorageCoeff = 1.25;
|
||||
CMasternodePayments() : nMinBlocksToStore(4000), nStorageCoeff(1.25) {
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
|
Loading…
Reference in New Issue
Block a user