AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 18 Bitcoin

refactor: centralize SubmitBlock result handling

Public commit record

What the developer wrote

Authored by w0xlt

80/100 · Strong
refactor: centralize SubmitBlock result handling

Move the accepted/new-block/reason consistency check into SubmitBlock()
so submitBlock() and submitSolution() use the same success criteria.

This keeps duplicate and inconclusive handling in one place, removes the
new_block output parameter from the helper, and makes the helper return
whether the submitted block was accepted as a new valid block.
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a small internal cleanup in Bitcoin Core's block submission code. It moves a duplicate-check and success-calculation that existed in two places into a single shared helper function. The visible behavior for the mining RPCs is intended to stay the same, and the change is described by the author as a refactor.

Recommended action

No immediate action required. Treat as routine code cleanup. Standard review and regression testing for mining RPCs (submitblock, getblocktemplate submitSolution) is sufficient.

Security signals we found

01

Refactor of block submission success criteria

02

Removes new_block output parameter from SubmitBlock helper

03

Centralizes accepted/new-block/reason consistency check in one function

04

Preserves CHECK_NONFATAL invariant that result equals reason.empty()

05

No change to network consensus or validation logic visible in diff

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.