X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FSignerProvider.java;h=4de9147c3fe5854b0d548f22c3d6e698db7fa511;hb=2bb592fb946e316dba9f4d1123f8ac72ff4e9bf8;hp=52a369be5c7688608c9c126bfccd060a96c87b89;hpb=8fa2bcb208a51fa352d04981f1387d8bceced107;p=ldk-java diff --git a/src/main/java/org/ldk/structs/SignerProvider.java b/src/main/java/org/ldk/structs/SignerProvider.java index 52a369be..4de9147c 100644 --- a/src/main/java/org/ldk/structs/SignerProvider.java +++ b/src/main/java/org/ldk/structs/SignerProvider.java @@ -38,7 +38,7 @@ public class SignerProvider extends CommonBase { } public static interface SignerProviderInterface { /** - * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through + * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated * `channel_keys_id`. @@ -66,7 +66,7 @@ public class SignerProvider extends CommonBase { * This method is slowly being phased out -- it will only be called when reading objects * written by LDK versions prior to 0.0.113. * - * [`Signer`]: Self::Signer + * [`Signer`]: Self::EcdsaSigner * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ @@ -77,9 +77,10 @@ public class SignerProvider extends CommonBase { * If this function returns an error, this will result in a channel failing to open. * * This method should return a different value each time it is called, to avoid linking - * on-chain funds across channels as controlled to the same user. + * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be + * used to derive a unique value for each channel. */ - Result_ScriptNoneZ get_destination_script(); + Result_CVec_u8ZNoneZ get_destination_script(byte[] channel_keys_id); /** * Get a script pubkey which we will send funds to when closing a channel. * @@ -116,8 +117,8 @@ public class SignerProvider extends CommonBase { long result = ret == null ? 0 : ret.clone_ptr(); return result; } - @Override public long get_destination_script() { - Result_ScriptNoneZ ret = arg.get_destination_script(); + @Override public long get_destination_script(byte[] channel_keys_id) { + Result_CVec_u8ZNoneZ ret = arg.get_destination_script(channel_keys_id); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; @@ -132,7 +133,7 @@ public class SignerProvider extends CommonBase { return impl_holder.held; } /** - * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through + * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated * `channel_keys_id`. @@ -178,7 +179,7 @@ public class SignerProvider extends CommonBase { * This method is slowly being phased out -- it will only be called when reading objects * written by LDK versions prior to 0.0.113. * - * [`Signer`]: Self::Signer + * [`Signer`]: Self::EcdsaSigner * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ @@ -197,13 +198,15 @@ public class SignerProvider extends CommonBase { * If this function returns an error, this will result in a channel failing to open. * * This method should return a different value each time it is called, to avoid linking - * on-chain funds across channels as controlled to the same user. + * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be + * used to derive a unique value for each channel. */ - public Result_ScriptNoneZ get_destination_script() { - long ret = bindings.SignerProvider_get_destination_script(this.ptr); + public Result_CVec_u8ZNoneZ get_destination_script(byte[] channel_keys_id) { + long ret = bindings.SignerProvider_get_destination_script(this.ptr, InternalUtils.check_arr_len(channel_keys_id, 32)); Reference.reachabilityFence(this); + Reference.reachabilityFence(channel_keys_id); if (ret >= 0 && ret <= 4096) { return null; } - Result_ScriptNoneZ ret_hu_conv = Result_ScriptNoneZ.constr_from_ptr(ret); + Result_CVec_u8ZNoneZ ret_hu_conv = Result_CVec_u8ZNoneZ.constr_from_ptr(ret); return ret_hu_conv; }