Skip to content

Commit

Permalink
Rename reject reason for invalid shielded coinbase ciphertexts
Browse files Browse the repository at this point in the history
Now that we no longer distinguish between an error in decrypting the
outgoing ciphertext or note ciphertext, we can simplify the reject
reason returned to network peers.
  • Loading branch information
str4d committed Jun 23, 2023
1 parent 8beacc2 commit 6b37277
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/gtest/test_checktransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ TEST(ChecktransactionTests, InvalidSaplingShieldedCoinbase) {
RegtestActivateHeartwood(false, Consensus::NetworkUpgrade::ALWAYS_ACTIVE);

// From Heartwood, the output description is allowed but invalid (undecryptable).
EXPECT_CALL(state, DoS(100, false, REJECT_INVALID, "bad-cb-output-desc-invalid-outct", false, "")).Times(1);
EXPECT_CALL(state, DoS(100, false, REJECT_INVALID, "bad-cb-output-desc-invalid-ct", false, "")).Times(1);
ContextualCheckTransaction(tx, state, Params(), 10, 57);

RegtestDeactivateHeartwood();
Expand Down Expand Up @@ -1183,7 +1183,7 @@ TEST(ChecktransactionTests, HeartwoodAcceptsSaplingShieldedCoinbase) {
EXPECT_TRUE(tx.IsCoinBase());

MockCValidationState state;
EXPECT_CALL(state, DoS(100, false, REJECT_INVALID, "bad-cb-output-desc-invalid-outct", false, "")).Times(1);
EXPECT_CALL(state, DoS(100, false, REJECT_INVALID, "bad-cb-output-desc-invalid-ct", false, "")).Times(1);
ContextualCheckTransaction(tx, state, chainparams, 10, 57);
}

Expand All @@ -1199,7 +1199,7 @@ TEST(ChecktransactionTests, HeartwoodAcceptsSaplingShieldedCoinbase) {
EXPECT_TRUE(tx.IsCoinBase());

MockCValidationState state;
EXPECT_CALL(state, DoS(100, false, REJECT_INVALID, "bad-cb-output-desc-invalid-outct", false, "")).Times(1);
EXPECT_CALL(state, DoS(100, false, REJECT_INVALID, "bad-cb-output-desc-invalid-ct", false, "")).Times(1);
ContextualCheckTransaction(tx, state, chainparams, 10, 57);
}

Expand All @@ -1216,7 +1216,7 @@ TEST(ChecktransactionTests, HeartwoodAcceptsSaplingShieldedCoinbase) {
EXPECT_TRUE(tx.IsCoinBase());

MockCValidationState state;
EXPECT_CALL(state, DoS(100, false, REJECT_INVALID, "bad-cb-output-desc-invalid-outct", false, "")).Times(1);
EXPECT_CALL(state, DoS(100, false, REJECT_INVALID, "bad-cb-output-desc-invalid-ct", false, "")).Times(1);
ContextualCheckTransaction(tx, state, chainparams, 10, 57);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ bool ContextualCheckTransaction(
return state.DoS(
DOS_LEVEL_BLOCK,
error("ContextualCheckTransaction(): failed to recover plaintext of coinbase output description"),
REJECT_INVALID, "bad-cb-output-desc-invalid-outct");
REJECT_INVALID, "bad-cb-output-desc-invalid-ct");
}

// ZIP 207: detect shielded funding stream elements
Expand Down

0 comments on commit 6b37277

Please sign in to comment.