@@ -4643,7 +4643,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
46434643 }
46444644
46454645 if (!ContextualCheckZerocoinSpendNoSerialCheck (stakeTxIn, spend, pindex, 0 ))
4646- return state.DoS (100 ,error (" %s: ContextualCheckZerocoinSpend failed for tx %s" , __func__,
4646+ return state.DoS (100 ,error (" %s: forked chain ContextualCheckZerocoinSpend failed for tx %s" , __func__,
46474647 stakeTxIn.GetHash ().GetHex ()), REJECT_INVALID, " bad-txns-invalid-zpiv" );
46484648
46494649 // Now only the ZKP left..
@@ -4686,12 +4686,14 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
46864686 }
46874687 }
46884688 } else {
4689- for (CTxIn zPivInput : zPIVInputs) {
4690- CoinSpend spend = TxInToZerocoinSpend (zPivInput);
4691- if (!ContextualCheckZerocoinSpend (stakeTxIn, spend, pindex, 0 ))
4692- return state.DoS (100 ,error (" %s: ContextualCheckZerocoinSpend failed for tx %s" , __func__,
4693- stakeTxIn.GetHash ().GetHex ()), REJECT_INVALID, " bad-txns-invalid-zpiv" );
4694- }
4689+ if (!isBlockFromFork)
4690+ for (CTxIn zPivInput : zPIVInputs) {
4691+ CoinSpend spend = TxInToZerocoinSpend (zPivInput);
4692+ if (!ContextualCheckZerocoinSpend (stakeTxIn, spend, pindex, 0 ))
4693+ return state.DoS (100 ,error (" %s: main chain ContextualCheckZerocoinSpend failed for tx %s" , __func__,
4694+ stakeTxIn.GetHash ().GetHex ()), REJECT_INVALID, " bad-txns-invalid-zpiv" );
4695+ }
4696+
46954697 }
46964698
46974699 }
0 commit comments