edouardparis / lntop

:zap: LN terminal dashboard :bar_chart:
MIT License
183 stars 24 forks source link

Fix prematurely closing events channel #87

Closed hieblmi closed 2 years ago

hieblmi commented 2 years ago

This PR seeks to address issue https://github.com/edouardparis/lntop/issues/77 by closing the events channel in the main client routing cli.Run after all subroutines exited.

hieblmi commented 2 years ago

Now I am thinking we should probably make sure that the go routine here https://github.com/edouardparis/lntop/blob/3f8f17cf87632038fa8ae5f315e7a36776d7b5ee/cli/cli.go#L65 ended before closing the events channel.

edouardparis commented 2 years ago

Now I am thinking we should probably make sure that the go routine here, ended before closing the events channel.

I think it is good with your Patch, the go routine stopped listening on the events channel before calling ps.Stop which break the pubsub loop and close the chan in the main thread.

edouardparis commented 2 years ago

Thanks !