diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index dd3ea97f5b..f5953f59c3 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -631,6 +631,10 @@ func (s *PublicBlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, return nil, err } + if block == nil { + return nil, errors.New("block not found") + } + receipts, err := s.b.GetReceipts(ctx, block.Hash()) if err != nil { return nil, err diff --git a/miner/worker.go b/miner/worker.go index 797e7ea980..30809cd558 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1314,9 +1314,9 @@ func (w *worker) commit(ctx context.Context, env *environment, interval func(), tracing.SetAttributes( span, - attribute.Int("number", int(block.Number().Uint64())), - attribute.String("hash", block.Hash().String()), - attribute.String("sealhash", w.engine.SealHash(block.Header()).String()), + attribute.Int("number", int(env.header.Number.Uint64())), + attribute.String("hash", env.header.Hash().String()), + attribute.String("sealhash", w.engine.SealHash(env.header).String()), attribute.Int("len of env.txs", len(env.txs)), attribute.Bool("error", err != nil), )