Skip to content

fix(block::check) fix dead code on verification of empty block#1829

Merged
evoskuil merged 1 commit into
libbitcoin:masterfrom
KY-U:2026-05-fix-check-dead-code
May 8, 2026
Merged

fix(block::check) fix dead code on verification of empty block#1829
evoskuil merged 1 commit into
libbitcoin:masterfrom
KY-U:2026-05-fix-check-dead-code

Conversation

@KY-U

@KY-U KY-U commented May 8, 2026

Copy link
Copy Markdown
Contributor

The is_empty() verification inside the check() function can never be true, since it is nested inside the if (is_first_non_coinbase()) condition, that fails for empty blocks, so check() never actually signaled on an empty block.

@KY-U KY-U closed this May 8, 2026
@KY-U KY-U reopened this May 8, 2026
The is_empty() verification inside the check() function was never reached, since it was inside an if condition that failed for empty blocks, so check() never actually signaled empty block
@KY-U KY-U force-pushed the 2026-05-fix-check-dead-code branch from 32735c1 to 49d7bdd Compare May 8, 2026 14:54
@evoskuil

evoskuil commented May 8, 2026

Copy link
Copy Markdown
Member

That’s more than dead code, thanks!

This is the offending commit.

d0c10c0

@evoskuil

evoskuil commented May 8, 2026

Copy link
Copy Markdown
Member

Thanks also for adding the test. Completing full unit test coverage for chain and machine objects is part of the release checklist.

@evoskuil evoskuil merged commit f93abe2 into libbitcoin:master May 8, 2026
@KY-U KY-U deleted the 2026-05-fix-check-dead-code branch May 19, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants