|
|
|
@ -60,6 +60,9 @@ func (consensus *Consensus) onAnnounce(msg *msg_pb.Message) { |
|
|
|
|
func (consensus *Consensus) prepare() { |
|
|
|
|
groupID := []nodeconfig.GroupID{nodeconfig.NewGroupIDByShardID(nodeconfig.ShardID(consensus.ShardID))} |
|
|
|
|
for i, key := range consensus.PubKey.PublicKey { |
|
|
|
|
if !consensus.IsValidatorInCommittee(key) { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
networkMessage, err := consensus.construct(msg_pb.MessageType_PREPARE, nil, key, consensus.priKey.PrivateKey[i]) |
|
|
|
|
if err != nil { |
|
|
|
|
consensus.getLogger().Err(err). |
|
|
|
@ -208,6 +211,10 @@ func (consensus *Consensus) onPrepared(msg *msg_pb.Message) { |
|
|
|
|
nodeconfig.NewGroupIDByShardID(nodeconfig.ShardID(consensus.ShardID)), |
|
|
|
|
} |
|
|
|
|
for i, key := range consensus.PubKey.PublicKey { |
|
|
|
|
if !consensus.IsValidatorInCommittee(key) { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
networkMessage, _ := consensus.construct( |
|
|
|
|
msg_pb.MessageType_COMMIT, |
|
|
|
|
commitPayload, |
|
|
|
|