From 6a2506745dd06ad0849a1b0d440ad9751a69cf81 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 23 Jan 2017 18:20:21 -0500 Subject: New command "pid" to tell server's process id. --- src/Network/BitTorrent/DHT/Session.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Network/BitTorrent/DHT') diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs index c08021c7..8dc3f7ac 100644 --- a/src/Network/BitTorrent/DHT/Session.hs +++ b/src/Network/BitTorrent/DHT/Session.hs @@ -395,8 +395,9 @@ routableAddress = do myNodeIdAccordingTo :: NodeAddr ip -> DHT ip NodeId myNodeIdAccordingTo _ = do info <- asks routingInfo >>= liftIO . atomically . readTVar - fallback <- asks tentativeNodeId - return $ maybe fallback myNodeId info + maybe (asks tentativeNodeId) + (return . myNodeId) + info -- | Get current routing table. Normally you don't need to use this -- function, but it can be usefull for debugging and profiling purposes. -- cgit v1.2.3