X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FDirectedChannelInfo.java;h=9b216199f5988c712011f2925c8ddcbe8a1e5e67;hb=5e9de82b3a7712a41189756d9d16d946142b2ac5;hp=5dea625fb8854740d15f0575ee98a3e814d9adb3;hpb=d941cc4e66ea53ce81912a04d35b164344f3a7ee;p=ldk-java diff --git a/src/main/java/org/ldk/structs/DirectedChannelInfo.java b/src/main/java/org/ldk/structs/DirectedChannelInfo.java index 5dea625f..9b216199 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,8 +46,8 @@ 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; } @@ -61,24 +61,33 @@ public class DirectedChannelInfo extends CommonBase { long ret = bindings.DirectedChannelInfo_direction(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); + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } + /** + * Returns the maximum HTLC amount allowed over the channel in the direction. + */ + public long htlc_maximum_msat() { + long ret = bindings.DirectedChannelInfo_htlc_maximum_msat(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns the [`EffectiveCapacity`] of the channel in the direction. * * 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; } - EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); + org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; }