keep-core icon indicating copy to clipboard operation
keep-core copied to clipboard

Improve subscription handling around DKG submission

Open lukasz-zimnoch opened this issue 4 years ago • 0 comments

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.

lukasz-zimnoch avatar Nov 23 '20 10:11 lukasz-zimnoch