keep-core
keep-core copied to clipboard
Improve subscription handling around DKG submission
Closes: #2168
Here we improve the way we handle the OnDKGResultSubmitted subscription. There was no need to manually invoke
subscription.Unsubscribe() in all exit points. Those invocations have been replaced by one deferred call. Also, there is no point to close the onSubmittedResultChan channel on the receiver side by hand. This often caused panic: send on closed channelerrors during tests. That channel should be normally garbage collected because it becomes unused after the subscription is terminated.