Skip to content

rpc: let LND and btcwallet broadcast through sendrawtransaction - #1239

Merged
reardencode merged 1 commit into
reardencode:masterfrom
smolcars:rpc/sendraw-allowhighfees
Oct 27, 2026
Merged

reardencode merged 1 commit into
reardencode:masterfrom
smolcars:rpc/sendraw-allowhighfees

Conversation

@niteshbalusu11

@niteshbalusu11 niteshbalusu11 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

LND, btcwallet, and other Go apps built on btcd's rpcclient cannot broadcast a transaction through rbitcoin (#1234). The client guesses the node's age from subversion: it trims /Satoshi: and string-compares the rest with 0.19.0. /rbitcoin:0.8.99/ sorts below that, so the client takes us for pre-0.19 Core and sends sendrawtransaction the old allowhighfees boolean. We rejected that with -3. btcwallet sends it on every publish, so LND funding transactions, sweeps, and force closes all failed.

sendrawtransaction now accepts that boolean. true means no fee cap and false keeps the default 10000 sat/vB. subversion and the sat/vB unit of maxfeerate stay the same.

Proved with a regtest test that fails on master and passes here, and with btcd rpcclient against nodes built from master and from this branch. Master rejects every SendRawTransaction with -3. This branch broadcasts, and with allowHighFees=false it still rejects a 10 BTC fee.

Reviewed with sol-loop: 1 round with gpt-6.1-sol on high. Sol verdict: approved.

Fixes #1234.

Created with Claude Opus 5.5 in Claude Code.

btcd rpcclient picks its sendrawtransaction dialect by string-comparing
getnetworkinfo.subversion with "0.19.0" after trimming "/Satoshi:".
"/rbitcoin:..." sorts below it, so the client treats this node as Core
before 0.19 and sends [hex, allowhighfees]. That was -3 "maxfeerate is
not a number or string", so LND and btcwallet could not publish a
transaction (btcwallet always calls SendRawTransaction(tx, false)).

A boolean in the maxfeerate slot is now that pre-0.19 argument: true
lifts the cap and false keeps the default 10000 sat/vB, the same cap
rpcclient's 0.1 BTC/kvB default asks for. Numbers and strings still
parse as sat/vB. subversion and the maxfeerate unit stay as rpc.md
documents them.

Fixes reardencode#1234.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@rearden-grok rearden-grok Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 bugs, 0 suggestions, 0 nits.

/rbitcoin:<semver>/ should stay. btcd only strips a /Satoshi: prefix, so the compared string still starts with / and stays below 0.19.0 for any semver. Spoofing /Satoshi:0.19.0/ would make allowHighFees=false send 0.1 BTC/kvB, which sat_vb_from_json rejects as a non-integer.

Positional and named maxfeerate are the only new accepts: true is the existing unlimited 0 path, false is the default 10000 sat/vB (the same cap as that client's post-0.19 0.1 BTC/kvB). Null, numbers, strings, objects, and arrays still go through opt_maxfeerate_sat_vb. maxburnamount stays index 2. testmempoolaccept still rejects a bool. The old true type-error case is now the over-cap broadcast; {} and [] are still -3.

@reardencode
reardencode merged commit 5cc40ff into reardencode:master Oct 27, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants