From 6ed8d399c20b3985eefb167d8bda809808b3e709 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 29 Oct 2024 09:14:23 +0800 Subject: [PATCH] fix nil dereference in field selection --- consensus/XDPoS/engines/engine_v2/forensics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/XDPoS/engines/engine_v2/forensics.go b/consensus/XDPoS/engines/engine_v2/forensics.go index c2b6aa0541..adec35cfd1 100644 --- a/consensus/XDPoS/engines/engine_v2/forensics.go +++ b/consensus/XDPoS/engines/engine_v2/forensics.go @@ -210,7 +210,7 @@ func (f *Forensics) findAncestorQCs(chain consensus.ChainReader, currentQc types parentHash := quorumCertificate.ProposedBlockInfo.Hash parentHeader := chain.GetHeaderByHash(parentHash) if parentHeader == nil { - log.Error("[findAncestorQCs] Forensics findAncestorQCs unable to find its parent block header", "BlockNum", parentHeader.Number.Int64(), "ParentHash", parentHash.Hex()) + log.Error("[findAncestorQCs] Forensics findAncestorQCs unable to find its parent block header", "ParentHash", parentHash.Hex()) return nil, errors.New("unable to find parent block header in forensics") } var decodedExtraField types.ExtraFields_v2