X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FDirectedChannelTransactionParameters.java;h=21b66476e3281112a8181502d0a3076b529c03ae;hb=1854b5cebef22ace9e9e4dd191f609818df9ce08;hp=2358c61524b4d5b2bf594e6648ba5811cf721dd7;hpb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;p=ldk-java diff --git a/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java b/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java index 2358c615..21b66476 100644 --- a/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java @@ -4,7 +4,17 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +/** + * Static channel fields used to build transactions given per-commitment fields, organized by + * broadcaster/countersignatory. + * + * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the + * as_holder_broadcastable and as_counterparty_broadcastable functions. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DirectedChannelTransactionParameters extends CommonBase { DirectedChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } @@ -14,35 +24,71 @@ public class DirectedChannelTransactionParameters extends CommonBase { if (ptr != 0) { bindings.DirectedChannelTransactionParameters_free(ptr); } } + /** + * Get the channel pubkeys for the broadcaster + */ public ChannelPublicKeys broadcaster_pubkeys() { long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } + /** + * Get the channel pubkeys for the countersignatory + */ public ChannelPublicKeys countersignatory_pubkeys() { long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } + /** + * Get the contest delay applicable to the transactions. + * Note that the contest delay was selected by the countersignatory. + */ public short contest_delay() { short ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr); + Reference.reachabilityFence(this); return ret; } + /** + * Whether the channel is outbound from the broadcaster. + * + * The boolean representing the side that initiated the channel is + * an input to the commitment number obscure factor computation. + */ public boolean is_outbound() { boolean ret = bindings.DirectedChannelTransactionParameters_is_outbound(this.ptr); + Reference.reachabilityFence(this); return ret; } + /** + * The funding outpoint + */ public OutPoint funding_outpoint() { long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr); - OutPoint ret_hu_conv = new OutPoint(null, ret); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } + /** + * Whether to use anchors for this channel + */ + public boolean opt_anchors() { + boolean ret = bindings.DirectedChannelTransactionParameters_opt_anchors(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + }