Remove redundant size checks

These were needed with oxenmq::is_hex a long time ago, but have been
redundant for quite a while.
This commit is contained in:
Jason Rhinelander 2022-04-14 23:36:31 -03:00
parent 4fa12395ef
commit 5e578069d6
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
1 changed files with 2 additions and 2 deletions

View File

@ -6645,7 +6645,7 @@ bool simple_wallet::ons_update_mapping(std::vector<std::string> args)
}
auto& enc_hex = response[0].encrypted_value;
if (!oxenc::is_hex(enc_hex) || enc_hex.size() % 2 != 0 || enc_hex.size() > 2*ons::mapping_value::BUFFER_SIZE)
if (!oxenc::is_hex(enc_hex) || enc_hex.size() > 2*ons::mapping_value::BUFFER_SIZE)
{
LOG_ERROR("invalid ONS data returned from oxend");
fail_msg_writer() << tr("invalid ONS data returned from oxend");
@ -6887,7 +6887,7 @@ bool simple_wallet::ons_lookup(std::vector<std::string> args)
for (auto const &mapping : response)
{
auto& enc_hex = mapping.encrypted_value;
if (mapping.entry_index >= args.size() || !oxenc::is_hex(enc_hex) || enc_hex.size() % 2 != 0 || enc_hex.size() > 2*ons::mapping_value::BUFFER_SIZE)
if (mapping.entry_index >= args.size() || !oxenc::is_hex(enc_hex) || enc_hex.size() > 2*ons::mapping_value::BUFFER_SIZE)
{
fail_msg_writer() << "Received invalid ONS mapping data from oxend";
return false;