diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-15 12:05:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-15 12:05:30 +0800 |
commit | 7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258 (patch) | |
tree | 31ea26a7e082e16f1091152f58a9bf04c5ba40b9 /core/agreement.go | |
parent | 07ca4b1c5b0c193d621d5fc62f10a4eb083ced39 (diff) | |
download | dexon-consensus-7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258.tar dexon-consensus-7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258.tar.gz dexon-consensus-7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258.tar.bz2 dexon-consensus-7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258.tar.lz dexon-consensus-7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258.tar.xz dexon-consensus-7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258.tar.zst dexon-consensus-7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258.zip |
core: Fix issues in syncing mode (#329)
Diffstat (limited to 'core/agreement.go')
-rw-r--r-- | core/agreement.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/agreement.go b/core/agreement.go index f31b7ef..8d47a87 100644 --- a/core/agreement.go +++ b/core/agreement.go @@ -250,6 +250,14 @@ func (a *agreement) agreementID() types.Position { // nextState is called at the specific clock time. func (a *agreement) nextState() (err error) { + if func() bool { + a.lock.RLock() + defer a.lock.RUnlock() + return a.hasOutput + }() { + a.state = newSleepState(a.data) + return + } a.state, err = a.state.nextState() return } |