Enforce zk-SNARK validity during consensus.
This commit is contained in:
11
src/main.cpp
11
src/main.cpp
@@ -945,6 +945,17 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
|
||||
if (txin.prevout.IsNull())
|
||||
return state.DoS(10, error("CheckTransaction(): prevout is null"),
|
||||
REJECT_INVALID, "bad-txns-prevout-null");
|
||||
|
||||
// Ensure that zk-SNARKs verify
|
||||
|
||||
if (state.PerformPourVerification()) {
|
||||
BOOST_FOREACH(const CPourTx &pour, tx.vpour) {
|
||||
if (!pour.Verify(*pzerocashParams)) {
|
||||
return state.DoS(100, error("CheckTransaction(): pour does not verify"),
|
||||
REJECT_INVALID, "bad-txns-pour-verification-failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user