aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpc/transactions.cpp
diff options
context:
space:
mode:
authorAurèle Oulès <aurele@oules.com>2022-12-15 11:02:32 +0100
committerAurèle Oulès <aurele@oules.com>2023-01-04 13:45:03 +0100
commit552b51e682b5a52d9e2fbe64e44e623451692bd3 (patch)
tree793f3f1ba8263479fb63513a91c1234f68f10703 /src/wallet/rpc/transactions.cpp
parent67e7ba8e1aea58fc864f9bb1fc0e56b70777185e (diff)
downloadbitcoin-552b51e682b5a52d9e2fbe64e44e623451692bd3.tar.xz
refactor: Add sanity checks in LabelFromValue
Diffstat (limited to 'src/wallet/rpc/transactions.cpp')
-rw-r--r--src/wallet/rpc/transactions.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/wallet/rpc/transactions.cpp b/src/wallet/rpc/transactions.cpp
index 844657a71c..5579cb6c49 100644
--- a/src/wallet/rpc/transactions.cpp
+++ b/src/wallet/rpc/transactions.cpp
@@ -635,10 +635,9 @@ RPCHelpMan listsinceblock()
bool include_removed = (request.params[3].isNull() || request.params[3].get_bool());
bool include_change = (!request.params[4].isNull() && request.params[4].get_bool());
+ // Only set it if 'label' was provided.
std::optional<std::string> filter_label;
- if (!request.params[5].isNull()) {
- filter_label = LabelFromValue(request.params[5]);
- }
+ if (!request.params[5].isNull()) filter_label.emplace(LabelFromValue(request.params[5]));
int depth = height ? wallet.GetLastBlockHeight() + 1 - *height : -1;