mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Disable multisig proposals / IsScheduled read ahead 8 blocks
This commit is contained in:
parent
5cccd2b269
commit
cd862ac1ea
@ -1075,8 +1075,17 @@ bool CBudgetProposal::IsValid(std::string& strError, bool fCheckCollateral)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: There might be an issue with multisig in the coinbase on mainnet, we will add support for it in a future release.
|
||||
*/
|
||||
if(address.IsPayToScriptHash()) {
|
||||
strError = "Multisig is not currently supported."
|
||||
return false;
|
||||
}
|
||||
|
||||
//if proposal doesn't gain traction within 2 weeks, remove it
|
||||
// nTime not being saved correctly
|
||||
// -- TODO: We should keep track of the last time the proposal was valid, if it's invalid for 2 weeks, erase it
|
||||
// if(nTime + (60*60*24*2) < GetAdjustedTime()) {
|
||||
// if(GetYeas()-GetNays() < (mnodeman.CountEnabled(MIN_BUDGET_PEER_PROTO_VERSION)/10)) {
|
||||
// strError = "Not enough support";
|
||||
|
@ -428,7 +428,7 @@ bool CMasternodePayments::GetBlockPayee(int nBlockHeight, CScript& payee)
|
||||
}
|
||||
|
||||
// Is this masternode scheduled to get paid soon?
|
||||
// -- Only look ahead up to 7 blocks to allow for propagation
|
||||
// -- Only look ahead up to 8 blocks to allow for propagation of the latest 2 winners
|
||||
bool CMasternodePayments::IsScheduled(CMasternode& mn, int nNotBlockHeight)
|
||||
{
|
||||
CBlockIndex* pindexPrev = chainActive.Tip();
|
||||
@ -438,7 +438,7 @@ bool CMasternodePayments::IsScheduled(CMasternode& mn, int nNotBlockHeight)
|
||||
mnpayee = GetScriptForDestination(mn.pubkey.GetID());
|
||||
|
||||
CScript payee;
|
||||
for(int64_t h = pindexPrev->nHeight; h <= pindexPrev->nHeight+7; h++){
|
||||
for(int64_t h = pindexPrev->nHeight; h <= pindexPrev->nHeight+8; h++){
|
||||
if(h == nNotBlockHeight) continue;
|
||||
if(mapMasternodeBlocks.count(h)){
|
||||
if(mapMasternodeBlocks[h].GetPayee(payee)){
|
||||
|
@ -407,7 +407,7 @@ CMasternode* CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeight
|
||||
// //check protocol version
|
||||
if(mn.protocolVersion < masternodePayments.GetMinMasternodePaymentsProto()) continue;
|
||||
|
||||
//it's in the list (up to 7 entries ahead of current block to allow propagation) -- so let's skip it
|
||||
//it's in the list (up to 8 entries ahead of current block to allow propagation) -- so let's skip it
|
||||
if(masternodePayments.IsScheduled(mn, nBlockHeight)) continue;
|
||||
|
||||
//make sure it has as many confirmations as there are masternodes
|
||||
@ -420,8 +420,8 @@ CMasternode* CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeight
|
||||
sort(vecMasternodeLastPaid.rbegin(), vecMasternodeLastPaid.rend(), CompareValueOnly());
|
||||
|
||||
// Look at 1/10 of the oldest nodes (by last payment), calculate their scores and pay the best one
|
||||
// -- This doesn't look at who is being paid in the +7-10 blocks, allowing for double payments very rarely
|
||||
// -- 1/100 payments should be a double payment on mainnet - (1/(3000/10))*3 --(chance per block * chances before IsScheduled will fire)
|
||||
// -- This doesn't look at who is being paid in the +8-10 blocks, allowing for double payments very rarely
|
||||
// -- 1/100 payments should be a double payment on mainnet - (1/(3000/10))*2 --(chance per block * chances before IsScheduled will fire)
|
||||
int nTenthNetwork = mnodeman.CountEnabled()/10;
|
||||
int nCount = 0;
|
||||
uint256 nHigh = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user