From ce00d3ac36f6150ce10c103760a59ad0e3d35562 Mon Sep 17 00:00:00 2001 From: Chris Stewart Date: Mon, 2 May 2022 06:27:21 -0500 Subject: [PATCH] Segregate handling of Tcp.ErrorClosed command from the rest of Tcp.ConnectionClosed (#4307) * Segregate handling of Tcp.ErrorClosed command from the rest of Tcp.ConnectionClosed * Remove old match --- .../scala/org/bitcoins/node/networking/P2PClient.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/node/src/main/scala/org/bitcoins/node/networking/P2PClient.scala b/node/src/main/scala/org/bitcoins/node/networking/P2PClient.scala index 37a37c6eab..e612d102aa 100644 --- a/node/src/main/scala/org/bitcoins/node/networking/P2PClient.scala +++ b/node/src/main/scala/org/bitcoins/node/networking/P2PClient.scala @@ -290,8 +290,13 @@ case class P2PClientActor( context.become(awaitNetworkRequest(peerConnection, unalignedBytes)) unalignedBytes + case Tcp.ErrorClosed(cause) => + logger.error( + s"An error occurred in our connection with $peer, cause=$cause state=${currentPeerMsgHandlerRecv.state}") + currentPeerMsgHandlerRecv = currentPeerMsgHandlerRecv.disconnect() + unalignedBytes case closeCmd @ (Tcp.ConfirmedClosed | Tcp.Closed | Tcp.Aborted | - Tcp.PeerClosed | Tcp.ErrorClosed(_)) => + Tcp.PeerClosed) => logger.info( s"We've been disconnected by $peer command=${closeCmd} state=${currentPeerMsgHandlerRecv.state}") currentPeerMsgHandlerRecv = currentPeerMsgHandlerRecv.disconnect()