Skip to content

Commit 8f0fbd0

Browse files
authored
Merge pull request #2376 from CortexFoundation/dev
return null for not-found
2 parents 2d90f65 + 7bdfcdc commit 8f0fbd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ctxc/api_backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (b *CortexAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHas
142142
if hash, ok := blockNrOrHash.Hash(); ok {
143143
header := b.ctxc.blockchain.GetHeaderByHash(hash)
144144
if header == nil {
145-
return nil, errors.New("header for hash not found")
145+
return nil, nil
146146
}
147147
if blockNrOrHash.RequireCanonical && b.ctxc.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash {
148148
return nil, errors.New("hash is not currently canonical")

0 commit comments

Comments
 (0)