wallet: distinguish between empty and absent attributes

This commit is contained in:
moneromooo-monero 2019-05-02 12:18:47 +00:00
parent 581994b61c
commit bc94ba4d14
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
4 changed files with 16 additions and 6 deletions

View file

@ -2126,7 +2126,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)