aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpc/util.cpp
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2024-04-20 16:35:39 +0200
committerFabian Jahr <fjahr@protonmail.com>2024-04-24 23:23:34 +0200
commit650d43ec15f7a3ae38126f65ef8fa0b1fd3ee936 (patch)
tree3d5b7a9d7f8a15e467ea6694c323152f683b080b /src/wallet/rpc/util.cpp
parent46bc6c2aaa613eef526b21a06bf21e8edde31a88 (diff)
downloadbitcoin-650d43ec15f7a3ae38126f65ef8fa0b1fd3ee936.tar.xz
refactor: Replace libevent use in urlDecode with our own code
Diffstat (limited to 'src/wallet/rpc/util.cpp')
-rw-r--r--src/wallet/rpc/util.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/rpc/util.cpp b/src/wallet/rpc/util.cpp
index 06ec7db1bc..f44ee7696c 100644
--- a/src/wallet/rpc/util.cpp
+++ b/src/wallet/rpc/util.cpp
@@ -11,6 +11,7 @@
#include <wallet/context.h>
#include <wallet/wallet.h>
+#include <string_view>
#include <univalue.h>
#include <boost/date_time/posix_time/posix_time.hpp>
@@ -61,9 +62,9 @@ bool ParseIncludeWatchonly(const UniValue& include_watchonly, const CWallet& wal
bool GetWalletNameFromJSONRPCRequest(const JSONRPCRequest& request, std::string& wallet_name)
{
- if (URL_DECODE && request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) {
+ if (URL_DECODE && request.URI.starts_with(WALLET_ENDPOINT_BASE)) {
// wallet endpoint was used
- wallet_name = URL_DECODE(request.URI.substr(WALLET_ENDPOINT_BASE.size()));
+ wallet_name = URL_DECODE(std::string_view{request.URI}.substr(WALLET_ENDPOINT_BASE.size()));
return true;
}
return false;