Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(p2p): don't reconnect peers when pool closed (#1965)
This ensures that we don't attempt to reconnect to peers that have disconnected from us after we have started closing the p2p pool. This may help prevent scenarios where we unintentionally attempt to reconnect to peers after shutting down xud. > Should be tested against [#1668 (comment)](#1668 (comment)) @raladev re-connection after shutdown is disappeared, but my xud still can not be gracefully terminated, it waits something: ``` 28/10/2020 05:17:43.164 [CONNEXT] trace: sending request to /balance/0x69C3d485623bA3f382Fc0FB6756c4574d43C1618 ^C28/10/2020 05:17:44.087 [GLOBAL] info: XUD is shutting down 28/10/2020 05:17:44.088 [LND-BTC] info: new status: Disconnected 28/10/2020 05:17:44.089 [LND-LTC] info: new status: Disconnected 28/10/2020 05:17:44.090 [CONNEXT] info: new status: Disconnected 28/10/2020 05:17:44.093 [P2P] debug: Peer 03ece33a30db1dbce4b62fa96a5e9541138a24997ef5672eebed2d332270e39542 (OzoneYellow): closing socket. reason: Shutdown 28/10/2020 05:17:44.095 [HTTP] info: http server has closed 28/10/2020 05:17:44.096 [RPC] info: gRPC server completed shutdown 28/10/2020 05:17:44.097 [P2P] trace: Sent Disconnecting packet to 03ece33a30db1dbce4b62fa96a5e9541138a24997ef5672eebed2d332270e39542 (OzoneYellow): "{\"body\":{\"reason\":9},\"header\":{\"id\":\"95133be0-1917-11eb-b75b-73d0f0278756\"}}" 28/10/2020 05:17:44.109 [ORDERBOOK] debug: removed all orders for peer 03ece33a30db1dbce4b62fa96a5e9541138a24997ef5672eebed2d332270e39542 (OzoneYellow) 28/10/2020 05:17:44.118 [GLOBAL] info: XUD shutdown gracefully ```
- Loading branch information