From 8bc5d1feacc71926ef1f570fb5a7c7873cf098e1 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Fri, 5 Jun 2020 20:53:10 +0200 Subject: [PATCH] api got changed to more suitable version --- src/wallet/plain_wallet_api.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/wallet/plain_wallet_api.cpp b/src/wallet/plain_wallet_api.cpp index 9a320000..5af14a19 100644 --- a/src/wallet/plain_wallet_api.cpp +++ b/src/wallet/plain_wallet_api.cpp @@ -337,15 +337,14 @@ namespace plain_wallet { currency::account_public_address apa = AUTO_VAL_INIT(apa); currency::payment_id_t pid = AUTO_VAL_INIT(pid); - if(!currency::get_account_address_and_payment_id_from_str(apa, pid, addr)) + bool valid = false; + if(currency::get_account_address_and_payment_id_from_str(apa, pid, addr)) { - error_response err_result = AUTO_VAL_INIT(err_result); - err_result.error.code = API_RETURN_CODE_BAD_ARG; - return epee::serialization::store_t_to_json(err_result); + valid = true; } //lazy to make struct for it std::stringstream res; - res << "{ \"valid\": true, \"auditable\" : " + res << "{ \"valid\": " << (valid?"true":"false") << ", \"auditable\" : " << (apa.flags&ACCOUNT_PUBLIC_ADDRESS_FLAG_AUDITABLE ? "true" : "false") << "\"payment_is\" : " << (pid.size() ? "true" : "false") << "}"; return res.str();