Repository navigation
rpc: let LND and btcwallet broadcast through sendrawtransaction - #1239
Conversation
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>
There was a problem hiding this comment.
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.
LND, btcwallet, and other Go apps built on btcd's
rpcclientcannot broadcast a transaction through rbitcoin (#1234). The client guesses the node's age fromsubversion: it trims/Satoshi:and string-compares the rest with0.19.0./rbitcoin:0.8.99/sorts below that, so the client takes us for pre-0.19 Core and sendssendrawtransactionthe oldallowhighfeesboolean. We rejected that with-3. btcwallet sends it on every publish, so LND funding transactions, sweeps, and force closes all failed.sendrawtransactionnow accepts that boolean.truemeans no fee cap andfalsekeeps the default 10000 sat/vB.subversionand the sat/vB unit ofmaxfeeratestay the same.Proved with a regtest test that fails on master and passes here, and with btcd
rpcclientagainst nodes built from master and from this branch. Master rejects everySendRawTransactionwith-3. This branch broadcasts, and withallowHighFees=falseit 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.