@@ -884,22 +884,25 @@ code block::identify(const context& ctx) const NOEXCEPT
884884// In the case of validation failure
885885// The block header is checked/accepted independently.
886886
887- // TODO: use of get_hash() in is_forward_reference makes this thread unsafe.
887+ // TODO: use of get_hash() in is_forward_reference makes this thread- unsafe.
888888code block::check () const NOEXCEPT
889889{
890890 // empty_block is subset of first_not_coinbase.
891- // if (is_empty())
892- // return error::empty_block;
891+ // type64 malleated is a subset of first_not_coinbase.
892+ // type32 malleated is a subset of is_internal_double_spend.
893893 if (is_oversized ())
894894 return error::block_size_limit;
895895 if (is_first_non_coinbase ())
896- return error::first_not_coinbase;
896+ return (is_empty () ? error::empty_block :
897+ (is_malleated () ? error::invalid_transaction_commitment :
898+ error::first_not_coinbase));
897899 if (is_extra_coinbases ())
898900 return error::extra_coinbases;
899901 if (is_forward_reference ())
900902 return error::forward_reference;
901903 if (is_internal_double_spend ())
902- return error::block_internal_double_spend;
904+ return is_malleated () ? error::invalid_transaction_commitment :
905+ error::block_internal_double_spend;
903906 if (is_invalid_merkle_root ())
904907 return error::invalid_transaction_commitment;
905908
@@ -911,7 +914,7 @@ code block::check() const NOEXCEPT
911914// timestamp
912915// median_time_past
913916
914- // TODO: use of get_hash() in is_hash_limit_exceeded makes this thread unsafe.
917+ // TODO: use of get_hash() in is_hash_limit_exceeded makes this thread- unsafe.
915918// bip141 should be disabled when the node is not accepting witness data.
916919code block::check (const context& ctx) const NOEXCEPT
917920{
0 commit comments