Update auto-generated bindings with allow_wallclock_use 2021-03-enable-wallclock
authorMatt Corallo <git@bluematt.me>
Wed, 31 Mar 2021 04:08:34 +0000 (00:08 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 31 Mar 2021 04:09:21 +0000 (00:09 -0400)
lightning-c-bindings/include/lightning.h
lightning-c-bindings/src/ln/channelmanager.rs

index 60ba6f714d10b7c967d16a2636296bd03b75c6e3..bdeb29858d5c9e60954c4eaebab3f4e1e0909a5f 100644 (file)
@@ -11191,6 +11191,15 @@ void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR
  */
 void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]);
 
+/**
+ * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
+ * indicating whether persistence is necessary. Only one listener on
+ * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
+ * up.
+ * Note that the feature `allow_wallclock_use` must be enabled to use this function.
+ */
+MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
+
 /**
  * Blocks until ChannelManager needs to be persisted. Only one listener on
  * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
index f28f7de77403a1f5b4f7b237b640e3decf79e6b4..89a3b249e39078d61bf7915cf5b4e7471b940d3a 100644 (file)
@@ -941,6 +941,18 @@ pub extern "C" fn ChannelManager_block_disconnected(this_arg: &ChannelManager, h
        unsafe { &*this_arg.inner }.block_disconnected(&::bitcoin::consensus::encode::deserialize(unsafe { &*header }).unwrap())
 }
 
+/// Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
+/// indicating whether persistence is necessary. Only one listener on
+/// `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
+/// up.
+/// Note that the feature `allow_wallclock_use` must be enabled to use this function.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelManager_await_persistable_update_timeout(this_arg: &ChannelManager, mut max_wait: u64) -> bool {
+       let mut ret = unsafe { &*this_arg.inner }.await_persistable_update_timeout(std::time::Duration::from_secs(max_wait));
+       ret
+}
+
 /// Blocks until ChannelManager needs to be persisted. Only one listener on
 /// `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
 /// up.