Repository navigation
wallet: Use util::Result for fee bumping methods - #37017
rustaceanrob wants to merge 2 commits into
Conversation
Both RPCs should fail with RPC_INVALID_ADDRESS_OR_KEY when the txid is not in the wallet. There are no current tests for this condition: git grep -n -C2 "Invalid or non-wallet transaction id" -- test/functional | grep -i bump
Currently the fee bumping transactions use in/out params and a `feebumper::Result` type to report error status. This is emulating `util::Result` and `util::Expected`. There are also a few problems in the current implementation: 1. There is an error vector passed to each method, but only one error can occupy it at any time. 2. In the case that a transaction cannot be marked as replaced, the error is actually treated as a warning and shown to the user. 3. The `INVALID_REQUEST` variant is not used. This commit adds `util::Result` to creating and commiting fee bumped transactions, which resolves these issues and also allows for adding more fields to the successes. For instance, in the context of silent payments, fee bumped transactions change the outputs of the recipient and should be reported in the return type. The `feebumper::Result` type is removed in favor of an error code and error message.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible typos and grammar issues:
2026-11-30 09:02:16 |
util::Result for fee bumping methods
| self.log.info("Test outputs and original_change_index cannot both be provided") | ||
| assert_raises_rpc_error(-8, "The options 'outputs' and 'original_change_index' are incompatible. You can only either specify a new set of outputs, or designate a change output to be recycled.", rbf_node.bumpfee, rbfid, {"original_change_index": 2, "outputs": [{dest_address: 0.1}]}) | ||
|
|
||
| self.log.info("Test that a txid not in the wallet cannot be bumped") |
There was a problem hiding this comment.
Verified that this test fails if these lines
bitcoin/src/wallet/feebumper.cpp
Lines 182 to 185 in afedb19
|
Strong Concept ACK - this kind of code refactor (cleanup) is desired. |

Currently the fee bumping transactions use in/out params and a
feebumper::Resulttype to report error status. This is emulatingutil::Resultandutil::Expected. There are also a few problems in the current implementation: There is an error vector passed to each method, but only one error can occupy it at any time. In the case that a transaction cannot be marked as replaced, the error is actually treated as a warning and shown to the user. TheINVALID_REQUESTvariant is not used.We can resolve these using the existing
util::ResultandExpected. This is also required for #35302 inCreateRateBumpTransaction.Also, one failure case was missing a functional test, which I added here as well