From 5db869236a295938647bdd255e1c7899ca7ba9a2 Mon Sep 17 00:00:00 2001 From: Giulio rebuffo Date: Fri, 18 Feb 2022 17:03:47 +0100 Subject: [PATCH] Fix Reorg Indexing on Proof-of-Stake (#3538) * little fix * feed pos --- turbo/stages/headerdownload/header_algos.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/turbo/stages/headerdownload/header_algos.go b/turbo/stages/headerdownload/header_algos.go index 95a77538e..a49f015f4 100644 --- a/turbo/stages/headerdownload/header_algos.go +++ b/turbo/stages/headerdownload/header_algos.go @@ -1040,6 +1040,10 @@ func (hi *HeaderInserter) FeedHeaderPoS(db kv.GetPut, header *types.Header, hash return fmt.Errorf("[%s] failed to store header: %w", hi.logPrefix, err) } + if err = db.Put(kv.HeaderNumber, hash[:], dbutils.EncodeBlockNumber(blockHeight)); err != nil { + return fmt.Errorf("[%s] failed to store header: %w", hi.logPrefix, err) + } + hi.highest = blockHeight hi.highestHash = hash hi.highestTimestamp = header.Time