Skip to content

Commit 4e6bd39

Browse files
wangjingcunqianhh
authored andcommitted
core: better document reason for dropping error on return (#30811)
Add a comment for error return of nil Signed-off-by: wangjingcun <[email protected]>
1 parent 430e8f4 commit 4e6bd39

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/blockchain_reader.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,13 @@ func (bc *BlockChain) GetTransactionLookup(hash common.Hash) (*rawdb.LegacyTxLoo
277277
if tx == nil {
278278
progress, err := bc.TxIndexProgress()
279279
if err != nil {
280+
// No error is returned if the transaction indexing progress is unreachable
281+
// due to unexpected internal errors. In such cases, it is impossible to
282+
// determine whether the transaction does not exist or has simply not been
283+
// indexed yet without a progress marker.
284+
//
285+
// In such scenarios, the transaction is treated as unreachable, though
286+
// this is clearly an unintended and unexpected situation.
280287
return nil, nil, nil
281288
}
282289
// The transaction indexing is not finished yet, returning an

0 commit comments

Comments
 (0)