mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Revert CMasternodePayments::IsTransactionValid to the logic before the recent refactorings (#2237)
partially reverts #2216
This commit is contained in:
parent
73c2ddde7a
commit
e415fd049a
@ -706,30 +706,9 @@ std::string CMasternodePayments::GetRequiredPaymentsString(int nBlockHeight) con
|
||||
|
||||
bool CMasternodePayments::IsTransactionValid(const CTransaction& txNew, int nBlockHeight, CAmount blockReward) const
|
||||
{
|
||||
std::vector<CTxOut> voutMasternodePayments;
|
||||
if (!GetBlockTxOuts(nBlockHeight, blockReward, voutMasternodePayments)) {
|
||||
LogPrintf("CMasternodePayments::%s -- ERROR failed to get payees for block at height %s\n", __func__, nBlockHeight);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const auto& txout : voutMasternodePayments) {
|
||||
bool found = false;
|
||||
for (const auto& txout2 : txNew.vout) {
|
||||
if (txout == txout2) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
CTxDestination dest;
|
||||
if (!ExtractDestination(txout.scriptPubKey, dest))
|
||||
assert(false);
|
||||
LogPrintf("CMasternodePayments::%s -- ERROR failed to find expected payee %s in block at height %s\n", __func__, CBitcoinAddress(dest).ToString(), nBlockHeight);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
LOCK(cs_mapMasternodeBlocks);
|
||||
const auto it = mapMasternodeBlocks.find(nBlockHeight);
|
||||
return it == mapMasternodeBlocks.end() ? true : it->second.IsTransactionValid(txNew);
|
||||
}
|
||||
|
||||
void CMasternodePayments::CheckAndRemove()
|
||||
|
Loading…
Reference in New Issue
Block a user