|
|
|
@ -1,9 +1,6 @@ |
|
|
|
|
package consensus |
|
|
|
|
|
|
|
|
|
import "sync" |
|
|
|
|
|
|
|
|
|
type LockedFBFTPhase struct { |
|
|
|
|
mu sync.Mutex |
|
|
|
|
phase FBFTPhase |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -14,14 +11,10 @@ func NewLockedFBFTPhase(initialPhrase FBFTPhase) *LockedFBFTPhase { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (a *LockedFBFTPhase) Set(phrase FBFTPhase) { |
|
|
|
|
a.mu.Lock() |
|
|
|
|
a.phase = phrase |
|
|
|
|
a.mu.Unlock() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (a *LockedFBFTPhase) Get() FBFTPhase { |
|
|
|
|
a.mu.Lock() |
|
|
|
|
defer a.mu.Unlock() |
|
|
|
|
return a.phase |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|