@@ -673,6 +673,11 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
673
673
*pfMissingInputs = false ;
674
674
}
675
675
676
+ bool fV17Active_context = (unsigned int )chainActive.Height () >= Params ().GetConsensus ().V17DeploymentHeight ;
677
+ if (fV17Active_context && tx.ContainsZerocoins ()) {
678
+ return state.DoS (30 , error (" %s: zerocoin has been disabled" , __func__), REJECT_INVALID, " bad-txns-xwagerr" );
679
+ }
680
+
676
681
if (!CheckTransaction (tx, state, true ))
677
682
return false ; // state filled in by CheckTransaction
678
683
@@ -696,7 +701,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
696
701
// This ensures that someone won't create an invalid OP_GROUP tx that sits in the mempool until after activation,
697
702
// potentially causing this node to create a bad block.
698
703
if (IsAnyOutputGrouped (tx)) {
699
- if ((unsigned int )chainActive.Tip ()-> nHeight < chainparams.GetConsensus ().ATPStartHeight )
704
+ if ((unsigned int )chainActive.Height () < chainparams.GetConsensus ().ATPStartHeight )
700
705
{
701
706
return state.DoS (0 , false , REJECT_NONSTANDARD, " premature-op_group-tx" );
702
707
} else if (!IsAnyOutputGroupedCreation (tx, TokenGroupIdFlags::MGT_TOKEN) && !tokenGroupManager.get ()->ManagementTokensCreated ()){
@@ -2244,6 +2249,7 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
2244
2249
txdata.reserve (block.vtx .size ()); // Required so that pointers to individual PrecomputedTransactionData don't get invalidated
2245
2250
2246
2251
bool fDIP0001Active_context = pindex->nHeight >= Params ().GetConsensus ().DIP0001Height ;
2252
+ bool fV17Active_context = pindex->nHeight >= Params ().GetConsensus ().V17DeploymentHeight ;
2247
2253
2248
2254
// MUST process special txes before updating UTXO to ensure consistency between mempool and block processing
2249
2255
if (!ProcessSpecialTxsInBlock (block, pindex, state, view, fJustCheck , fScriptChecks )) {
@@ -2266,6 +2272,10 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
2266
2272
2267
2273
nInputs += tx->vin .size ();
2268
2274
2275
+ if (fV17Active_context && tx->ContainsZerocoins ()) {
2276
+ return state.DoS (100 , error (" %s: zerocoin has been disabled" , __func__), REJECT_INVALID, " bad-txns-xwagerr" );
2277
+ }
2278
+
2269
2279
if (tx->HasZerocoinSpendInputs ())
2270
2280
{
2271
2281
if (!CheckZerocoinSpendTx (pindex, state, *tx, vSpendsInBlock, vSpends, vMints, nValueIn))
0 commit comments