Skip to content

Commit

Permalink
warn user about bitcoin connection slots if p2p connect takes longer …
Browse files Browse the repository at this point in the history
…than 5 seconds
  • Loading branch information
forrestv committed Aug 25, 2013
1 parent 9e3f13c commit 60518a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions p2pool/main.py
Expand Up @@ -37,7 +37,11 @@ def connect_p2p():
print '''Testing bitcoind P2P connection to '%s:%s'...''' % (args.bitcoind_address, args.bitcoind_p2p_port)
factory = bitcoin_p2p.ClientFactory(net.PARENT)
reactor.connectTCP(args.bitcoind_address, args.bitcoind_p2p_port, factory)
def long():
print ''' ...taking a while. Common reasons for this include all of bitcoind's connection slots being used...'''
long_dc = reactor.callLater(5, long)
yield factory.getProtocol() # waits until handshake is successful
if not long_dc.called: long_dc.cancel()
print ' ...success!'
print
defer.returnValue(factory)
Expand Down

0 comments on commit 60518a0

Please sign in to comment.