From f34087534db6a8ce788bfae8b5ccd43f2f1ebc92 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 12 Mar 2024 08:10:14 +0800 Subject: [PATCH] eth: check err before return in function StateAndHeaderByNumber --- eth/api_backend.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/api_backend.go b/eth/api_backend.go index 1fdfbd9b3be8..8f4c59a7f239 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -187,6 +187,9 @@ func (b *EthApiBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc. return nil, nil, err } stateDb, err := b.eth.BlockChain().StateAt(header.Root) + if err != nil { + return nil, nil, err + } return stateDb, header, err }