Skip to content

Support 'blockchain.transaction.broadcast_package' - #1242

Merged
romanz merged 2 commits into
masterfrom
submit-package
Nov 14, 2025
Merged

romanz merged 2 commits into
masterfrom
submit-package

Conversation

@romanz

@romanz romanz commented Nov 11, 2025

Copy link
Copy Markdown
Owner

Following #1241

@romanz romanz self-assigned this Nov 11, 2025
@romanz

romanz commented Nov 11, 2025

Copy link
Copy Markdown
Owner Author

CC: @tnull

@romanz
romanz merged commit cd6d8f7 into master Nov 14, 2025
@romanz
romanz deleted the submit-package branch November 14, 2025 06:06
Comment thread src/electrum.rs
Comment on lines +366 to +372
fn transaction_broadcast_package(&self, (txs_hex,): &(Vec<String>,)) -> Result<Value> {
let txs = txs_hex
.iter()
.map(|s| tx_from_hex(s))
.collect::<Result<Vec<_>>>()?;
self.daemon.submitpackage(&txs)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The method signature is supposed to be blockchain.transaction.broadcast_package(raw_txs, verbose=false).

There should be support for a verbose parameter, which crucially should default to false. With verbose=true the return value of bitcoind is just forwarded, as you are doing here. But with verbose=false, there is a different well-defined bitcoind-independent response structure that the server should construct.

Atm this code is just always forwarding the bitcoind return value (as if verbose=true was set - which should NOT be the default):

$ printf '{"id": 1, "method": "server.version", "params": ["testing", "1.4"]}\n{"id": 2, "method": "blockchain.transaction.broadcast_package", "params": [["020000000001011173608e09b60abe6e3979157485f9fb002a7c9ba7c5b75a5692d7ae4898b1800000000000fdffffff02784a4c0000000000160014905190f141d2089497a554d5b74175929d2b2c7d40787d01000000001600149f9aa3795e57c535d2f7b160ff023804c60fca6e024730440220681b5ea1d17b311bcce35df1b9f202c15fd161c8eab0f72059d2869c2898d9460220436bf54378db5e4d9fe8c7f73fdb11db05804c8b5d6326f8cdd6e3cd906e2218012103c3172a9f8820681c62b8bf28961988a4642b33f4920b9da14b06965c7fff83fda9090000", "02000000000101859e1d16db97ba9819804d3f67557f6b0b5be2bed5d180ca893bc138b48a4cbb0100000000fdffffff02a0860100000000001600149f9aa3795e57c535d2f7b160ff023804c60fca6ed8f07b0100000000160014c6c1e628487ca44a22beb15e9035f7f76bbc103e02473044022048a0747a42c59456c90894170493df6075ca5bb0094f16d0607fb5f7f00d020502204e23283cc0438288d587376670fe4f3c99765d7032863816d2f9b9b3ca501e38012103c3172a9f8820681c62b8bf28961988a4642b33f4920b9da14b06965c7fff83fda9090000"]]}\n' | nc 127.0.0.1 52001
{"id":1,"jsonrpc":"2.0","result":["electrs/0.10.10","1.4"]}
{"id":2,"jsonrpc":"2.0","result":{"package_msg":"transaction failed","replaced-transactions":[],"tx-results":{"215e4cb92114298b049c90cc9119db1025028aae2cab5a5119b8843f61953ac1":{"error":"bad-txns-inputs-missingorspent","txid":"bb4c8ab438c13b89ca80d1d5bee25b0b6b7f55673f4d801998ba97db161d9e85"},"bbbde4daf62d5ae012daedbe4b3cbf79943325f90dae06bbbf53858a7d2a4ff7":{"error":"bad-txns-inputs-missingorspent","txid":"e45879d7cef35c45754e0e8dd3215fb0976fbc177756f8def937279f456d6b06"}}}}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Sorry, will fix.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

#1244 should fix the issue.

benthecarman added a commit to benthecarman/electrs-mempool that referenced this pull request Mar 26, 2026
Wire up the Electrum broadcast_package method to the existing
submitpackage RPC support, matching the upstream change in
romanz/electrs#1242.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
benthecarman added a commit to benthecarman/electrs-mempool that referenced this pull request Mar 26, 2026
Wire up the Electrum broadcast_package method to the existing
submitpackage RPC support, matching the upstream change in
romanz/electrs#1242.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants