Skip to content

Commit e1974d2

Browse files
committed
AcceptBlock() check for double spent serials only on main chain flag.
1 parent babdfb0 commit e1974d2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/main.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)