aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpc/transactions.cpp
diff options
context:
space:
mode:
authorAurèle Oulès <aurele@oules.com>2022-12-15 10:58:14 +0100
committerAurèle Oulès <aurele@oules.com>2023-01-04 12:31:28 +0100
commit67e7ba8e1aea58fc864f9bb1fc0e56b70777185e (patch)
tree75210dfd85f9ad2b9851924eb87431aa480f03b1 /src/wallet/rpc/transactions.cpp
parenta653f4bb1f0630a4b2507c3464909a64c6fca7e3 (diff)
rpc: Sanitize label name in various RPCs
- importprivkey - importaddress - importpubkey - listtransactions - listsinceblock - importmulti - importdescriptors
Diffstat (limited to 'src/wallet/rpc/transactions.cpp')
-rw-r--r--src/wallet/rpc/transactions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/rpc/transactions.cpp b/src/wallet/rpc/transactions.cpp
index 02a1ac5ea1..844657a71c 100644
--- a/src/wallet/rpc/transactions.cpp
+++ b/src/wallet/rpc/transactions.cpp
@@ -487,7 +487,7 @@ RPCHelpMan listtransactions()
std::optional<std::string> filter_label;
if (!request.params[0].isNull() && request.params[0].get_str() != "*") {
- filter_label = request.params[0].get_str();
+ filter_label.emplace(LabelFromValue(request.params[0]));
if (filter_label.value().empty()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Label argument must be a valid label name or \"*\".");
}
@@ -637,7 +637,7 @@ RPCHelpMan listsinceblock()
std::optional<std::string> filter_label;
if (!request.params[5].isNull()) {
- filter_label = request.params[5].get_str();
+ filter_label = LabelFromValue(request.params[5]);
}
int depth = height ? wallet.GetLastBlockHeight() + 1 - *height : -1;