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) {
|
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;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -199,8 +199,8 @@ public:
|
|||||||
class CMasternodePayments
|
class CMasternodePayments
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int nMinBlocksToStore;
|
const int nMinBlocksToStore;
|
||||||
float nStorageCoeff;
|
const float nStorageCoeff;
|
||||||
|
|
||||||
// Keep track of current block index
|
// Keep track of current block index
|
||||||
const CBlockIndex *pCurrentBlockIndex;
|
const CBlockIndex *pCurrentBlockIndex;
|
||||||
@ -210,9 +210,7 @@ public:
|
|||||||
std::map<int, CMasternodeBlockPayees> mapMasternodeBlocks;
|
std::map<int, CMasternodeBlockPayees> mapMasternodeBlocks;
|
||||||
std::map<uint256, int> mapMasternodesLastVote; //Hash(BEGIN(prevout.hash), END(prevout.n)), nBlockHeight
|
std::map<uint256, int> mapMasternodesLastVote; //Hash(BEGIN(prevout.hash), END(prevout.n)), nBlockHeight
|
||||||
|
|
||||||
CMasternodePayments() {
|
CMasternodePayments() : nMinBlocksToStore(4000), nStorageCoeff(1.25) {
|
||||||
nMinBlocksToStore = 4000;
|
|
||||||
nStorageCoeff = 1.25;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clear() {
|
void Clear() {
|
||||||
|
Loading…
Reference in New Issue
Block a user