Repository navigation
Support 'blockchain.transaction.broadcast_package' - #1242
Merged
Merged
Conversation
Owner
Author
|
CC: @tnull |
SomberNight
reviewed
Nov 14, 2025
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) | ||
| } |
There was a problem hiding this comment.
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"}}}}
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following #1241