mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +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;
|
||||
donationAddress = newDonationAddress;
|
||||
donationPercentage = newDonationPercentage;
|
||||
nVote = 0;
|
||||
lastVote = 0;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -114,6 +114,8 @@ public:
|
||||
swap(first.nLastDsq, second.nLastDsq);
|
||||
swap(first.donationAddress, second.donationAddress);
|
||||
swap(first.donationPercentage, second.donationPercentage);
|
||||
swap(first.nVote, second.nVote);
|
||||
swap(first.lastVote, second.lastVote);
|
||||
}
|
||||
|
||||
CMasternode& operator=(CMasternode from)
|
||||
@ -158,6 +160,8 @@ public:
|
||||
READWRITE(nLastDsq);
|
||||
READWRITE(donationAddress);
|
||||
READWRITE(donationPercentage);
|
||||
READWRITE(nVote);
|
||||
READWRITE(lastVote);
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -714,8 +714,12 @@ Value masternodelist(const Array& params, bool fHelp)
|
||||
|
||||
std::string strStatus = "ABSTAIN";
|
||||
|
||||
if(mn.nVote == -1) strStatus = "NAY";
|
||||
if(mn.nVote == 1) strStatus = "YAY";
|
||||
//voting lasts 7 days, ignore the last vote if it was older than that
|
||||
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()));
|
||||
} else if (strMode == "activeseconds") {
|
||||
|
Loading…
Reference in New Issue
Block a user