This purports to be a simplified “bumpfee” RPC command.
This pull was motivated by the discussion in #7865, where at the end, the idea was floated of submitting a simplified version of the code. I put a little thought into how a simple “bumpfee” command should work and here is what I came up with:
-
The user should specify which output to decrement in order to pay increased fee. This saves us from trying to figure out which address(es) are “change” addresses. This is preferable not only because it simplifies the code, but because as far as I can tell, the code that identifies change outputs is not particularly robust and may be modified in the future. If it’s desirable to have user-friendly code that figures out which output to decrement, perhaps that logic could be placed in the GUI?
-
The command should not add new inputs. In other words, if the user can’t identify an output that can be decremented in an amount sufficient to bump the fee then the command should fail. It seems likely that the vast majority of the time, identifying such an output would not be a problem. Adding new inputs complicates the code because the size of the transaction increases, perhaps significantly, so then the user would have to pay more fee for that reason as well, as opposed to just bumping the fee on the tx as it currently exists.
-
If the tx has descendant transactions, the bumped tx has to pay the fees for all of the descendants since they will get evicted from the mempool, and the rule as I understand it is that replacing a tx cannot cause the total fees in the mempool to go down.
So, the required inputs are the txid and the output index.
The optional inputs are:
0confirmTarget - perhaps the reason the user feels the need to bump the fee is because the original confirmTarget was too slow
1totalFee - for full control, the user can simply specify how many satoshis to pay as a fee on the bumped transaction (this may be useful when the parent tx has children tx'es)
This pull includes a python test.