Skip to content

Commit

Permalink
fix(fraudserv): stop topics on Stop (#1)
Browse files Browse the repository at this point in the history
There was a blocker on the node side to implement this, but we have a solution for it now
  • Loading branch information
Wondertan committed Jul 13, 2023
1 parent fb4241b commit 1944f93
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fraudserv/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ func (f *ProofService) Start(context.Context) error {
// Stop removes the stream handler and cancels the underlying ProofService
func (f *ProofService) Stop(context.Context) (err error) {
f.host.RemoveStreamHandler(protocolID(f.networkID))
f.topicsLk.Lock()
for tp, topic := range f.topics {
delete(f.topics, tp)
err = errors.Join(topic.Close())
}
f.topicsLk.Unlock()
f.cancel()
return
}
Expand Down

0 comments on commit 1944f93

Please sign in to comment.