diff options
Diffstat (limited to 'src/wallet/rpc/wallet.cpp')
-rw-r--r-- | src/wallet/rpc/wallet.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index a684d4e191..8c218ad766 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -3,9 +3,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#if defined(HAVE_CONFIG_H) -#include <config/bitcoin-config.h> -#endif +#include <config/bitcoin-config.h> // IWYU pragma: keep #include <core_io.h> #include <key_io.h> @@ -130,7 +128,7 @@ static RPCHelpMan getwalletinfo() UniValue scanning(UniValue::VOBJ); scanning.pushKV("duration", Ticks<std::chrono::seconds>(pwallet->ScanningDuration())); scanning.pushKV("progress", pwallet->ScanningProgress()); - obj.pushKV("scanning", scanning); + obj.pushKV("scanning", std::move(scanning)); } else { obj.pushKV("scanning", false); } @@ -174,11 +172,11 @@ static RPCHelpMan listwalletdir() for (const auto& path : ListDatabases(GetWalletDir())) { UniValue wallet(UniValue::VOBJ); wallet.pushKV("name", path.utf8string()); - wallets.push_back(wallet); + wallets.push_back(std::move(wallet)); } UniValue result(UniValue::VOBJ); - result.pushKV("wallets", wallets); + result.pushKV("wallets", std::move(wallets)); return result; }, }; @@ -397,7 +395,7 @@ static RPCHelpMan createwallet() if (!request.params[4].isNull() && request.params[4].get_bool()) { flags |= WALLET_FLAG_AVOID_REUSE; } - if (self.Arg<bool>(5)) { + if (self.Arg<bool>("descriptors")) { #ifndef USE_SQLITE throw JSONRPCError(RPC_WALLET_ERROR, "Compiled without sqlite support (required for descriptor wallets)"); #endif @@ -491,7 +489,7 @@ static RPCHelpMan unloadwallet() // Release the "main" shared pointer and prevent further notifications. // Note that any attempt to load the same wallet would fail until the wallet // is destroyed (see CheckUniqueFileid). - std::optional<bool> load_on_start{self.MaybeArg<bool>(1)}; + std::optional<bool> load_on_start{self.MaybeArg<bool>("load_on_startup")}; if (!RemoveWallet(context, wallet, load_on_start, warnings)) { throw JSONRPCError(RPC_MISC_ERROR, "Requested wallet already unloaded"); } |