diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-17 14:18:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-17 14:18:07 +0800 |
commit | 1fafb0a4b992ff225796d01f2271c2573967abae (patch) | |
tree | 03aac3c742374160249cf02dd7c3cf540a025562 /core/agreement.go | |
parent | 3c642a37675e29f82a169c0d406295608bed7abc (diff) | |
download | dexon-consensus-1fafb0a4b992ff225796d01f2271c2573967abae.tar.gz dexon-consensus-1fafb0a4b992ff225796d01f2271c2573967abae.tar.zst dexon-consensus-1fafb0a4b992ff225796d01f2271c2573967abae.zip |
core: Add stop function to all components (#216)
Diffstat (limited to 'core/agreement.go')
-rw-r--r-- | core/agreement.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/agreement.go b/core/agreement.go index 2337b43..8618b5f 100644 --- a/core/agreement.go +++ b/core/agreement.go @@ -130,9 +130,7 @@ func newAgreement( fastForward: make(chan uint64, 1), authModule: authModule, } - agreement.restart(notarySet, types.Position{ - ChainID: math.MaxUint32, - }) + agreement.stop() return agreement } @@ -203,6 +201,12 @@ func (a *agreement) restart( } } +func (a *agreement) stop() { + a.restart(make(map[types.NodeID]struct{}), types.Position{ + ChainID: math.MaxUint32, + }) +} + // clocks returns how many time this state is required. func (a *agreement) clocks() int { return a.state.clocks() |