From 8f491a030ac7a5bac886a050037d7a893ccff865 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Fri, 15 Mar 2024 15:45:51 -0500 Subject: [PATCH] arbBlockHash for pending blocks should return latest block hash [NIT-2121] --- internal/ethapi/api.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 2d3fe10d11..744e43624b 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1178,13 +1178,14 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S func updateHeaderForPendingBlocks(blockNrOrHash rpc.BlockNumberOrHash, header *types.Header) *types.Header { if blockNrOrHash.BlockNumber != nil && *blockNrOrHash.BlockNumber == rpc.PendingBlockNumber { - headerCopy := *header + headerCopy := types.CopyHeader(header) now := uint64(time.Now().Unix()) if now > headerCopy.Time { headerCopy.Time = now } headerCopy.Number = new(big.Int).Add(headerCopy.Number, common.Big1) - return &headerCopy + headerCopy.ParentHash = header.Hash() + return headerCopy } return header }