aboutsummaryrefslogtreecommitdiff
path: root/examples/chain
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-07-22 23:31:01 -0400
committerDeterminant <[email protected]>2020-07-23 22:20:32 -0400
commit43af06a5fbf3808519b94db7aec1d01f2e753e94 (patch)
tree0b253a89e05c4807c5d448ec07467b609d35002d /examples/chain
parent13ebd8bd9468e9d769d598b0ca2afb72ba78cb97 (diff)
verify whether Block fields are in agreement with the header
Diffstat (limited to 'examples/chain')
-rw-r--r--examples/chain/main.go3
1 files changed, 3 insertions, 0 deletions
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()))