Add a simple wrapper for `disconnect_by_node_id` in `NioPeerHandler`
[ldk-java] / src / main / java / org / ldk / batteries / NioPeerHandler.java
index eac4d8058a898fd7a8af0a61ddb8e2be68627f92..991a6b135fda62468aa3878b1864cf4b1f512fe9 100644 (file)
@@ -236,6 +236,15 @@ public class NioPeerHandler {
         }
     }
 
+    /**
+     * Disconnects any connections currently open with the peer with the given node id.
+     *
+     * @param their_node_id must be a valid 33-byte public key
+     */
+    public void disconnect(byte[] their_node_id) {
+        this.peer_manager.disconnect_by_node_id(their_node_id, false);
+    }
+
     /**
      * Binds a listening socket to the given address, accepting incoming connections and handling them on the background
      * thread.