|
|
@ -213,7 +213,6 @@ func (consensus *Consensus) checkViewID(msg *FBFTMessage) error { |
|
|
|
if !msg.HasSingleSender() { |
|
|
|
if !msg.HasSingleSender() { |
|
|
|
return errors.New("Leader message can not have multiple sender keys") |
|
|
|
return errors.New("Leader message can not have multiple sender keys") |
|
|
|
} |
|
|
|
} |
|
|
|
fmt.Println("[checkViewID] Set LEADEER PUB KEY ", msg.SenderPubkeys[0].Bytes.Hex(), utils.GetPort()) |
|
|
|
|
|
|
|
consensus.LeaderPubKey = msg.SenderPubkeys[0] |
|
|
|
consensus.LeaderPubKey = msg.SenderPubkeys[0] |
|
|
|
consensus.IgnoreViewIDCheck.UnSet() |
|
|
|
consensus.IgnoreViewIDCheck.UnSet() |
|
|
|
consensus.consensusTimeout[timeoutConsensus].Start() |
|
|
|
consensus.consensusTimeout[timeoutConsensus].Start() |
|
|
@ -397,7 +396,6 @@ func (consensus *Consensus) UpdateConsensusInformation() Mode { |
|
|
|
Str("leaderPubKey", leaderPubKey.Bytes.Hex()). |
|
|
|
Str("leaderPubKey", leaderPubKey.Bytes.Hex()). |
|
|
|
Msg("[UpdateConsensusInformation] Most Recent LeaderPubKey Updated Based on BlockChain") |
|
|
|
Msg("[UpdateConsensusInformation] Most Recent LeaderPubKey Updated Based on BlockChain") |
|
|
|
consensus.pubKeyLock.Lock() |
|
|
|
consensus.pubKeyLock.Lock() |
|
|
|
fmt.Println("[UpdateConsensusInformation] Most Recent LeaderPubKey Updated Based on BlockChain", leaderPubKey.Bytes.Hex(), utils.GetPort()) |
|
|
|
|
|
|
|
consensus.LeaderPubKey = leaderPubKey |
|
|
|
consensus.LeaderPubKey = leaderPubKey |
|
|
|
consensus.pubKeyLock.Unlock() |
|
|
|
consensus.pubKeyLock.Unlock() |
|
|
|
} |
|
|
|
} |
|
|
@ -484,15 +482,6 @@ func (consensus *Consensus) StartFinalityCount() { |
|
|
|
consensus.finalityCounter.Store(time.Now().UnixNano()) |
|
|
|
consensus.finalityCounter.Store(time.Now().UnixNano()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//func (consensus *Consensus) ReshardingNextLeader(newblock *types.Block) {
|
|
|
|
|
|
|
|
// consensus.pubKeyLock.Lock()
|
|
|
|
|
|
|
|
// fmt.Println("nextBlock1 ", newblock.Header().Number().Uint64(), " ", consensus.LeaderPubKey.Bytes.Hex())
|
|
|
|
|
|
|
|
// consensus.LeaderPubKey = consensus.getNextLeaderKey(consensus.GetCurBlockViewID() + 1)
|
|
|
|
|
|
|
|
// fmt.Println("nextBlock2 ", newblock.Header().Number().Uint64(), " ", consensus.LeaderPubKey.Bytes.Hex())
|
|
|
|
|
|
|
|
// consensus.pubKeyLock.Unlock()
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// FinishFinalityCount calculate the current finality
|
|
|
|
// FinishFinalityCount calculate the current finality
|
|
|
|
func (consensus *Consensus) FinishFinalityCount() { |
|
|
|
func (consensus *Consensus) FinishFinalityCount() { |
|
|
|
d := time.Now().UnixNano() |
|
|
|
d := time.Now().UnixNano() |
|
|
|