aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement-state.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/agreement-state.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/agreement-state.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement-state.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement-state.go
index 9023799a3..77f293376 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement-state.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement-state.go
@@ -40,6 +40,7 @@ const (
stateCommit
stateForward
statePullVote
+ stateSleep
)
var nullBlockHash = common.Hash{}
@@ -156,3 +157,20 @@ func (s *pullVoteState) clocks() int { return 4 }
func (s *pullVoteState) nextState() (agreementState, error) {
return s, nil
}
+
+// ----- SleepState -----
+// sleepState is a special state after BA has output and waits for restart.
+type sleepState struct {
+ a *agreementData
+}
+
+func newSleepState(a *agreementData) *sleepState {
+ return &sleepState{a: a}
+}
+
+func (s *sleepState) state() agreementStateType { return stateSleep }
+func (s *sleepState) clocks() int { return 65536 }
+
+func (s *sleepState) nextState() (agreementState, error) {
+ return s, nil
+}