We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36c0c41 commit d071d95Copy full SHA for d071d95
src/main/java/org/ldk/batteries/NioPeerHandler.java
@@ -255,6 +255,10 @@ public NioPeerHandler(PeerManager manager) throws IOException {
255
* @throws IOException If connecting to the remote endpoint fails or internal java.nio errors occur.
256
*/
257
public void connect(byte[] their_node_id, java.net.SocketAddress remote, int timeout_ms) throws IOException {
258
+ if (this.peer_manager.peer_by_node_id(their_node_id) != null) {
259
+ // The peer is already connected, no need to try to reconnect.
260
+ return;
261
+ }
262
SocketChannel chan = SocketChannel.open();
263
boolean connected;
264
try {
0 commit comments