From 2417d3f3926360dcf5037ce79ff3af83da039b63 Mon Sep 17 00:00:00 2001 From: wangjingcun Date: Tue, 26 Nov 2024 16:40:26 +0800 Subject: [PATCH] core: add a comment for error return of nil Signed-off-by: wangjingcun --- core/blockchain_reader.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/blockchain_reader.go b/core/blockchain_reader.go index 19c1b17f36..8f1da82a2b 100644 --- a/core/blockchain_reader.go +++ b/core/blockchain_reader.go @@ -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