From 7d2958fab0992e764dc1ee9b9b1d4c49a2e1f6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Moraczy=C5=84ski?= Date: Fri, 5 Jan 2024 14:43:35 +0100 Subject: [PATCH] Handling exceptions during signatures recovery (#6461) --- .../Processing/RecoverSignature.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.Consensus/Processing/RecoverSignature.cs b/src/Nethermind/Nethermind.Consensus/Processing/RecoverSignature.cs index c9e6d56dcb6..b39602df51b 100644 --- a/src/Nethermind/Nethermind.Consensus/Processing/RecoverSignature.cs +++ b/src/Nethermind/Nethermind.Consensus/Processing/RecoverSignature.cs @@ -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)