projects
/
ldk-java
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
410a782
)
Add a simple wrapper for `disconnect_by_node_id` in `NioPeerHandler`
author
Matt Corallo
<git@bluematt.me>
Fri, 6 Aug 2021 17:40:09 +0000
(17:40 +0000)
committer
Matt Corallo
<git@bluematt.me>
Mon, 9 Aug 2021 05:53:31 +0000
(
05:53
+0000)
Fixes #36.
src/main/java/org/ldk/batteries/NioPeerHandler.java
patch
|
blob
|
history
diff --git
a/src/main/java/org/ldk/batteries/NioPeerHandler.java
b/src/main/java/org/ldk/batteries/NioPeerHandler.java
index eac4d8058a898fd7a8af0a61ddb8e2be68627f92..991a6b135fda62468aa3878b1864cf4b1f512fe9 100644
(file)
--- 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.