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

threadpool: make Submit return Expected instead of throwing

Public commit record

What the developer wrote

Authored by furszy

81/100 · Strong
threadpool: make Submit return Expected instead of throwing

Unlike exceptions, which can be ignored as they require extra try-catch
blocks, returning expected errors forces callers to always handle
submission failures.

Not throwing an exception also fixes an unclean shutdown bug
#34573 since we no longer throw when attempting to Submit()
from the libevent callback http_request_cb().
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change refactors Bitcoin Core's internal thread pool so that submitting a task returns an error code instead of throwing an exception. The main practical effect is fixing an unclean shutdown bug (#34573) where an unhandled exception could be thrown from an HTTP event callback. It is a defensive reliability improvement rather than a direct exploit for stealing funds or remote code execution.

Recommended action

Treat as a routine reliability/defensive fix. Review that all production callers of ThreadPool::Submit() now handle the returned Expected value correctly; the diff only shows test callers being updated, so inspect other call sites in the codebase for proper error handling.

Security signals we found

01

Change from exception-throwing to error-returning API

02

Commit message explicitly links change to fixing unclean shutdown bug #34573

03

HTTP callback context mentioned as a caller that previously could not handle exceptions cleanly

04

No change to network protocol, consensus, cryptography, or wallet logic

Risk score

Why this scored 31/100

Our methodology →
Potential impact 8/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 5/15
Confidence 7/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.