Skip to content

Commit 5833e69

Browse files
committed
Refactor: Do not call masternode-payments object from the masternode-payments object.
1 parent 8a445e4 commit 5833e69

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/masternode-payments.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ void CMasternodePayments::ProcessMessageMasternodePayments(CNode* pfrom, std::st
431431
}
432432

433433
pfrom->FulfilledRequest(NetMsgType::GETMNWINNERS);
434-
masternodePayments.Sync(pfrom, nCountNeeded);
434+
Sync(pfrom, nCountNeeded);
435435
LogPrint(BCLog::MASTERNODE, "mnget - Sent Masternode winners to peer %i\n", pfrom->GetId());
436436
} else if (strCommand == NetMsgType::MNWINNER) { //Masternode Payments Declare Winner
437437
//this is required in litemodef
@@ -448,7 +448,7 @@ bool CMasternodePayments::ProcessMNWinner(CMasternodePaymentWinner& winner, CNod
448448
{
449449
int nHeight = mnodeman.GetBestHeight();
450450

451-
if (masternodePayments.mapMasternodePayeeVotes.count(winner.GetHash())) {
451+
if (mapMasternodePayeeVotes.count(winner.GetHash())) {
452452
LogPrint(BCLog::MASTERNODE, "mnw - Already seen - %s bestHeight %d\n", winner.GetHash().ToString().c_str(), nHeight);
453453
masternodeSync.AddedMasternodeWinner(winner.GetHash());
454454
return false;
@@ -471,7 +471,7 @@ bool CMasternodePayments::ProcessMNWinner(CMasternodePaymentWinner& winner, CNod
471471
return false;
472472
}
473473

474-
if (!masternodePayments.CanVote(winner.vinMasternode.prevout, winner.nBlockHeight)) {
474+
if (!CanVote(winner.vinMasternode.prevout, winner.nBlockHeight)) {
475475
return state.Error("MN already voted");
476476
}
477477

@@ -503,7 +503,7 @@ bool CMasternodePayments::ProcessMNWinner(CMasternodePaymentWinner& winner, CNod
503503
return state.Error("invalid voter mnwinner signature");
504504
}
505505

506-
if (!masternodePayments.AddWinningMasternode(winner)) {
506+
if (!AddWinningMasternode(winner)) {
507507
return state.Error("Failed to add mnwinner"); // move state inside AddWinningMasternode
508508
}
509509

src/test/mnpayments_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ BOOST_FIXTURE_TEST_CASE(mnwinner_test, TestChain100Setup)
162162
// Voter MN2, fail because MN2 is not enabled
163163
pSecondMN->SetSpent();
164164
BOOST_CHECK(!pSecondMN->IsEnabled());
165-
mnVinVoter = CTxIn(pSecondMN->vin);
166165
CValidationState state3;
167166
BOOST_CHECK(!CreateMNWinnerPayment(mnVinVoter, paymentBlockHeight, payeeScript,
168167
secondMn.data.mnPrivKey, secondMn.data.mnPubKey, state3));

0 commit comments

Comments
 (0)