File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -876,15 +876,15 @@ code block::identify(const context& ctx) const NOEXCEPT
876876// Use of get_hash() in is_forward_reference makes this thread-unsafe.
877877code block::check () const NOEXCEPT
878878{
879- // empty_block is subset of first_not_coinbase.
880879 // type64 malleated is a subset of first_not_coinbase.
881880 // type32 malleated is a subset of is_internal_double_spend.
882881 if (is_oversized ())
883882 return error::block_size_limit;
883+ if (is_empty ())
884+ return error::empty_block;
884885 if (is_first_non_coinbase ())
885- return (is_empty () ? error::empty_block :
886- (is_malleated () ? error::invalid_transaction_commitment :
887- error::first_not_coinbase));
886+ return (is_malleated () ? error::invalid_transaction_commitment :
887+ error::first_not_coinbase);
888888 if (is_extra_coinbases ())
889889 return error::extra_coinbases;
890890 if (is_forward_reference ())
Original file line number Diff line number Diff line change @@ -407,6 +407,11 @@ BOOST_AUTO_TEST_CASE(block__hash__default__matches_header_hash)
407407// ----------------------------------------------------------------------------
408408
409409// check
410+ BOOST_AUTO_TEST_CASE (block__check__empty__empty_block)
411+ {
412+ const block instance{};
413+ BOOST_REQUIRE_EQUAL (instance.check (), error::empty_block);
414+ }
410415// accept
411416// connect
412417
You can’t perform that action at this time.
0 commit comments