aboutsummaryrefslogtreecommitdiffstats
path: root/core/agreement-mgr.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2019-03-13 11:41:03 +0800
committerGitHub <noreply@github.com>2019-03-13 11:41:03 +0800
commit92d64e7e743f7afce6ab811bce4d57fc67297567 (patch)
tree223ab615a0d49c3f0a046fc8b9c05923750f882e /core/agreement-mgr.go
parent05b87ad32f30deebdbcb82e53362765a46bf8d0e (diff)
downloadtangerine-consensus-92d64e7e743f7afce6ab811bce4d57fc67297567.tar.gz
tangerine-consensus-92d64e7e743f7afce6ab811bce4d57fc67297567.tar.zst
tangerine-consensus-92d64e7e743f7afce6ab811bce4d57fc67297567.zip
utils: add RoundEvent (#482)
* Move core.roundBasedConfig to core/utils * Refine utils.RoundBasedConfig * Add utils.RoundEvent
Diffstat (limited to 'core/agreement-mgr.go')
-rw-r--r--core/agreement-mgr.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/agreement-mgr.go b/core/agreement-mgr.go
index 88cc432..7b5effb 100644
--- a/core/agreement-mgr.go
+++ b/core/agreement-mgr.go
@@ -65,7 +65,7 @@ func genValidLeader(
}
type agreementMgrConfig struct {
- roundBasedConfig
+ utils.RoundBasedConfig
notarySetSize uint32
lambdaBA time.Duration
@@ -77,14 +77,14 @@ func (c *agreementMgrConfig) from(
c.notarySetSize = config.NotarySetSize
c.lambdaBA = config.LambdaBA
c.crs = crs
- c.setupRoundBasedFields(round, config)
+ c.SetupRoundBasedFields(round, config)
}
func newAgreementMgrConfig(prev agreementMgrConfig, config *types.Config,
crs common.Hash) (c agreementMgrConfig) {
c = agreementMgrConfig{}
- c.from(prev.roundID+1, config, crs)
- c.setRoundBeginHeight(prev.roundEndHeight)
+ c.from(prev.RoundID()+1, config, crs)
+ c.AppendTo(prev.RoundBasedConfig)
return
}
@@ -356,7 +356,7 @@ Loop:
setting.recv.isNotary = checkRound()
// Run BA for this round.
setting.recv.roundValue.Store(currentRound)
- setting.recv.changeNotaryHeight = curConfig.roundEndHeight
+ setting.recv.changeNotaryHeight = curConfig.RoundEndHeight()
setting.recv.restartNotary <- types.Position{
Round: setting.recv.round(),
Height: math.MaxUint64,