aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/feebumper.h
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2022-11-07 14:52:56 -0500
committerAndrew Chow <github@achow101.com>2023-06-26 17:49:09 -0400
commit7d83502d3d52218e7b0b0634cff2a9aba9cc77ef (patch)
tree6859f2c2da1687f04c9288fcd0ddf60b3952e457 /src/wallet/feebumper.h
parenta36134fcc7b40671d538931f621c8c15ffacc3d2 (diff)
downloadbitcoin-7d83502d3d52218e7b0b0634cff2a9aba9cc77ef.tar.xz
bumpfee: Allow original change position to be specified
If the user used a custom change address, it may not be detected as a change output, resulting in an additional change output being added to the bumped transaction. We can avoid this issue by allowing the user to specify the position of the change output.
Diffstat (limited to 'src/wallet/feebumper.h')
-rw-r--r--src/wallet/feebumper.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/feebumper.h b/src/wallet/feebumper.h
index 53cf16e0f1..f00bf15730 100644
--- a/src/wallet/feebumper.h
+++ b/src/wallet/feebumper.h
@@ -43,6 +43,8 @@ bool TransactionCanBeBumped(const CWallet& wallet, const uint256& txid);
* @param[out] new_fee the fee that the bump transaction pays
* @param[out] mtx The bump transaction itself
* @param[in] require_mine Whether the original transaction must consist of inputs that can be spent by the wallet
+ * @param[in] outputs Vector of new outputs to replace the bumped transaction's outputs
+ * @param[in] reduce_output The position of the change output to deduct the fee from in the transaction being bumped
*/
Result CreateRateBumpTransaction(CWallet& wallet,
const uint256& txid,
@@ -52,7 +54,8 @@ Result CreateRateBumpTransaction(CWallet& wallet,
CAmount& new_fee,
CMutableTransaction& mtx,
bool require_mine,
- const std::vector<CTxOut>& outputs);
+ const std::vector<CTxOut>& outputs,
+ std::optional<uint32_t> reduce_output = std::nullopt);
//! Sign the new transaction,
//! @return false if the tx couldn't be found or if it was