aboutsummaryrefslogtreecommitdiffstats
path: root/core/utils
diff options
context:
space:
mode:
Diffstat (limited to 'core/utils')
-rw-r--r--core/utils/nodeset-cache.go12
-rw-r--r--core/utils/utils.go7
2 files changed, 14 insertions, 5 deletions
diff --git a/core/utils/nodeset-cache.go b/core/utils/nodeset-cache.go
index 0e616e4..6249665 100644
--- a/core/utils/nodeset-cache.go
+++ b/core/utils/nodeset-cache.go
@@ -223,13 +223,15 @@ func (cache *NodeSetCache) update(round uint64) (nIDs *sets, err error) {
return
}
nIDs = &sets{
- crs: crs,
- nodeSet: nodeSet,
- notarySet: make(map[types.NodeID]struct{}),
- dkgSet: nodeSet.GetSubSet(
- int(cfg.DKGSetSize), types.NewDKGSetTarget(crs)),
+ crs: crs,
+ nodeSet: nodeSet,
+ notarySet: make(map[types.NodeID]struct{}),
leaderNode: make(map[uint64]types.NodeID, cfg.RoundLength),
}
+ if round >= dkgDelayRound {
+ nIDs.dkgSet = nodeSet.GetSubSet(
+ int(cfg.DKGSetSize), types.NewDKGSetTarget(crs))
+ }
nIDs.notarySet = nodeSet.GetSubSet(
int(cfg.NotarySetSize), types.NewNotarySetTarget(crs))
cache.rounds[round] = nIDs
diff --git a/core/utils/utils.go b/core/utils/utils.go
index 8486d28..203f57f 100644
--- a/core/utils/utils.go
+++ b/core/utils/utils.go
@@ -26,6 +26,13 @@ import (
typesDKG "github.com/dexon-foundation/dexon-consensus/core/types/dkg"
)
+var dkgDelayRound uint64
+
+// SetDKGDelayRound sets the variable.
+func SetDKGDelayRound(delay uint64) {
+ dkgDelayRound = delay
+}
+
type configAccessor interface {
Configuration(round uint64) *types.Config
}