From 2dcd82312dcf0675bc697ef663c4436e42bd3f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ian=20Desc=C3=B4teaux?= Date: Tue, 23 Apr 2019 02:52:22 -0400 Subject: [PATCH] Scripthash subscriptions: add mutex lock to notification handling --- electrum/subscribe.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/electrum/subscribe.go b/electrum/subscribe.go index 6bef603..632c84b 100644 --- a/electrum/subscribe.go +++ b/electrum/subscribe.go @@ -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() } }()