Skip to content

Commit

Permalink
core: better document reason for dropping error on return (ethereum#3…
Browse files Browse the repository at this point in the history
…0811)

Add a comment for error return of nil

Signed-off-by: wangjingcun <[email protected]>
  • Loading branch information
wangjingcun authored Nov 27, 2024
1 parent 915248c commit e0deac7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/blockchain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ func (bc *BlockChain) GetTransactionLookup(hash common.Hash) (*rawdb.LegacyTxLoo
if tx == nil {
progress, err := bc.TxIndexProgress()
if err != nil {
// No error is returned if the transaction indexing progress is unreachable
// due to unexpected internal errors. In such cases, it is impossible to
// determine whether the transaction does not exist or has simply not been
// indexed yet without a progress marker.
//
// In such scenarios, the transaction is treated as unreachable, though
// this is clearly an unintended and unexpected situation.
return nil, nil, nil
}
// The transaction indexing is not finished yet, returning an
Expand Down

0 comments on commit e0deac7

Please sign in to comment.