Skip to content

Commit

Permalink
Detect and don't try to parse empty txes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jagerman committed Jun 1, 2022
1 parent 4d91082 commit b39a118
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cryptonote_core/cryptonote_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b39a118

Please sign in to comment.