diff --git a/lib/electrumx_rpc/rpc2.dart b/lib/electrumx_rpc/rpc2.dart index 7bb382566..73f63e656 100644 --- a/lib/electrumx_rpc/rpc2.dart +++ b/lib/electrumx_rpc/rpc2.dart @@ -52,9 +52,10 @@ class JsonRPC { void _doneHandler() { Logging.instance.log( "JsonRPC doneHandler: " - "connection closed to ${_socket?.address}:${_socket?.port}", + "connection closed to ${_socket?.address}:${_socket?.port}, destroying socket", level: LogLevel.Info, ); + _socket?.destroy(); } Future _onReqCompleted(_JsonRPCRequest req) async {