def retry_connect(self):
"""Will be called when new channels in the token network are detected.
If the minimum number of channels was not yet established, it will try
to open new channels.
If the connection manager has no funds, this is a noop.
"""
# not initialized
if self.funds <= 0:
return
# in leaving state
if self.leaving_state:
return
with self.lock:
if self.funds_remaining <= 0:
return
if len(self.open_channels) >= self.initial_channel_target:
return
# try to fullfill our connection goal
self._add_new_partners()
评论列表
文章目录