Change error for invalid joinsplit signature for consistency.
This commit is contained in:
@@ -989,7 +989,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
|
|||||||
uint256 dataToBeSigned = SignatureHash(scriptCode, tx, NOT_AN_INPUT, SIGHASH_ALL);
|
uint256 dataToBeSigned = SignatureHash(scriptCode, tx, NOT_AN_INPUT, SIGHASH_ALL);
|
||||||
if (dataToBeSigned == one) {
|
if (dataToBeSigned == one) {
|
||||||
return state.DoS(100, error("CheckTransaction(): error computing signature hash"),
|
return state.DoS(100, error("CheckTransaction(): error computing signature hash"),
|
||||||
REJECT_INVALID, "error-computing-signature-hash");
|
REJECT_INVALID, "error-computing-signature-hash");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crypto_sign_verify_detached(&tx.joinSplitSig[0],
|
if (crypto_sign_verify_detached(&tx.joinSplitSig[0],
|
||||||
@@ -997,12 +997,12 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
|
|||||||
tx.joinSplitPubKey.begin()
|
tx.joinSplitPubKey.begin()
|
||||||
) != 0) {
|
) != 0) {
|
||||||
return state.DoS(100, error("CheckTransaction(): invalid joinsplit signature"),
|
return state.DoS(100, error("CheckTransaction(): invalid joinsplit signature"),
|
||||||
REJECT_INVALID, "invalid-joinsplit-signature");
|
REJECT_INVALID, "bad-txns-invalid-joinsplit-signature");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crypto_sign_check_S_lt_l(&tx.joinSplitSig[32]) != 0) {
|
if (crypto_sign_check_S_lt_l(&tx.joinSplitSig[32]) != 0) {
|
||||||
return state.DoS(100, error("CheckTransaction(): non-canonical ed25519 signature"),
|
return state.DoS(100, error("CheckTransaction(): non-canonical ed25519 signature"),
|
||||||
REJECT_INVALID, "non-canonical-ed25519-signature");
|
REJECT_INVALID, "non-canonical-ed25519-signature");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.PerformPourVerification()) {
|
if (state.PerformPourVerification()) {
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ BOOST_AUTO_TEST_CASE(test_simple_pour_invalidity)
|
|||||||
pourtx->serials[1] = GetRandHash();
|
pourtx->serials[1] = GetRandHash();
|
||||||
|
|
||||||
BOOST_CHECK(!CheckTransaction(newTx, state));
|
BOOST_CHECK(!CheckTransaction(newTx, state));
|
||||||
BOOST_CHECK(state.GetRejectReason() == "invalid-joinsplit-signature");
|
BOOST_CHECK(state.GetRejectReason() == "bad-txns-invalid-joinsplit-signature");
|
||||||
|
|
||||||
// TODO: #966.
|
// TODO: #966.
|
||||||
static const uint256 one(uint256S("0000000000000000000000000000000000000000000000000000000000000001"));
|
static const uint256 one(uint256S("0000000000000000000000000000000000000000000000000000000000000001"));
|
||||||
|
|||||||
Reference in New Issue
Block a user