|
|
|
@ -429,8 +429,9 @@ func (consensus *Consensus) UpdateConsensusInformation() Mode { |
|
|
|
|
// IsLeader check if the node is a leader or not by comparing the public key of
|
|
|
|
|
// the node with the leader public key
|
|
|
|
|
func (consensus *Consensus) IsLeader() bool { |
|
|
|
|
consensus.mutex.RLock() |
|
|
|
|
defer consensus.mutex.RUnlock() |
|
|
|
|
// TODO: if remove locks blockchain stucks.
|
|
|
|
|
//consensus.mutex.RLock()
|
|
|
|
|
//defer consensus.mutex.RUnlock()
|
|
|
|
|
|
|
|
|
|
return consensus.isLeader() |
|
|
|
|
} |
|
|
|
|