Skip to content

Commit 59a5dc9

Browse files
committed
Remove error::block_malleated code.
1 parent 1fa9a9e commit 59a5dc9

4 files changed

Lines changed: 1 addition & 18 deletions

File tree

include/bitcoin/system/error/block_error_t.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ enum block_error_t : uint8_t
5656
forward_reference,
5757
invalid_transaction_commitment,
5858
block_legacy_sigop_limit,
59-
block_malleated,
6059

6160
// accept block
6261
block_non_final,

src/chain/block.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -853,16 +853,10 @@ code block::confirm_transactions(const context& ctx) const NOEXCEPT
853853

854854
// Identity.
855855
// ----------------------------------------------------------------------------
856-
// invalid_transaction_commitment, invalid_witness_commitment, block_malleated
857-
// codes specifically indicate lack of block hash tx identification (identity).
858856

859857
code block::identify() const NOEXCEPT
860858
{
861-
// type64 malleated is a subset of first_not_coinbase.
862-
// type32 malleated is a subset of is_internal_double_spend.
863-
if (is_malleated())
864-
return error::block_malleated;
865-
if (is_invalid_merkle_root())
859+
if (is_malleated() || is_invalid_merkle_root())
866860
return error::invalid_transaction_commitment;
867861

868862
return error::block_success;

src/error/block_error_t.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ DEFINE_ERROR_T_MESSAGE_MAP(block_error)
5252
{ forward_reference, "transactions out of order" },
5353
{ invalid_transaction_commitment, "invalid transaction commitment" },
5454
{ block_legacy_sigop_limit, "too many block legacy signature operations" },
55-
{ block_malleated, "block is malleated" },
5655

5756
// accept block
5857
{ block_non_final, "block contains a non-final transaction" },

test/error/block_error_t.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,6 @@ BOOST_AUTO_TEST_CASE(block_error_t__code__block_legacy_sigop_limit__true_exected
183183
BOOST_REQUIRE_EQUAL(ec.message(), "too many block legacy signature operations");
184184
}
185185

186-
BOOST_AUTO_TEST_CASE(block_error_t__code__block_malleated__true_exected_message)
187-
{
188-
constexpr auto value = error::block_malleated;
189-
const auto ec = code(value);
190-
BOOST_REQUIRE(ec);
191-
BOOST_REQUIRE(ec == value);
192-
BOOST_REQUIRE_EQUAL(ec.message(), "block is malleated");
193-
}
194-
195186
// accept block
196187

197188
BOOST_AUTO_TEST_CASE(block_error_t__code__block_non_final__true_exected_message)

0 commit comments

Comments
 (0)