From 63db304064fb49705a483a91227eb9940ae32f41 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 11 May 2017 19:09:43 +0200 Subject: [PATCH] Merge #10341: rpc/wallet: Workaround older UniValue which returns a std::string temporary for get_str a637734 rpc/wallet: Workaround older UniValue which returns a std::string temporary for get_str (Luke Dashjr) Tree-SHA512: 8f03f1d301f714f700bf64e259a1c986136fd1ac532f091aa97198a39c131290c320094f4fc38c774c8db4469a75437596b1d933300e4f04037abc158a252bad --- src/wallet/rpcwallet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 3f6fb3bca..39004fb9c 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -840,7 +840,8 @@ UniValue getbalance(const JSONRPCRequest& request) if (request.params.size() == 0) return ValueFromAmount(pwallet->GetBalance()); - const std::string* account = request.params[0].get_str() != "*" ? &request.params[0].get_str() : nullptr; + const std::string& account_param = request.params[0].get_str(); + const std::string* account = account_param != "*" ? &account_param : nullptr; int nMinDepth = 1; if (request.params.size() > 1)