aboutsummaryrefslogtreecommitdiffstats
path: root/core/utils/round-event.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/utils/round-event.go')
-rw-r--r--core/utils/round-event.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/utils/round-event.go b/core/utils/round-event.go
index fe735e5..3536a27 100644
--- a/core/utils/round-event.go
+++ b/core/utils/round-event.go
@@ -93,6 +93,13 @@ func (e RoundEventParam) NextDKGRegisterHeight() uint64 {
return e.BeginHeight + e.Config.RoundLength/2
}
+func (e RoundEventParam) String() string {
+ return fmt.Sprintf("roundEvtParam{Round:%d Reset:%d Height:%d}",
+ e.Round,
+ e.Reset,
+ e.BeginHeight)
+}
+
// roundEventFn defines the fingerprint of handlers of round events.
type roundEventFn func([]RoundEventParam)
@@ -177,6 +184,8 @@ func NewRoundEvent(parentCtx context.Context, gov governanceAccessor,
// Register a handler to be called when new round is confirmed or new DKG reset
// is detected.
+//
+// The earlier registered handler has higher priority.
func (e *RoundEvent) Register(h roundEventFn) {
e.lock.Lock()
defer e.lock.Unlock()