verify block before proposal (#2968)

* verify block before proposal

* only verify header after block proposal
pull/2975/head v1.3.11
Rongjian Lan 5 years ago committed by GitHub
parent 1fce5cbaea
commit b823126bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      node/node_newblock.go

@ -50,7 +50,11 @@ func (node *Node) WaitForConsensusReadyV2(readySignal chan struct{}, stopChan ch
Msg("PROPOSING NEW BLOCK ------------------------------------------------")
newBlock, err := node.proposeNewBlock()
if err != nil {
utils.Logger().Err(err).Msg("!!!!!!!!!Failed Proposing New Block!!!!!!!!!")
}
err = node.Blockchain().Validator().ValidateHeader(newBlock, true)
if err == nil {
utils.Logger().Debug().
Uint64("blockNum", newBlock.NumberU64()).
@ -65,7 +69,7 @@ func (node *Node) WaitForConsensusReadyV2(readySignal chan struct{}, stopChan ch
node.BlockChannel <- newBlock
break
} else {
utils.Logger().Err(err).Msg("!!!!!!!!!Failed Proposing New Block!!!!!!!!!")
utils.Logger().Err(err).Msg("!!!!!!!!!Failed Verifying New Block Header!!!!!!!!!")
}
}
}

Loading…
Cancel
Save