From: Matt Corallo Date: Fri, 6 Aug 2021 17:40:09 +0000 (+0000) Subject: Add a simple wrapper for `disconnect_by_node_id` in `NioPeerHandler` X-Git-Tag: v0.0.99.2~9 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=cc466db6973fe084aff139f147b08d583d8586a6;p=ldk-java Add a simple wrapper for `disconnect_by_node_id` in `NioPeerHandler` Fixes #36. --- diff --git a/src/main/java/org/ldk/batteries/NioPeerHandler.java b/src/main/java/org/ldk/batteries/NioPeerHandler.java index eac4d805..991a6b13 100644 --- a/src/main/java/org/ldk/batteries/NioPeerHandler.java +++ b/src/main/java/org/ldk/batteries/NioPeerHandler.java @@ -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.