@@ -181,7 +181,7 @@ CAmount PlatformShare(const CAmount reward)
181
181
* - Other blocks are 10% lower in outgoing value, so in total, no extra coins are created
182
182
* - When non-superblocks are detected, the normal schedule should be maintained
183
183
*/
184
- bool CMNPaymentsProcessor::IsBlockValueValid (const CBlock& block, const int nBlockHeight, const CAmount blockReward, std::string& strErrorRet)
184
+ bool CMNPaymentsProcessor::IsBlockValueValid (const CBlock& block, const int nBlockHeight, const CAmount blockReward, std::string& strErrorRet, const bool check_superblock )
185
185
{
186
186
bool isBlockRewardValueMet = (block.vtx [0 ]->GetValueOut () <= blockReward);
187
187
@@ -242,6 +242,8 @@ bool CMNPaymentsProcessor::IsBlockValueValid(const CBlock& block, const int nBlo
242
242
return isBlockRewardValueMet;
243
243
}
244
244
245
+ if (!check_superblock) return true ;
246
+
245
247
const auto tip_mn_list = m_dmnman.GetListAtChainTip ();
246
248
247
249
if (!CSuperblockManager::IsSuperblockTriggered (m_govman, tip_mn_list, nBlockHeight)) {
@@ -267,7 +269,7 @@ bool CMNPaymentsProcessor::IsBlockValueValid(const CBlock& block, const int nBlo
267
269
return true ;
268
270
}
269
271
270
- bool CMNPaymentsProcessor::IsBlockPayeeValid (const CTransaction& txNew, const CBlockIndex* pindexPrev, const CAmount blockSubsidy, const CAmount feeReward)
272
+ bool CMNPaymentsProcessor::IsBlockPayeeValid (const CTransaction& txNew, const CBlockIndex* pindexPrev, const CAmount blockSubsidy, const CAmount feeReward, const bool check_superblock )
271
273
{
272
274
const int nBlockHeight = pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1 ;
273
275
@@ -298,6 +300,7 @@ bool CMNPaymentsProcessor::IsBlockPayeeValid(const CTransaction& txNew, const CB
298
300
// superblocks started
299
301
300
302
if (AreSuperblocksEnabled (m_sporkman)) {
303
+ if (!check_superblock) return true ;
301
304
const auto tip_mn_list = m_dmnman.GetListAtChainTip ();
302
305
if (CSuperblockManager::IsSuperblockTriggered (m_govman, tip_mn_list, nBlockHeight)) {
303
306
if (CSuperblockManager::IsValid (m_govman, tip_mn_list, txNew, nBlockHeight, blockSubsidy + feeReward)) {
0 commit comments