Skip to content

Commit a226852

Browse files
committed
and do not recover when not needed
1 parent 403e729 commit a226852

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthModule.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public ResultWrapper<BlockForRpc> eth_getBlockByHash(Keccak blockHash, bool retu
468468
{
469469
_readerWriterLockSlim.EnterReadLock();
470470
var block = _blockchainBridge.FindBlock(blockHash, false);
471-
if (block != null)
471+
if (block != null && returnFullTransactionObjects)
472472
{
473473
_blockchainBridge.RecoverTxSenders(block);
474474
}
@@ -492,7 +492,7 @@ public ResultWrapper<BlockForRpc> eth_getBlockByNumber(BlockParameter blockParam
492492
}
493493

494494
var result = GetBlock(blockParameter, true, true);
495-
if (result.Data != null)
495+
if (result.Data != null && returnFullTransactionObjects)
496496
{
497497
_blockchainBridge.RecoverTxSenders(result.Data);
498498
}
@@ -676,6 +676,8 @@ public ResultWrapper<BlockForRpc> eth_getUncleByBlockNumberAndIndex(BlockParamet
676676
{
677677
return ResultWrapper<BlockForRpc>.Fail($"Cannot find ommer for hash: {ommerHeader.Hash}", ErrorType.NotFound);
678678
}
679+
680+
_blockchainBridge.RecoverTxSenders(ommer);
679681

680682
if (Logger.IsDebug) Logger.Debug($"eth_getUncleByBlockNumberAndIndex request {blockParameter}, index: {positionIndex}, result: {result}");
681683
return ResultWrapper<BlockForRpc>.Success(new BlockForRpc(result.Data, false));

0 commit comments

Comments
 (0)