X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FAcceptChannel.java;h=fc0b4a5c1bd0ae0efadd58eaf701b77f5f2be7ac;hb=f385eff0dd0aa61fbf21ae946c424f4a6a26de04;hp=70157f071269742ac2f48a76868a072984dec179;hpb=d2925e24ac4643ec22eb73495f0424e27def2545;p=ldk-java diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index 70157f07..fc0b4a5c 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -272,6 +272,41 @@ public class AcceptChannel extends CommonBase { Reference.reachabilityFence(val); } + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * This is required to match the equivalent field in [`OpenChannel::channel_type`]. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public ChannelTypeFeatures get_channel_type() { + long ret = bindings.AcceptChannel_get_channel_type(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * This is required to match the equivalent field in [`OpenChannel::channel_type`]. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_channel_type(@Nullable ChannelTypeFeatures val) { + bindings.AcceptChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; + } + long clone_ptr() { long ret = bindings.AcceptChannel_clone_ptr(this.ptr); Reference.reachabilityFence(this); @@ -285,8 +320,8 @@ public class AcceptChannel extends CommonBase { long ret = bindings.AcceptChannel_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AcceptChannel(null, ret); } - ret_hu_conv.ptrs_to.add(this); + org.ldk.structs.AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannel(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; }