Consensus doesn't require anymore `Node` as a circular dependency.

pull/4509/head
frozen 2 years ago committed by Casey Gardiner
parent 77a55bc0ff
commit f8903ada3b
  1. 15
      core/blockchain_impl.go

@ -327,19 +327,8 @@ func VerifyBlockCrossLinks(blockchain BlockChain, block *types.Block) error {
// ReadCrossLink beacon chain usage. // ReadCrossLink beacon chain usage.
cl, err := blockchain.ReadCrossLink(crossLink.ShardID(), crossLink.BlockNum()) cl, err := blockchain.ReadCrossLink(crossLink.ShardID(), crossLink.BlockNum())
if err == nil && cl != nil { if err == nil && cl != nil {
utils.Logger().Err(errAlreadyExist). // Add slash for exist same blocknum but different crosslink
Uint64("beacon-block-number", block.NumberU64()). return errAlreadyExist
Interface("remote", crossLink).
Interface("local", cl).
Msg("[CrossLinkVerification]")
// TODO Add slash for exist same blocknum but different crosslink
return errors.Wrapf(
errAlreadyExist,
"[CrossLinkVerification] shard: %d block: %d on beacon block %d",
crossLink.ShardID(),
crossLink.BlockNum(),
block.NumberU64(),
)
} }
if err := VerifyCrossLink(blockchain, crossLink); err != nil { if err := VerifyCrossLink(blockchain, crossLink); err != nil {
return errors.Wrapf(err, "cannot VerifyBlockCrossLinks") return errors.Wrapf(err, "cannot VerifyBlockCrossLinks")

Loading…
Cancel
Save