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

Commit 8991538

Browse files
committed
Fix bug in hole punch
1 parent 4694894 commit 8991538

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

api/restapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,8 @@ def get_routing_table(self, request):
772772
"guid": node.id.encode("hex"),
773773
"ip": node.ip,
774774
"port": node.port,
775-
"vendor": node.vendor
775+
"vendor": node.vendor,
776+
"nat_type": objects.NATType.Name(node.nat_type)
776777
}
777778
nodes.append(n)
778779
request.write(json.dumps(nodes, indent=4))

dht/network.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ def resolve(self, guid):
323323
Args:
324324
guid: the 20 raw bytes representing the guid.
325325
"""
326+
# TODO: should also check in the multiplexer to see if we are connected to this node
326327
node_to_find = Node(guid)
327328

328329
def check_for_node(nodes):

market/contracts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,6 @@ def cb_chain(ec, result):
11111111
libbitcoin_client.fetch_history2(addr, history_fetched)
11121112
except Exception:
11131113
pass
1114-
1114+
libbitcoin_client.refresh_connection()
11151115
check(db.Purchases().get_unfunded(), True)
11161116
check(db.Sales().get_unfunded(), False)

net/rpcudp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def rpc_hole_punch(self, sender, ip, port, relay="False"):
166166
the other node to punch through our NAT.
167167
"""
168168
if relay == "True":
169-
self.hole_punch(Node(None, ip, int(port), nat_type=FULL_CONE), sender.ip, sender.port)
169+
self.hole_punch(Node(digest("null"), ip, int(port), nat_type=FULL_CONE), sender.ip, sender.port)
170170
else:
171171
self.log.debug("punching through NAT for %s:%s" % (ip, port))
172172
# pylint: disable=W0612

0 commit comments

Comments
 (0)