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

rpc: addpeeraddress: throw on invalid IP

Public commit record

What the developer wrote

Authored by John Moffett

78/100 · Adequate
rpc: addpeeraddress: throw on invalid IP

Throw RPC_CLIENT_INVALID_IP_OR_SUBNET when LookupHost(addr, false) fails
in addpeeraddress. This aligns with setban/addconnection and avoids the
opaque {"success": false} result for input errors. The JSON {success,
error?} object remains for addrman outcomes only. Update test to match.
✓ 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 change tightens error handling in a Bitcoin Core RPC command called addpeeraddress. Previously, if you gave it a bad IP address it would silently return {"success": false}. Now it immediately throws a clear 'Invalid IP address' error, matching how similar commands already behave. This is a small usability and input-validation improvement, not a fix for an active security vulnerability.

Recommended action

No urgent action required. Treat as a minor hardening/usability improvement. Operators using addpeeraddress should note that invalid inputs now raise an RPC error instead of returning a JSON success:false object.

Security signals we found

01

Improved input validation and explicit error reporting for RPC addpeeraddress

02

Prevents silent failure (opaque success:false) on invalid IP/hostname input

03

Aligns addpeeraddress behavior with setban/addconnection error handling

Risk score

Why this scored 20/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 9/10
Evidence quality 5/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.