mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Merge pull request #332 from UdjinM6/v0.12.0.x_fix_mnpayment_bugs
V0.12.0.x fix 2 masternode payments bugs
This commit is contained in:
commit
5cb819c3f8
@ -2931,9 +2931,9 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
|
|||||||
// ----------- masternode payments -----------
|
// ----------- masternode payments -----------
|
||||||
|
|
||||||
CBlockIndex* pindexPrev = chainActive.Tip();
|
CBlockIndex* pindexPrev = chainActive.Tip();
|
||||||
if(pindexPrev != NULL)
|
if(pindexPrev != NULL)
|
||||||
{
|
{
|
||||||
if(IsBlockPayeeValid(block.vtx[0], pindexPrev->nHeight+1))
|
if(!IsBlockPayeeValid(block.vtx[0], pindexPrev->nHeight+1))
|
||||||
{
|
{
|
||||||
if(Params().NetworkID() != CBaseChainParams::REGTEST)
|
if(Params().NetworkID() != CBaseChainParams::REGTEST)
|
||||||
return state.DoS(100, error("CheckBlock() : Couldn't find masternode payment or payee"));
|
return state.DoS(100, error("CheckBlock() : Couldn't find masternode payment or payee"));
|
||||||
|
@ -160,7 +160,7 @@ bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew)
|
|||||||
//require at least 6 signatures
|
//require at least 6 signatures
|
||||||
|
|
||||||
BOOST_FOREACH(CMasternodePayee& payee, vecPayments)
|
BOOST_FOREACH(CMasternodePayee& payee, vecPayments)
|
||||||
if(payee.nVotes >= nMaxSignatures && 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
|
||||||
@ -443,4 +443,4 @@ void CMasternodePayments::Sync(CNode* node)
|
|||||||
node->PushMessage("mnw", winner);
|
node->PushMessage("mnw", winner);
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user