@@ -569,12 +569,15 @@ static bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state,
569569 }
570570
571571 bool fCLTVIsActivated = consensus.NetworkUpgradeActive (chainHeight, Consensus::UPGRADE_BIP65);
572-
572+ bool exchangeAddrActivated = consensus. NetworkUpgradeActive (chainHeight, Consensus::UPGRADE_V5_6);
573573 // Check against previous transactions
574574 // This is done last to help prevent CPU exhaustion denial-of-service attacks.
575575 int flags = STANDARD_SCRIPT_VERIFY_FLAGS;
576576 if (fCLTVIsActivated )
577577 flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
578+ if (exchangeAddrActivated)
579+ flags |= SCRIPT_VERIFY_EXCHANGEADDR;
580+
578581
579582 PrecomputedTransactionData precomTxData (tx);
580583 if (!CheckInputs (tx, state, view, true , flags, true , precomTxData)) {
@@ -593,6 +596,8 @@ static bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state,
593596 flags = MANDATORY_SCRIPT_VERIFY_FLAGS;
594597 if (fCLTVIsActivated )
595598 flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
599+ if (exchangeAddrActivated)
600+ flags |= SCRIPT_VERIFY_EXCHANGEADDR;
596601 if (!CheckInputs (tx, state, view, true , flags, true , precomTxData)) {
597602 return error (" %s: BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags %s, %s" ,
598603 __func__, hash.ToString (), FormatStateMessage (state));
@@ -1496,8 +1501,10 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
14961501
14971502 // If scripts won't be checked anyways, don't bother seeing if CLTV is activated
14981503 bool fCLTVIsActivated = false ;
1504+ bool exchangeAddrActivated = false ;
14991505 if (fScriptChecks && pindex->pprev ) {
15001506 fCLTVIsActivated = consensus.NetworkUpgradeActive (pindex->pprev ->nHeight , Consensus::UPGRADE_BIP65);
1507+ exchangeAddrActivated = consensus.NetworkUpgradeActive (pindex->pprev ->nHeight , Consensus::UPGRADE_V5_6);
15011508 }
15021509
15031510 CCheckQueueControl<CScriptCheck> control (fScriptChecks && nScriptCheckThreads ? &scriptcheckqueue : nullptr );
@@ -1575,6 +1582,8 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
15751582 unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_DERSIG;
15761583 if (fCLTVIsActivated )
15771584 flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
1585+ if (exchangeAddrActivated)
1586+ flags |= SCRIPT_VERIFY_EXCHANGEADDR;
15781587
15791588 bool fCacheResults = fJustCheck ; /* Don't cache results if we're actually connecting blocks (still consult the cache, though) */
15801589 if (!CheckInputs (tx, state, view, fScriptChecks , flags, fCacheResults , precomTxData[i], nScriptCheckThreads ? &vChecks : nullptr ))
0 commit comments