mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
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.
This commit is contained in:
@@ -558,8 +558,7 @@ public:
|
||||
CTransactionRef tx;
|
||||
CCoinControl dummy;
|
||||
{
|
||||
constexpr int RANDOM_CHANGE_POSITION = -1;
|
||||
auto res = CreateTransaction(*wallet, {recipient}, RANDOM_CHANGE_POSITION, dummy);
|
||||
auto res = CreateTransaction(*wallet, {recipient}, std::nullopt, dummy);
|
||||
BOOST_CHECK(res);
|
||||
tx = res->tx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user