aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/agreement-mgr.go9
-rw-r--r--core/consensus.go13
2 files changed, 2 insertions, 20 deletions
diff --git a/core/agreement-mgr.go b/core/agreement-mgr.go
index 7006242..423174c 100644
--- a/core/agreement-mgr.go
+++ b/core/agreement-mgr.go
@@ -116,8 +116,7 @@ type agreementMgr struct {
lock sync.RWMutex
}
-func newAgreementMgr(con *Consensus,
- initConfig agreementMgrConfig) (mgr *agreementMgr, err error) {
+func newAgreementMgr(con *Consensus) (mgr *agreementMgr, err error) {
mgr = &agreementMgr{
con: con,
ID: con.ID,
@@ -130,7 +129,6 @@ func newAgreementMgr(con *Consensus,
bcModule: con.bcModule,
ctx: con.ctx,
processedBAResult: make(map[types.Position]struct{}, maxResultCache),
- configs: []agreementMgrConfig{initConfig},
voteFilter: utils.NewVoteFilter(),
}
mgr.recv = &consensusBAReceiver{
@@ -199,11 +197,6 @@ func (mgr *agreementMgr) notifyRoundEvents(evts []utils.RoundEventParam) error {
if len(mgr.configs) > 0 {
lastCfg := mgr.configs[len(mgr.configs)-1]
if e.BeginHeight != lastCfg.RoundEndHeight() {
- // the init config of BA part is provided when constructing.
- if len(mgr.configs) == 1 &&
- e.BeginHeight == lastCfg.LastPeriodBeginHeight() {
- return nil
- }
return ErrInvalidBlockHeight
}
if lastCfg.RoundID() == e.Round {
diff --git a/core/consensus.go b/core/consensus.go
index 6e30723..05d0b93 100644
--- a/core/consensus.go
+++ b/core/consensus.go
@@ -684,8 +684,6 @@ func newConsensusForRound(
initRound = initBlock.Position.Round
initBlockHeight = initBlock.Position.Height
}
- initConfig := utils.GetConfigWithPanic(gov, initRound, logger)
- initCRS := utils.GetCRSWithPanic(gov, initRound, logger)
// Init configuration chain.
ID := types.NewNodeID(prv.PublicKey())
recv := &consensusDKGReceiver{
@@ -734,16 +732,7 @@ func newConsensusForRound(
if err != nil {
panic(err)
}
- baConfig := agreementMgrConfig{}
- baConfig.from(initRound, initConfig, initCRS)
- // TODO(jimmy): remove -1 after we match the height with fullnode.
- roundHeight := gov.GetRoundHeight(initRound)
- if initRound > 0 {
- roundHeight--
- }
- baConfig.SetRoundBeginHeight(roundHeight)
- con.baMgr, err = newAgreementMgr(con, baConfig)
- if err != nil {
+ if con.baMgr, err = newAgreementMgr(con); err != nil {
panic(err)
}
if err = con.prepare(initBlock); err != nil {