2 suggestions
Optional improvements
[suggestion] · The new original_change_index restriction is undocumented
Neither RPC help nor release notes explicitly describe the new original_change_index rejection in bumpfee and psbtbumpfee, although some previously accepted requests now return RPC_INVALID_PARAMETER.
Location: src/wallet/feebumper.cpp:199 (head).
Details and suggested fix
Previously, selecting an output such as OP_RETURN or bare multisig could succeed by omitting that output and sending change to a newly generated address. The shared function now rejects these selections with error -8, "Change position does not refer to an output with a destination". The existing help promises to preserve the selected output script, so rejection is consistent with that contract, but the newly enforced restriction is not explicit. Add a short per-PR release note describing the change for both RPCs. A clause in the original_change_index help stating that the selected output must have a destination would also make the accepted inputs clearer.
[suggestion] · The new rejection test leaves psbtbumpfee uncovered
The new functional assertion checks only bumpfee, leaving the requirement to reject destination-less change selections through psbtbumpfee untested.
Location: test/functional/wallet_bumpfee.py:298 (head).
Details and suggested fix
psbtbumpfee reaches the same CreateRateBumpTransaction call with require_mine=false. The new destination check correctly runs independently of that flag, but the existing assertion would still pass if rejection were accidentally limited to require_mine=true. Add the same error-code and message assertion using rbf_node.psbtbumpfee, send_res["txid"], and data_pos. The failed bumpfee call returns before constructing or committing a replacement, so the same transaction can be reused without additional setup.
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
The option was intended to identify the original change output, not merely deduct fees from an arbitrary output. The rename from reduce_output to original_change_index clarified this distinction because newly added inputs could increase the selected output and unexpectedly send more money to a recipient.
The compatibility contract is therefore about recycling the caller-designated change output, rather than treating its index as permission to discard that output or redirect its remainder elsewhere. Historical discussion explicitly distinguishes change designation from an arbitrary-output fee-subtraction feature.
Source 1 · Source 2 · Source 3
When the original_change_index name was introduced, its documentation promised that the indicated output would be recycled into the bumped transaction's change output, with the remainder sent to the original output script. Its amount could increase or decrease; the promised destination was the original script.
This is the strongest inspected evidence for the intended handling of a selected script that maps to CNoDestination: silently substituting a newly generated change destination is not the documented operation. The historical text does not, however, explicitly choose rejection over supporting that script.
Ralph's inferences
Rejecting a selected CNoDestination output is consistent with the historical preservation contract as a refusal to perform an operation that cannot preserve the designated change script. It is a restriction of previously accepted requests, not preservation of their previous successful behavior; the evidence does not establish that rejection was explicitly intended at introduction.
At the pinned base, the selected output is excluded from recipients and its extracted destination is assigned to destChange without checking for CNoDestination. The head instead rejects that selection before reconstruction. Thus the change can preserve the documented meaning of successful calls without claiming that historical sources required this exact error behavior.
Applying the rejection consistently to bumpfee and psbtbumpfee follows their shared transaction-construction contract; returning an unsigned PSBT does not itself alter which output script the caller designated for change.
Both RPC forms expose the same original_change_index documentation and pass it to CreateRateBumpTransaction. The head's destination check is shared and independent of the require_mine distinction between the RPC forms. This conclusion concerns the selected change output, not every occurrence of a destination-less output.