Skip to content

Commit 0c13726

Browse files
authored
Merge pull request #169 from jbesraa/feat/is-node-running
Add `is_running` function to `Node`
2 parents db1b7dc + 0a95d72 commit 0c13726

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

bindings/ldk_node.udl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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]

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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`].

0 commit comments

Comments
 (0)