Skip to content

Commit ca133a6

Browse files
authored
Introducer disconnect (#143)
* Close introducer connection if it's still open
1 parent b9b5d82 commit ca133a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/full_node/full_node.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ async def on_connect() -> OutboundMessageGenerator:
222222
yield OutboundMessage(NodeType.INTRODUCER, msg, Delivery.RESPOND)
223223

224224
while not self._shut_down:
225+
for connection in self.server.global_connections.get_connections():
226+
if connection.connection_type == NodeType.INTRODUCER:
227+
await self.server.global_connections.close(connection)
225228
# The first time connecting to introducer, keep trying to connect
226229
if self._num_needed_peers():
227230
if not await self.server.start_client(

0 commit comments

Comments
 (0)