Repository navigation
Conversation
Andezion
previously approved these changes
Nov 10, 2026
|
|
||
| resp = l1.rpc.call("sendrawtransaction", {"tx": rawtx, "allowhighfees": False}) | ||
| assert resp["success"], resp | ||
| assert "already in utxo set" in resp["errmsg"] |
Collaborator
There was a problem hiding this comment.
maybe match on the error code, which does not depend on the version. For example assert "error code: -27" in resp["errmsg"], or a regex for both messages like test_wallet uses??
Collaborator
There was a problem hiding this comment.
Right now in CI:
> assert "already in utxo set" in resp["errmsg"]
E AssertionError: assert 'already in utxo set' in 'error code: -27\nerror message:\nTransaction already in block chain\n'
Member
Author
There was a problem hiding this comment.
Switched to matching error code: -27, which doesn't depend on the bitcoind version.
sendrawtransaction means to take bitcoind's "transaction already in the chain" error (-27, RPC_VERIFY_ALREADY_IN_UTXO_SET) as success, but it compares bitcoin-cli's exit status with -27. An exit status is never negative: bitcoin-cli exits with the absolute value of the RPC error code, here 27. So the check never matched since it was added in 910e79d, and sending a transaction that is already confirmed reported a failure, e.g. "Failed to re-transmit funding tx: error code: -27" in ElementsProject#9091. Compare the exit status with 27. Changelog-Fixed: bcli: `sendrawtransaction` of a transaction that is already in the chain now reports success, as intended.
nepet
force-pushed
the
bcli-already-in-chain
branch
from
November 13, 2026 12:36
87c19cb to
a6ab941
Compare
This branch has not been deployed
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.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgradesendrawtransactionmeans to take bitcoind's "already in the chain" error (-27,RPC_VERIFY_ALREADY_IN_UTXO_SET) as success, but it compares bitcoin-cli's exit status with-27. bitcoin-cli exits with the absolute value of the RPC error code, so the check never matched, and sending a transaction that is already confirmed reported a failure. #9091 was one place this showed up.This compares the exit status with 27. The test sends a confirmed transaction to bcli's
sendrawtransactionand expects"success": true.