diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network.hs | 5 |
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 |