Update auto-generated bindings to LDK v0.0.99
[ldk-java] / src / main / java / org / ldk / structs / ChannelManager.java
index 734cca5ac3d5257a89dec72ccb1d91cd2cd7deb8..60176ba1f320b241869319cfff06bafd8e3a9de4 100644 (file)
@@ -105,6 +105,10 @@ public class ChannelManager extends CommonBase {
         * 
         * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
         * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
+        * 
+        * Note that we do not check if you are currently connected to the given peer. If no
+        * connection is available, the outbound `open_channel` message may fail to send, resulting in
+        * the channel eventually being silently forgotten.
         */
        public Result_NoneAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_id, UserConfig override_config) {
                long ret = bindings.ChannelManager_create_channel(this.ptr, their_network_key, channel_value_satoshis, push_msat, user_id, override_config == null ? 0 : override_config.ptr & ~1);
@@ -517,6 +521,17 @@ public class ChannelManager extends CommonBase {
                bindings.ChannelManager_await_persistable_update(this.ptr);
        }
 
+       /**
+        * Gets the latest best block which was connected either via the [`chain::Listen`] or
+        * [`chain::Confirm`] interfaces.
+        */
+       public BestBlock current_best_block() {
+               long ret = bindings.ChannelManager_current_best_block(this.ptr);
+               BestBlock ret_hu_conv = new BestBlock(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
        /**
         * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
         * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is