Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_node.py
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | def add_p2p_connection(self, p2p_conn, **kwargs): | ||||
This method adds the p2p connection to the self.p2ps list and also | This method adds the p2p connection to the self.p2ps list and also | ||||
returns the connection to the caller.""" | returns the connection to the caller.""" | ||||
if 'dstport' not in kwargs: | if 'dstport' not in kwargs: | ||||
kwargs['dstport'] = p2p_port(self.index) | kwargs['dstport'] = p2p_port(self.index) | ||||
if 'dstaddr' not in kwargs: | if 'dstaddr' not in kwargs: | ||||
kwargs['dstaddr'] = '127.0.0.1' | kwargs['dstaddr'] = '127.0.0.1' | ||||
self.p2ps.append(p2p_conn) | self.p2ps.append(p2p_conn) | ||||
kwargs.update({'rpc': self.rpc, 'callback': p2p_conn}) | kwargs.update({'callback': p2p_conn}) | ||||
p2p_conn.add_connection(NodeConn(**kwargs)) | p2p_conn.add_connection(NodeConn(**kwargs)) | ||||
return p2p_conn | return p2p_conn | ||||
@property | @property | ||||
def p2p(self): | def p2p(self): | ||||
"""Return the first p2p connection | """Return the first p2p connection | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |