Skip to content

Commit

Permalink
ots: nil ptr rpc (e2) (#11233)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Jul 19, 2024
1 parent 9ee85cd commit a6a87cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions turbo/app/snapshots_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ func dbCfg(label kv.Label, path string) mdbx.MdbxOpts {
// integration tool don't intent to create db, then easiest way to open db - it's pass mdbx.Accede flag, which allow
// to read all options from DB, instead of overriding them
opts = opts.Accede()

return opts
}
func openAgg(ctx context.Context, dirs datadir.Dirs, chainDB kv.RwDB, logger log.Logger) *libstate.Aggregator {
Expand Down
3 changes: 3 additions & 0 deletions turbo/jsonrpc/otterscan_search_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,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, api.historyV3(dbtx), 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 @@ -280,6 +280,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

0 comments on commit a6a87cb

Please sign in to comment.