Skip to content

Commit

Permalink
stop listening for messages if were not broadcasting
Browse files Browse the repository at this point in the history
  • Loading branch information
MutsiMutsi committed Apr 20, 2024
1 parent e8c2772 commit 49e2cff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ func createClient() *nkn.MultiClient {
func receiveMessages() {
go func() {
for {

//If we're not broadcasting don't listen.
if !isBroadcasting() {
time.Sleep(time.Millisecond * 100)
continue
}

msg := <-client.OnMessage.C

if msg == nil {
Expand Down

0 comments on commit 49e2cff

Please sign in to comment.