Skip to content

Commit

Permalink
Fix pending block when no RPCEthCompatibility
Browse files Browse the repository at this point in the history
The RPCEthCompatibility check was not intended here. See
#2062 (comment)
  • Loading branch information
karlb committed Jun 6, 2023
1 parent 06abf2f commit 8dda177
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.B

if err == nil {
addEthCompatibilityFields(ctx, response, s.b, block)
if s.b.RPCEthCompatibility() && number == rpc.PendingBlockNumber {
if number == rpc.PendingBlockNumber {
// Pending blocks need to nil out a few fields
for _, field := range []string{"hash", "nonce", "miner"} {
response[field] = nil
Expand Down

0 comments on commit 8dda177

Please sign in to comment.