Merge pull request #5513

bc94ba4 wallet: distinguish between empty and absent attributes (moneromooo-monero)
This commit is contained in:
luigi1111 2019-07-24 13:59:19 -05:00
commit 407683a38c
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
4 changed files with 16 additions and 6 deletions

View file

@ -2102,7 +2102,12 @@ namespace tools
return false;
}
res.value = m_wallet->get_attribute(req.key);
if (!m_wallet->get_attribute(req.key, res.value))
{
er.code = WALLET_RPC_ERROR_CODE_ATTRIBUTE_NOT_FOUND;
er.message = "Attribute not found.";
return false;
}
return true;
}
bool wallet_rpc_server::on_get_tx_key(const wallet_rpc::COMMAND_RPC_GET_TX_KEY::request& req, wallet_rpc::COMMAND_RPC_GET_TX_KEY::response& res, epee::json_rpc::error& er, const connection_context *ctx)