Commit 65a24e02ed3032afa3c3781ea73259442df62e57

Authored by comboy
Committed by Julian Langschaedel
1 parent 9b4e18a886

fix handling incoming connections by node

Showing 2 changed files with 2 additions and 3 deletions Side-by-side Diff

lib/bitcoin/network/connection_handler.rb
... ... @@ -91,8 +91,7 @@
91 91 log.info { "Established #{@direction} connection" }
92 92 @node.connections << self
93 93 @state = :handshake
94   - # incoming connections wait to receive a version
95   - send_version if outgoing?
  94 + send_version
96 95 rescue Exception
97 96 log.fatal { "Error in #begin_handshake" }
98 97 p $!; puts *$@
lib/bitcoin/network/node.rb
... ... @@ -490,7 +490,7 @@
490 490  
491 491 # should the node accept new incoming connections?
492 492 def accept_connections?
493   - connections.select(&:incoming?).size >= config[:max][:connections_in]
  493 + connections.select(&:incoming?).size < config[:max][:connections_in]
494 494 end
495 495  
496 496 end