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

ots: nil-ptr in rpc #11232

Merged
merged 3 commits into from
Jul 19, 2024
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
3 changes: 3 additions & 0 deletions turbo/jsonrpc/otterscan_search_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ func (api *OtterscanAPIImpl) traceBlock(dbtx kv.Tx, ctx context.Context, blockNu
if err != nil {
return false, nil, err
}
if block == nil {
return false, nil, nil
}

reader, err := rpchelper.CreateHistoryStateReader(dbtx, blockNum, 0, chainConfig.ChainName)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions turbo/jsonrpc/otterscan_transaction_by_sender_and_nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ func (api *OtterscanAPIImpl) findNonce(ctx context.Context, tx kv.Tx, addr commo
if err != nil {
return false, common.Hash{}, err
}
if block == nil {
return false, common.Hash{}, fmt.Errorf("block not found: %d", blockNum)
}

senders := block.Body().SendersFromTxs()

txs := block.Transactions()
Expand Down
Loading