diff options
| author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-29 14:02:28 +0800 |
|---|---|---|
| committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:50:02 +0800 |
| commit | 04d77d66f9c004f8fc668edb7a4a2b2b95bb828f (patch) | |
| tree | 9c85d8bbea7377853dbd9b71750911590728d807 /vendor/github.com/dexon-foundation | |
| parent | 3dc14f9618cfe1a1a888028bf4982ab725160615 (diff) | |
| download | dexon-04d77d66f9c004f8fc668edb7a4a2b2b95bb828f.tar dexon-04d77d66f9c004f8fc668edb7a4a2b2b95bb828f.tar.gz dexon-04d77d66f9c004f8fc668edb7a4a2b2b95bb828f.tar.bz2 dexon-04d77d66f9c004f8fc668edb7a4a2b2b95bb828f.tar.lz dexon-04d77d66f9c004f8fc668edb7a4a2b2b95bb828f.tar.xz dexon-04d77d66f9c004f8fc668edb7a4a2b2b95bb828f.tar.zst dexon-04d77d66f9c004f8fc668edb7a4a2b2b95bb828f.zip | |
vendor, param: sync to latest core and update dmoment (#182)
* vendor: sync to latest core
* params: update dmoment
Diffstat (limited to 'vendor/github.com/dexon-foundation')
| -rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/agreement.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement.go index c08518ad8..c2ac711eb 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/agreement.go @@ -172,7 +172,7 @@ func (a *agreement) restart( defer a.data.blocksLock.Unlock() a.data.votes = make(map[uint64][]map[types.NodeID]*types.Vote) a.data.votes[1] = newVoteListMap() - a.data.period = 1 + a.data.period = 2 a.data.blocks = make(map[types.NodeID]*types.Block) a.data.requiredVote = len(notarySet)/3*2 + 1 a.data.leader.restart(crs) @@ -266,7 +266,11 @@ func isStop(aID types.Position) bool { func (a *agreement) clocks() int { a.data.lock.RLock() defer a.data.lock.RUnlock() - scale := int(a.data.period) + scale := int(a.data.period) - 1 + if scale < 1 { + // just in case. + scale = 1 + } // 10 is a magic number derived from many years of experience. if scale > 10 { scale = 10 @@ -420,7 +424,7 @@ func (a *agreement) processVote(vote *types.Vote) error { a.data.recv.ProposeVote( types.NewVote(types.VoteFastCom, hash, vote.Period)) a.data.lockValue = hash - a.data.lockIter = math.MaxUint64 + a.data.lockIter = 1 a.hasVoteFast = true } } else { |
