aboutsummaryrefslogtreecommitdiffstats
path: root/core/agreement-state.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-02 10:40:29 +0800
committerGitHub <noreply@github.com>2018-11-02 10:40:29 +0800
commitde9b5538bb35fef2459243464fc9c5801b421675 (patch)
tree33edf14cf30f3c4ddd41a010db0088f534cc1add /core/agreement-state.go
parent1467d8a82b32fb91250f7717a8be47858a38d85b (diff)
downloaddexon-consensus-de9b5538bb35fef2459243464fc9c5801b421675.tar
dexon-consensus-de9b5538bb35fef2459243464fc9c5801b421675.tar.gz
dexon-consensus-de9b5538bb35fef2459243464fc9c5801b421675.tar.bz2
dexon-consensus-de9b5538bb35fef2459243464fc9c5801b421675.tar.lz
dexon-consensus-de9b5538bb35fef2459243464fc9c5801b421675.tar.xz
dexon-consensus-de9b5538bb35fef2459243464fc9c5801b421675.tar.zst
dexon-consensus-de9b5538bb35fef2459243464fc9c5801b421675.zip
core: Fix various locking issues (#285)
Diffstat (limited to 'core/agreement-state.go')
-rw-r--r--core/agreement-state.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/agreement-state.go b/core/agreement-state.go
index 426b062..4997ddc 100644
--- a/core/agreement-state.go
+++ b/core/agreement-state.go
@@ -69,9 +69,9 @@ func newInitialState(a *agreementData) *initialState {
func (s *initialState) state() agreementStateType { return stateInitial }
func (s *initialState) clocks() int { return 0 }
func (s *initialState) nextState() (agreementState, error) {
+ hash := s.a.recv.ProposeBlock()
s.a.lock.Lock()
defer s.a.lock.Unlock()
- hash := s.a.recv.ProposeBlock()
s.a.recv.ProposeVote(&types.Vote{
Type: types.VoteInit,
BlockHash: hash,