changed enforcement strategy for mn payments

This commit is contained in:
Evan Duffield 2015-06-21 10:06:25 -07:00
parent 892212d407
commit dddc095856
2 changed files with 4 additions and 8 deletions

View File

@ -288,9 +288,9 @@ bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew)
BOOST_FOREACH(CMasternodePayee& payee, vecPayments) BOOST_FOREACH(CMasternodePayee& payee, vecPayments)
if(payee.nVotes >= nMaxSignatures && payee.nVotes >= MNPAYMENTS_SIGNATURES_REQUIRED) if(payee.nVotes >= nMaxSignatures && payee.nVotes >= MNPAYMENTS_SIGNATURES_REQUIRED)
nMaxSignatures = payee.nVotes; nMaxSignatures = payee.nVotes;
// if we don't have at least 6 signatures on a payee, approve whichever is the longest chain // if we don't have at least 6 signatures on a payee, approve whichever is the longest chain
if(nMaxSignatures == 0) return true; if(nMaxSignatures < MNPAYMENTS_SIGNATURES_REQUIRED) return true;
BOOST_FOREACH(CMasternodePayee& payee, vecPayments) BOOST_FOREACH(CMasternodePayee& payee, vecPayments)
{ {
@ -299,11 +299,7 @@ bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew)
if(payee.scriptPubKey == out.scriptPubKey && payee.nValue == out.nValue) if(payee.scriptPubKey == out.scriptPubKey && payee.nValue == out.nValue)
found = true; found = true;
//if 2 contenders are within +/- 20%, take either if(payee.nVotes >= MNPAYMENTS_SIGNATURES_REQUIRED){
// If nMaxSignatures == 6, the min signatures = 2
// If nMaxSignatures == 10, the min signatures = 6
// If nMaxSignatures == 15, the min signatures = 11
if(payee.nVotes >= nMaxSignatures-(MNPAYMENTS_SIGNATURES_TOTAL/5)){
if(found) return true; if(found) return true;
CTxDestination address1; CTxDestination address1;

View File

@ -23,7 +23,7 @@ extern std::map<uint256, CMasternodeBlockPayees> mapMasternodeBlocks;
static const int MIN_MNPAYMENTS_PROTO_VERSION = 70066; static const int MIN_MNPAYMENTS_PROTO_VERSION = 70066;
#define MNPAYMENTS_SIGNATURES_REQUIRED 6 #define MNPAYMENTS_SIGNATURES_REQUIRED 6
#define MNPAYMENTS_SIGNATURES_TOTAL 20 #define MNPAYMENTS_SIGNATURES_TOTAL 10
void ProcessMessageMasternodePayments(CNode* pfrom, std::string& strCommand, CDataStream& vRecv); void ProcessMessageMasternodePayments(CNode* pfrom, std::string& strCommand, CDataStream& vRecv);
bool IsReferenceNode(CTxIn& vin); bool IsReferenceNode(CTxIn& vin);