aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/feebumper.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-06-01 14:32:26 -0400
committerAndrew Chow <github@achow101.com>2023-12-08 17:12:19 -0500
commit758501b71391136c33b525b1a0109b990d4f463e (patch)
tree37c037c7ab72a684693bc1576b81595e4e4fedf8 /src/wallet/feebumper.cpp
parent2d39db7aa128a948b6ad11242591ef26a342f5b1 (diff)
downloadbitcoin-758501b71391136c33b525b1a0109b990d4f463e.tar.xz
wallet: use optional for change position as an optional in CreateTransaction
Instead of making -1 a magic number meaning no change or random change position, use an optional to have that meaning.
Diffstat (limited to 'src/wallet/feebumper.cpp')
-rw-r--r--src/wallet/feebumper.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wallet/feebumper.cpp b/src/wallet/feebumper.cpp
index d3df9ceeff..c6ed0fe11c 100644
--- a/src/wallet/feebumper.cpp
+++ b/src/wallet/feebumper.cpp
@@ -316,8 +316,7 @@ Result CreateRateBumpTransaction(CWallet& wallet, const uint256& txid, const CCo
// We cannot source new unconfirmed inputs(bip125 rule 2)
new_coin_control.m_min_depth = 1;
- constexpr int RANDOM_CHANGE_POSITION = -1;
- auto res = CreateTransaction(wallet, recipients, RANDOM_CHANGE_POSITION, new_coin_control, false);
+ auto res = CreateTransaction(wallet, recipients, std::nullopt, new_coin_control, false);
if (!res) {
errors.push_back(Untranslated("Unable to create transaction.") + Untranslated(" ") + util::ErrorString(res));
return Result::WALLET_ERROR;