Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, int64_t nFe
}
}

int CMasternodePayments::GetMinMasternodePaymentsProto() {
return IsSporkActive(SPORK_10_MASTERNODE_PAY_NEWEST_NODES)
? MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2
: MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1;
}

void CMasternodePayments::ProcessMessageMasternodePayments(CNode* pfrom, std::string& strCommand, CDataStream& vRecv)
{
if(IsInitialBlockDownload()) return;
Expand Down Expand Up @@ -415,7 +409,7 @@ bool CMasternodePaymentWinner::IsValid()
{
if(IsReferenceNode(vinMasternode)) return true;

int n = mnodeman.GetMasternodeRank(vinMasternode, nBlockHeight-100, GetMinMasternodePaymentsProto());
int n = mnodeman.GetMasternodeRank(vinMasternode, nBlockHeight-100, MIN_MNPAYMENTS_PROTO_VERSION);

if(n == -1)
{
Expand All @@ -441,7 +435,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
//reference node - hybrid mode

if(!IsReferenceNode(activeMasternode.vin)){
int n = mnodeman.GetMasternodeRank(activeMasternode.vin, nBlockHeight-100, GetMinMasternodePaymentsProto());
int n = mnodeman.GetMasternodeRank(activeMasternode.vin, nBlockHeight-100, MIN_MNPAYMENTS_PROTO_VERSION);

if(n == -1)
{
Expand Down
4 changes: 2 additions & 2 deletions src/masternode-payments.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extern CMasternodePayments masternodePayments;
extern std::map<uint256, CMasternodePaymentWinner> mapMasternodePayeeVotes;
extern std::map<uint256, CMasternodeBlockPayees> mapMasternodeBlocks;

static const int MIN_MNPAYMENTS_PROTO_VERSION = 70066;
#define MNPAYMENTS_SIGNATURES_REQUIRED 6
#define MNPAYMENTS_SIGNATURES_TOTAL 10

Expand Down Expand Up @@ -199,12 +200,11 @@ class CMasternodePayments
bool IsTransactionValid(const CTransaction& txNew, int nBlockHeight);
bool IsScheduled(CMasternode& mn, int nNotBlockHeight);

int GetMinMasternodePaymentsProto();
void ProcessMessageMasternodePayments(CNode* pfrom, std::string& strCommand, CDataStream& vRecv);
std::string GetRequiredPaymentsString(int nBlockHeight);
void FillBlockPayee(CMutableTransaction& txNew, int64_t nFees);

};


#endif
#endif
7 changes: 6 additions & 1 deletion src/masternodeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,12 @@ CMasternode* CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeight
if(!mn.IsEnabled()) continue;

// //check protocol version
if(mn.protocolVersion < masternodePayments.GetMinMasternodePaymentsProto()) continue;
if(IsSporkActive(SPORK_10_MASTERNODE_PAY_NEWEST_NODES)){
if(mn.protocolVersion < MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2) continue;
} else {
//support older versions for a period of time
if(mn.protocolVersion < MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1) continue;
}

//it's in the list -- so let's skip it
if(masternodePayments.IsScheduled(mn, nBlockHeight)) continue;
Expand Down