Skip to content

Commit

Permalink
Scripthash subscriptions: add mutex lock to notification handling
Browse files Browse the repository at this point in the history
  • Loading branch information
checksum0 committed Apr 23, 2019
1 parent 10308c7 commit 2dcd823
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions electrum/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ func (s *Server) SubscribeScripthash() (*ScripthashSubscription, <-chan *Subscri
return
}

sub.lock.Lock()
for _, a := range sub.subscribedSH {
if a == resp.Params[0] {
sub.notifChan <- &resp
break
}
}
sub.lock.Unlock()
}
}()

Expand Down

0 comments on commit 2dcd823

Please sign in to comment.