Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick changes from develop #738

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down