mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 21:42:47 +01:00
masternode voting improvements
This commit is contained in:
parent
1cf72dea8c
commit
649937dc4f
@ -194,6 +194,8 @@ CMasternode::CMasternode(CService newAddr, CTxIn newVin, CPubKey newPubkey, std:
|
|||||||
nScanningErrorCount = 0;
|
nScanningErrorCount = 0;
|
||||||
donationAddress = newDonationAddress;
|
donationAddress = newDonationAddress;
|
||||||
donationPercentage = newDonationPercentage;
|
donationPercentage = newDonationPercentage;
|
||||||
|
nVote = 0;
|
||||||
|
lastVote = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -114,6 +114,8 @@ public:
|
|||||||
swap(first.nLastDsq, second.nLastDsq);
|
swap(first.nLastDsq, second.nLastDsq);
|
||||||
swap(first.donationAddress, second.donationAddress);
|
swap(first.donationAddress, second.donationAddress);
|
||||||
swap(first.donationPercentage, second.donationPercentage);
|
swap(first.donationPercentage, second.donationPercentage);
|
||||||
|
swap(first.nVote, second.nVote);
|
||||||
|
swap(first.lastVote, second.lastVote);
|
||||||
}
|
}
|
||||||
|
|
||||||
CMasternode& operator=(CMasternode from)
|
CMasternode& operator=(CMasternode from)
|
||||||
@ -158,6 +160,8 @@ public:
|
|||||||
READWRITE(nLastDsq);
|
READWRITE(nLastDsq);
|
||||||
READWRITE(donationAddress);
|
READWRITE(donationAddress);
|
||||||
READWRITE(donationPercentage);
|
READWRITE(donationPercentage);
|
||||||
|
READWRITE(nVote);
|
||||||
|
READWRITE(lastVote);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -714,8 +714,12 @@ Value masternodelist(const Array& params, bool fHelp)
|
|||||||
|
|
||||||
std::string strStatus = "ABSTAIN";
|
std::string strStatus = "ABSTAIN";
|
||||||
|
|
||||||
if(mn.nVote == -1) strStatus = "NAY";
|
//voting lasts 7 days, ignore the last vote if it was older than that
|
||||||
if(mn.nVote == 1) strStatus = "YAY";
|
if((GetAdjustedTime() - mn.lastVote) < (60*60*8))
|
||||||
|
{
|
||||||
|
if(mn.nVote == -1) strStatus = "NAY";
|
||||||
|
if(mn.nVote == 1) strStatus = "YEA";
|
||||||
|
}
|
||||||
|
|
||||||
obj.push_back(Pair(strAddr, strStatus.c_str()));
|
obj.push_back(Pair(strAddr, strStatus.c_str()));
|
||||||
} else if (strMode == "activeseconds") {
|
} else if (strMode == "activeseconds") {
|
||||||
|
Loading…
Reference in New Issue
Block a user