New masternodes must wait till end of queue

This commit is contained in:
Evan Duffield 2015-07-23 07:16:55 -07:00
parent cd862ac1ea
commit 35cc21edf3
2 changed files with 6 additions and 2 deletions

View File

@ -1079,7 +1079,7 @@ 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. 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()) { if(address.IsPayToScriptHash()) {
strError = "Multisig is not currently supported." strError = "Multisig is not currently supported.";
return false; return false;
} }

View File

@ -399,6 +399,7 @@ CMasternode* CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeight
Make a vector with all of the last paid times Make a vector with all of the last paid times
*/ */
int nMnCount = CountEnabled();
BOOST_FOREACH(CMasternode &mn, vMasternodes) BOOST_FOREACH(CMasternode &mn, vMasternodes)
{ {
mn.Check(); mn.Check();
@ -410,8 +411,11 @@ CMasternode* CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeight
//it's in the list (up to 8 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; if(masternodePayments.IsScheduled(mn, nBlockHeight)) continue;
//it's too new, wait for a cycle
if(mn.sigTime + (nMnCount*2.6*60) > GetAdjustedTime()) continue;
//make sure it has as many confirmations as there are masternodes //make sure it has as many confirmations as there are masternodes
if(mn.GetMasternodeInputAge() < CountEnabled()) continue; if(mn.GetMasternodeInputAge() < nMnCount) continue;
vecMasternodeLastPaid.push_back(make_pair(mn.SecondsSincePayment(), mn.vin)); vecMasternodeLastPaid.push_back(make_pair(mn.SecondsSincePayment(), mn.vin));
} }