X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelManager.java;fp=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelManager.java;h=3136908417b5e22e6539c68a11503583521ea0e3;hb=2bb592fb946e316dba9f4d1123f8ac72ff4e9bf8;hp=08381445eeb466ea5569c537d84e5f6b35bf017a;hpb=519dc944de5b88f95975140a13fbc6d77dd15a95;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index 08381445..31369084 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -153,6 +153,9 @@ public class ChannelManager extends CommonBase { * connection is available, the outbound `open_channel` message may fail to send, resulting in * the channel eventually being silently forgotten (dropped on reload). * + * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the + * channel. Otherwise, a random one will be generated for you. + * * Returns the new Channel's temporary `channel_id`. This ID will appear as * [`Event::FundingGenerationReady::temporary_channel_id`] and in * [`ChannelDetails::channel_id`] until after @@ -166,16 +169,18 @@ public class ChannelManager extends CommonBase { * * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_ThirtyTwoBytesAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, org.ldk.util.UInt128 user_channel_id, @Nullable org.ldk.structs.UserConfig override_config) { - long ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.check_arr_len(their_network_key, 33), channel_value_satoshis, push_msat, user_channel_id.getLEBytes(), override_config == null ? 0 : override_config.ptr); + public Result_ThirtyTwoBytesAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.Option_ThirtyTwoBytesZ temporary_channel_id, @Nullable org.ldk.structs.UserConfig override_config) { + long ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.check_arr_len(their_network_key, 33), channel_value_satoshis, push_msat, user_channel_id.getLEBytes(), temporary_channel_id.ptr, override_config == null ? 0 : override_config.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_network_key); Reference.reachabilityFence(channel_value_satoshis); Reference.reachabilityFence(push_msat); Reference.reachabilityFence(user_channel_id); + Reference.reachabilityFence(temporary_channel_id); Reference.reachabilityFence(override_config); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesAPIErrorZ ret_hu_conv = Result_ThirtyTwoBytesAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(temporary_channel_id); }; if (this != null) { this.ptrs_to.add(override_config); }; return ret_hu_conv; } @@ -685,7 +690,7 @@ public class ChannelManager extends CommonBase { * Return values are identical to [`Self::funding_transaction_generated`], respective to * each individual channel and transaction output. * - * Do NOT broadcast the funding transaction yourself. This batch funding transcaction + * Do NOT broadcast the funding transaction yourself. This batch funding transaction * will only be broadcast when we have safely received and persisted the counterparty's * signature for each channel. * @@ -1061,8 +1066,11 @@ public class ChannelManager extends CommonBase { * * # Errors * - * Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link - * or if the provided parameters are invalid for the offer. + * Errors if: + * - a duplicate `payment_id` is provided given the caveats in the aforementioned link, + * - the provided parameters are invalid for the offer, + * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice + * request. * * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity @@ -1108,6 +1116,11 @@ public class ChannelManager extends CommonBase { * node meeting the aforementioned criteria, but there's no guarantee that they will be * received and no retries will be made. * + * # Errors + * + * Errors if the parameterized [`Router`] is unable to create a blinded payment path or reply + * path for the invoice. + * * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ public Result_NoneBolt12SemanticErrorZ request_refund_payment(org.ldk.structs.Refund refund) {