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

rpcclient: avoid duplicate batch POST handlers

Public commit record

What the developer wrote

Authored by Boris Nagaev

78/100 · Adequate
rpcclient: avoid duplicate batch POST handlers

NewBatch called New() and then called start() again. In HTTP POST mode that
created a second sendPostHandler and another shutdown-cancel goroutine, which
broke the expected single-flight serialization of POST sends.

Keep NewBatch as a semantic toggle only: rely on New() to start handlers
once, then set batch=true. A regression test now checks that batch POST
requests stay serialized through one active transport call.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in btcd's RPC batch client where creating a batch client accidentally started two background goroutines for sending HTTP POST requests instead of one. That broke the intended single-file behavior: two RPC requests could be sent at the same time rather than one at a time. The patch makes NewBatch simply turn on batch mode instead of starting the handlers again, and adds a test to confirm only one POST is in flight at a time.

Recommended action

Upgrade to the patched version if you use rpcclient.NewBatch in HTTP POST mode, especially if your application relies on serialized RPC sends or depends on deterministic request/response ordering. No immediate emergency action is required unless concurrent POST behavior is causing operational issues.

Security signals we found

01

Duplicate background handler goroutines break intended single-flight serialization

02

Potential race between concurrent POST sends in batch mode

03

Regression test asserts serialized POST transport behavior

Risk score

Why this scored 44/100

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