Skip to content

Commit

Permalink
Remove non-DIP3 code path in CMasternodePayments::IsScheduled
Browse files Browse the repository at this point in the history
This relies on mnInfo which is not present anymore as we directly use
deterministicMNManager now.
  • Loading branch information
codablock committed Dec 31, 2018
1 parent 4c749b7 commit 1efd773
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,32 +645,12 @@ bool CMasternodePayments::IsScheduled(const CDeterministicMNCPtr& dmnIn, int nNo
{
LOCK(cs_mapMasternodeBlocks);

if (deterministicMNManager->IsDIP3Active()) {
auto projectedPayees = deterministicMNManager->GetListAtChainTip().GetProjectedMNPayees(8);
for (const auto &dmn : projectedPayees) {
if (dmn->proTxHash == dmnIn->proTxHash) {
return true;
}
}
return false;
}

if(!masternodeSync.IsMasternodeListSynced()) return false;

CScript mnpayee;
mnpayee = GetScriptForDestination(mnInfo.keyIDCollateralAddress);

for(int64_t h = nCachedBlockHeight; h <= nCachedBlockHeight + 8; h++){
if(h == nNotBlockHeight) continue;
std::vector<CTxOut> voutMasternodePayments;
if(GetBlockTxOuts(h, 0, voutMasternodePayments)) {
for (const auto& txout : voutMasternodePayments) {
if (txout.scriptPubKey == mnpayee)
return true;
}
auto projectedPayees = deterministicMNManager->GetListAtChainTip().GetProjectedMNPayees(8);
for (const auto &dmn : projectedPayees) {
if (dmn->proTxHash == dmnIn->proTxHash) {
return true;
}
}

return false;
}

Expand Down

0 comments on commit 1efd773

Please sign in to comment.