Skip to content

Commit

Permalink
verify block before proposal (#2968)
Browse files Browse the repository at this point in the history
* verify block before proposal

* only verify header after block proposal
  • Loading branch information
rlan35 authored May 9, 2020
1 parent 1fce5cb commit b823126
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node/node_newblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()).
Expand All @@ -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!!!!!!!!!")
}
}
}
Expand Down

0 comments on commit b823126

Please sign in to comment.