summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Network.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Network.hs b/src/Network.hs
index 7bb9fea..d1343f4 100644
--- a/src/Network.hs
+++ b/src/Network.hs
@@ -375,8 +375,9 @@ startServer opt origHead logd' services = do
putTMVar svcStates global
Just h -> do
(rsp, (s', gs')) <- handleServicePacket h inp s gs (wrappedLoad ref :: Stored s)
- identity <- readMVar midentity
- sendToPeerList identity peer rsp
+ when (not (null rsp)) $ do
+ identity <- readMVar midentity
+ sendToPeerList identity peer rsp
atomically $ do
putTMVar (peerServiceState peer) $ M.insert svc (SomeServiceState proxy s') svcs
putTMVar svcStates $ M.insert svc (SomeServiceGlobalState proxy gs') global