Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit 60518a0

Browse files
committed
warn user about bitcoin connection slots if p2p connect takes longer than 5 seconds
1 parent 9e3f13c commit 60518a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

p2pool/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ def connect_p2p():
3737
print '''Testing bitcoind P2P connection to '%s:%s'...''' % (args.bitcoind_address, args.bitcoind_p2p_port)
3838
factory = bitcoin_p2p.ClientFactory(net.PARENT)
3939
reactor.connectTCP(args.bitcoind_address, args.bitcoind_p2p_port, factory)
40+
def long():
41+
print ''' ...taking a while. Common reasons for this include all of bitcoind's connection slots being used...'''
42+
long_dc = reactor.callLater(5, long)
4043
yield factory.getProtocol() # waits until handshake is successful
44+
if not long_dc.called: long_dc.cancel()
4145
print ' ...success!'
4246
print
4347
defer.returnValue(factory)

0 commit comments

Comments
 (0)