aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/interfaces.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/interfaces.cpp')
-rw-r--r--src/wallet/interfaces.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp
index 4ca5e29229..d15273dfc9 100644
--- a/src/wallet/interfaces.cpp
+++ b/src/wallet/interfaces.cpp
@@ -281,12 +281,12 @@ public:
CAmount& fee) override
{
LOCK(m_wallet->cs_wallet);
- auto res = CreateTransaction(*m_wallet, recipients, change_pos,
+ auto res = CreateTransaction(*m_wallet, recipients, change_pos == -1 ? std::nullopt : std::make_optional(change_pos),
coin_control, sign);
if (!res) return util::Error{util::ErrorString(res)};
const auto& txr = *res;
fee = txr.fee;
- change_pos = txr.change_pos;
+ change_pos = txr.change_pos ? *txr.change_pos : -1;
return txr.tx;
}