From 81a36131cf76d3c58a6d81278ff6fd96c0e02259 Mon Sep 17 00:00:00 2001 From: Forrest Voight Date: Sun, 17 Mar 2013 20:35:08 -0400 Subject: [PATCH] clarified parse function --- p2pool/main.py | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/p2pool/main.py b/p2pool/main.py index 0e2c743..cbb3769 100644 --- a/p2pool/main.py +++ b/p2pool/main.py @@ -145,12 +145,12 @@ def main(args, net, datadir_path, merged_urls, worker_endpoint): print 'Joining p2pool network using port %i...' % (args.p2pool_port,) @defer.inlineCallbacks - def parse(x): - if ':' in x: - ip, port = x.split(':') - defer.returnValue(((yield reactor.resolve(ip)), int(port))) - else: - defer.returnValue(((yield reactor.resolve(x)), net.P2P_PORT)) + def parse(host): + port = net.P2P_PORT + if ':' in host: + host, port_str = host.split(':') + port = int(port_str) + defer.returnValue(((yield reactor.resolve(host)), port)) addrs = {} if os.path.exists(os.path.join(datadir_path, 'addrs')): -- 1.7.1