Skip to content

Commit e400bd2

Browse files
author
Evan Duffield
committed
fixed bug with multiple masternode payments
1 parent c057202 commit e400bd2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/clientversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define CLIENT_VERSION_MAJOR 0
1010
#define CLIENT_VERSION_MINOR 9
1111
#define CLIENT_VERSION_REVISION 3
12-
#define CLIENT_VERSION_BUILD 1
12+
#define CLIENT_VERSION_BUILD 2
1313

1414
// Set to true for release, false for prerelease or test build
1515
#define CLIENT_VERSION_IS_RELEASE true

src/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2612,7 +2612,7 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk
26122612
return state.DoS(100, error("CheckBlock() : Vote too old"));
26132613
} else if((pindexPrev->nHeight+1) - mv1.GetHeight() == MASTERNODE_PAYMENTS_EXPIRATION){
26142614
removedMasterNodePayments++;
2615-
} else if(mv1.GetVotes() == MASTERNODE_PAYMENTS_MIN_VOTES-1 && foundMasterNodePaymentPrev <= MASTERNODE_PAYMENTS_MAX) {
2615+
} else if(mv1.GetVotes() >= MASTERNODE_PAYMENTS_MIN_VOTES-1 && foundMasterNodePaymentPrev < MASTERNODE_PAYMENTS_MAX) {
26162616
for (unsigned int i = 1; i < vtx[0].vout.size(); i++)
26172617
if(vtx[0].vout[i].nValue == masternodePaymentAmount && mv1.GetPubKey() == vtx[0].vout[i].scriptPubKey)
26182618
foundMasterNodePayment++;
@@ -4937,7 +4937,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
49374937
BOOST_FOREACH(CMasterNodeVote& mv1, blockLast.vmn){
49384938
// vote if you agree with it, if you're the last vote you must vote yes to avoid the greedy voter exploit
49394939
// i.e: You only vote yes when you're not the one that is going to pay
4940-
if(mv1.GetVotes() == MASTERNODE_PAYMENTS_MIN_VOTES-1){
4940+
if(mv1.GetVotes() >= MASTERNODE_PAYMENTS_MIN_VOTES-1){
49414941
mv1.Vote();
49424942
} else {
49434943
BOOST_FOREACH(CMasterNodeVote& mv2, darkSendMasterNodeVotes) {

0 commit comments

Comments
 (0)