Skip to content

Commit

Permalink
Handling exceptions during signatures recovery (#6461)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekM25 authored Jan 5, 2024
1 parent 4550bfc commit 7d2958f
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ public void RecoverData(Block block)
// Don't access txPool in Parallel loop as increases contention
foreach (Transaction blockTransaction in block.Transactions.Where(tx => tx.IsSigned && tx.SenderAddress is null))
{
_txPool.TryGetPendingTransaction(blockTransaction.Hash, out Transaction? transaction);
Transaction? transaction = null;
try
{
_txPool.TryGetPendingTransaction(blockTransaction.Hash, out transaction);
}
catch (Exception e)
{
if (_logger.IsError) _logger.Error($"An error occured while getting pending a transaction from TxPool, Transaction: {blockTransaction}", e);
}

Address sender = transaction?.SenderAddress;
if (sender != null)
Expand Down

0 comments on commit 7d2958f

Please sign in to comment.