Detect and don't try to parse empty txes

If we pass the blob into parse_and_validate_tx_from_blob we get
`deserialization or varint failed` error logs, which are harmless bug
annoying.  This catches the empty tx blob case earlier and logs at a
lesser severity.
This commit is contained in:
Jason Rhinelander 2022-06-01 15:50:19 -03:00
parent 4d91082acb
commit b39a118dae
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
1 changed files with 6 additions and 0 deletions

View File

@ -1120,6 +1120,12 @@ namespace cryptonote
tx_info.tvc.m_too_big = true;
return;
}
else if (tx_info.blob->empty())
{
LOG_PRINT_L1("WRONG TRANSACTION BLOB, blob is empty, rejected");
tx_info.tvc.m_verifivation_failed = true;
return;
}
tx_info.parsed = parse_and_validate_tx_from_blob(*tx_info.blob, tx_info.tx, tx_info.tx_hash);
if(!tx_info.parsed)