From 43af06a5fbf3808519b94db7aec1d01f2e753e94 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 22 Jul 2020 23:31:01 -0400 Subject: verify whether Block fields are in agreement with the header --- examples/chain/main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples/chain/main.go') diff --git a/examples/chain/main.go b/examples/chain/main.go index 7b2ce8e..cd9a8f9 100644 --- a/examples/chain/main.go +++ b/examples/chain/main.go @@ -91,6 +91,9 @@ func NewTestChain(name string, config *eth.Config, if err != nil { panic(err) } + if !tc.chain.VerifyBlock(block) { + panic("invalid block") + } tc.chain.InsertChain([]*types.Block{block}) tc.insertBlock(block) log.Info(fmt.Sprintf("%s: got block %s, sending ack", name, block.Hash().Hex())) -- cgit v1.2.3-70-g09d2