From 3c4a43c3c1603565254bc16837924deb4e8d734a Mon Sep 17 00:00:00 2001 From: blockchaindevsh <100516036+blockchaindevsh@users.noreply.github.com> Date: Fri, 18 Mar 2022 11:11:36 +0800 Subject: [PATCH] check header.LastCommitHash (#53) Co-authored-by: blockchaindevsh --- consensus/tendermint/adapter/store.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consensus/tendermint/adapter/store.go b/consensus/tendermint/adapter/store.go index 8199c5b00be6..25925efa9e39 100644 --- a/consensus/tendermint/adapter/store.go +++ b/consensus/tendermint/adapter/store.go @@ -117,6 +117,9 @@ func (s *Store) ValidateBlock(state pbft.ChainState, block *types.FullBlock) (er state.ChainID, state.LastBlockID, block.NumberU64()-1, block.LastCommit); err != nil { return err } + if block.Block.Header().LastCommitHash != block.LastCommit.Hash() { + return errors.New("header.LastCommitHash != LastCommit.Hash()") + } } // Validate block Time with LastCommit