Skip to content

Commit

Permalink
and do not recover when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
tkstanczak committed Jun 19, 2019
1 parent 403e729 commit a226852
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public ResultWrapper<BlockForRpc> eth_getBlockByHash(Keccak blockHash, bool retu
{
_readerWriterLockSlim.EnterReadLock();
var block = _blockchainBridge.FindBlock(blockHash, false);
if (block != null)
if (block != null && returnFullTransactionObjects)
{
_blockchainBridge.RecoverTxSenders(block);
}
Expand All @@ -492,7 +492,7 @@ public ResultWrapper<BlockForRpc> eth_getBlockByNumber(BlockParameter blockParam
}

var result = GetBlock(blockParameter, true, true);
if (result.Data != null)
if (result.Data != null && returnFullTransactionObjects)
{
_blockchainBridge.RecoverTxSenders(result.Data);
}
Expand Down Expand Up @@ -676,6 +676,8 @@ public ResultWrapper<BlockForRpc> eth_getUncleByBlockNumberAndIndex(BlockParamet
{
return ResultWrapper<BlockForRpc>.Fail($"Cannot find ommer for hash: {ommerHeader.Hash}", ErrorType.NotFound);
}

_blockchainBridge.RecoverTxSenders(ommer);

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

0 comments on commit a226852

Please sign in to comment.