diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-06-01 14:32:26 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-12-08 17:12:19 -0500 |
commit | 758501b71391136c33b525b1a0109b990d4f463e (patch) | |
tree | 37c037c7ab72a684693bc1576b81595e4e4fedf8 /src/wallet/feebumper.cpp | |
parent | 2d39db7aa128a948b6ad11242591ef26a342f5b1 (diff) | |
download | bitcoin-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.cpp | 3 |
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; |