Skip to content

Commit

Permalink
Loosen validation requirements in MRCContraactHandler::Validate slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Jan 20, 2022
1 parent c045c49 commit f476d85
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gridcoin/mrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,13 @@ bool GRC::MRCContractHandler::Validate(const Contract& contract, const CTransact

if (burn_amount < mrc.RequiredBurnAmount()) return false;

// MRC transactions are only valid if the MRC contracts that they contain refer to the current head of the chain as
// m_last_block_hash.
return ValidateMRC(pindexBest, mrc);
// MRC transactions are only valid if the MRC contracts that they contain refer to a valid previous (last block) in
// the chain when they went into the mempool.

// Get the block index referred to by m_last_block_hash at the time the MRC was filled out.
CBlockIndex* prev_block_pindex = mapBlockIndex[mrc.m_last_block_hash];

return ValidateMRC(prev_block_pindex, mrc);
}

namespace {
Expand Down

0 comments on commit f476d85

Please sign in to comment.