We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4974e8f commit 4309f47Copy full SHA for 4309f47
1 file changed
src/lib.rs
@@ -656,6 +656,15 @@ impl Node {
656
Ok(())
657
}
658
659
+ /// Disconnect all connected peers, closing their TCP connections.
660
+ ///
661
+ /// This can be called regardless of whether the node is running. Use this to ensure
662
+ /// TCP connections are torn down on serverless platforms where the node may have connected
663
+ /// to peers (e.g., during invoice generation) without a full `start()`/`stop()` cycle.
664
+ pub fn disconnect_all_peers(&self) {
665
+ self.peer_manager.disconnect_all_peers();
666
+ }
667
+
668
/// Disconnects all peers, stops all running background tasks, and shuts down [`Node`].
669
///
670
/// After this returns most API methods will return [`Error::NotRunning`].
0 commit comments