File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ interface LDKNode {
8989 [Throws=NodeError]
9090 string sign_message([ByRef]sequence<u8> msg);
9191 boolean verify_signature([ByRef]sequence<u8> msg, [ByRef]string sig, [ByRef]PublicKey pkey);
92+ boolean is_running();
9293};
9394
9495[Error]
Original file line number Diff line number Diff line change @@ -708,6 +708,11 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
708708 Ok ( ( ) )
709709 }
710710
711+ /// Returns whether the [`Node`] is running.
712+ pub fn is_running ( & self ) -> bool {
713+ self . runtime . read ( ) . unwrap ( ) . is_some ( )
714+ }
715+
711716 /// Disconnects all peers, stops all running background tasks, and shuts down [`Node`].
712717 ///
713718 /// After this returns most API methods will return [`Error::NotRunning`].
You can’t perform that action at this time.
0 commit comments