Make the wait + close not blocking

This commit is contained in:
kdeme 2019-05-09 12:14:47 +02:00
parent b62d091963
commit 42fbbb8961
No known key found for this signature in database
GPG Key ID: 4E8DD21420AF43F5
1 changed files with 2 additions and 2 deletions

View File

@ -1207,9 +1207,9 @@ proc disconnect*(peer: Peer, reason: DisconnectionReason, notifyOtherPeer = fals
await peer.transport.closeWait()
# Give the peer a chance to disconnect
await peer.waitAndClose(2.seconds)
traceAsyncErrors peer.waitAndClose(2.seconds)
elif not peer.transport.closed:
await peer.transport.closeWait()
peer.transport.close()
logDisconnectedPeer peer
peer.connectionState = Disconnected