Commit 9b4e18a886c18824384568c53db6bec251635326

Authored by comboy
Committed by Julian Langschaedel
1 parent c74ccada9c

distinguish disconnect from failed connection in log messages

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

lib/bitcoin/network/connection_handler.rb
... ... @@ -58,6 +58,7 @@
58 58  
59 59 # only called for outgoing connection
60 60 def connection_completed
  61 + @connection_completed = true
61 62 begin_handshake
62 63 rescue Exception
63 64 log.fatal { "Error in #connection_completed" }
... ... @@ -75,7 +76,7 @@
75 76  
76 77 # connection closed; notify listeners and cleanup connection from node
77 78 def unbind
78   - log.info { "Disconnected" }
  79 + log.info { (outgoing? && !@connection_completed) ? "Connection failed" : "Disconnected" }
79 80 @node.push_notification(:connection, [:disconnected, [@host, @port]])
80 81 @state = :disconnected
81 82 @node.connections.delete(self)