X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FDirectedChannelInfo.java;h=e6164ba017854d0d077aaa0f88a1408bb470ed62;hb=8aa8a96fc6d8fcdd3fbb419b4b4c12482af14938;hp=be7271b445e6ed59d0e59386540f253fc804c662;hpb=9aa1eebc40df06586c7ab12f7c8eb22ebcb8b365;p=ldk-java diff --git a/src/main/java/org/ldk/structs/DirectedChannelInfo.java b/src/main/java/org/ldk/structs/DirectedChannelInfo.java index be7271b4..e6164ba0 100644 --- a/src/main/java/org/ldk/structs/DirectedChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectedChannelInfo.java @@ -34,8 +34,8 @@ public class DirectedChannelInfo extends CommonBase { long ret = bindings.DirectedChannelInfo_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - DirectedChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectedChannelInfo(null, ret); } - ret_hu_conv.ptrs_to.add(this); + org.ldk.structs.DirectedChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DirectedChannelInfo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -46,24 +46,18 @@ public class DirectedChannelInfo extends CommonBase { long ret = bindings.DirectedChannelInfo_channel(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelInfo(null, ret); } - ret_hu_conv.ptrs_to.add(this); + org.ldk.structs.ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelInfo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } /** - * Returns information for the direction. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + * Returns the maximum HTLC amount allowed over the channel in the direction. */ - @Nullable - public ChannelUpdateInfo direction() { - long ret = bindings.DirectedChannelInfo_direction(this.ptr); + public long htlc_maximum_msat() { + long ret = bindings.DirectedChannelInfo_htlc_maximum_msat(this.ptr); Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdateInfo(null, ret); } - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; + return ret; } /** @@ -71,14 +65,14 @@ public class DirectedChannelInfo extends CommonBase { * * This is either the total capacity from the funding transaction, if known, or the * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known, - * whichever is smaller. + * otherwise. */ public EffectiveCapacity effective_capacity() { long ret = bindings.DirectedChannelInfo_effective_capacity(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; }