From 9fadcc907cae8506d88df61b533a74528ecffa69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Thu, 10 Nov 2016 00:58:35 -0500 Subject: [PATCH] python: add default port for bootstrap --- python/opendht.pyx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/opendht.pyx b/python/opendht.pyx index 49f45711..2ebbd701 100644 --- a/python/opendht.pyx +++ b/python/opendht.pyx @@ -280,8 +280,11 @@ cdef class DhtRunner(_WithID): return h def getNodeId(self): return self.thisptr.get().getNodeId().toString() - def bootstrap(self, str host, str port): - self.thisptr.get().bootstrap(host.encode(), port.encode()) + def bootstrap(self, str host, str port=None): + if port: + self.thisptr.get().bootstrap(host.encode(), port.encode()) + else: + self.thisptr.get().bootstrap(host.encode(), b'4222') def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()): if id: config.setIdentity(id)