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

docs: document missing and fix erroneous JSON-RPC error codes

Public commit record

What the developer wrote

Authored by daywalker90

85/100 · Strong
docs: document missing and fix erroneous JSON-RPC error codes

Audit the `errors` sections of the RPC schemas against the error codes
the handlers actually raise, and fix the discrepancies.

FUNDING_STILL_SYNCING_BITCOIN (304) is only raised by `fundpsbt` and
`utxopsbt` (wallet/reservation.c), and is forwarded verbatim by every
other command which can return it. Document it on `fundpsbt`,
`utxopsbt`, `txprepare`, `withdraw`, `multiwithdraw`, `upgradewallet`,
`fundchannel` and `multifundchannel`. Conversely, `fundchannel_start`
and `openchannel_init` do not call either: when the node is not synced
they delay via topology_add_sync_waiter() and retry, so drop their
stale 304.

Also fix the remaining discrepancies:

- `delpay` documented 211 for a status mismatch, but that path returns
208 (PAY_NO_SUCH_PAYMENT); 211 is never raised by `delpay`, so replace
it;
- document missing codes: `createinvoice` 907 (INVOICE_OFFER_INACTIVE),
`enableoffer` 1007 (OFFER_USED_SINGLE_USE), `getroutes` 217
(PAY_USER_ERROR) and `addpsbtoutput` 302/309;
- add `errors` sections to `splice_init`, `splice_update` and
`splice_signed` (351-356), `disableoffer` and `disableinvoicerequest`
(1001), `preapproveinvoice` (213), `preapprovekeysend` (214) and
`recover` (1600).

The splice commands can also fail asynchronously, after the command has
gone pending, through the channeld message handlers in channel_control.c
which resolve the pending command via splice_command_for_chan().
Document those codes too: 350 (SPLICE_BROADCAST_FAIL) on `splice_signed`;
357/359/360 (SPLICE_FUNDING_LOW/SPLICE_LOW_FEE/SPLICE_HIGH_FEE) on
`splice_update`; and 358/362/363 (SPLICE_STATE_ERROR/SPLICE_ABORT/
SPLICE_CHANNEL_ERROR) on all three.

Changelog-None
✓ Specific, 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 commit is a documentation-only cleanup of the JSON-RPC command help files. It corrects which numeric error codes are listed for each command so the published schemas match what the software actually returns. No program logic, validation, or behavior was changed, so it cannot be exploited or cause runtime failures. It mainly helps developers and automated tools build correct clients.

Recommended action

No security action required. Treat as a normal documentation fix. Reviewers may optionally verify that the listed error codes now match the source, but the commit itself does not introduce or fix a vulnerability.

Security signals we found

01

Documentation-only change with no executable code modifications

02

Corrects RPC schema error-code metadata to match actual handler behavior

03

No change to input parsing, authorization, cryptography, or network behavior

Risk score

Why this scored 21/100

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