From 37c75c58202f89b752500f76c872d7f8caf6bdb3 Mon Sep 17 00:00:00 2001 From: furszy Date: Tue, 12 Dec 2023 15:03:23 -0300 Subject: test: wallet, fix change position out of range error Since #25273, the behavior of 'inserting change at a random position' is instructed by passing std::nullopt instead of -1. Also, added missing documentation about the meaning of 'change_pos=std::nullopt' inside 'CWallet::CreateTransaction()' --- src/wallet/rpc/spend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wallet/rpc') diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp index b121c8e1a7..5a13b5ac8e 100644 --- a/src/wallet/rpc/spend.cpp +++ b/src/wallet/rpc/spend.cpp @@ -155,7 +155,7 @@ UniValue SendMoney(CWallet& wallet, const CCoinControl &coin_control, std::vecto std::shuffle(recipients.begin(), recipients.end(), FastRandomContext()); // Send - auto res = CreateTransaction(wallet, recipients, std::nullopt, coin_control, true); + auto res = CreateTransaction(wallet, recipients, /*change_pos=*/std::nullopt, coin_control, true); if (!res) { throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, util::ErrorString(res).original); } -- cgit v1.2.3