Skip to content

blockchain: test the CheckHeaderV2Sanity call in ProcessBlock, and update the checkProofOfWork comment - #3

Open
Kilombino wants to merge 1 commit into
paulscode:blake2bfrom
Kilombino:v2-sanity-callsites
Open

Kilombino wants to merge 1 commit into
paulscode:blake2bfrom
Kilombino:v2-sanity-callsites

Conversation

@Kilombino

Copy link
Copy Markdown

Follow-up to the two nits on #2.

  • TestProcessBlockHeaderV2Sanity sends ProcessBlock a v2 orphan that commits to the block below the activation, which must be refused with ErrBadHeaderV2, and the same orphan committing to the activation height, which must be kept as an orphan. With the call in process.go removed, the test fails (got <nil>, want ErrBadHeaderV2).
  • The comment in checkProofOfWork now names both checks: CheckHeaderV2Sanity before the real height is known, and checkHeaderV2Context against the real height.

blockchain, chaincfg, txscript and mempool tests pass.

…pdate the checkProofOfWork comment

Review follow-up to paulscode#2. The new test sends ProcessBlock a v2 orphan committing to the block below
the activation (refused, ErrBadHeaderV2) and the same orphan committing to the activation height
(kept as an orphan); it fails if the call in process.go is removed. The comment in
checkProofOfWork now names both places the height of a v2 header is checked.
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.

1 participant