X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FEffectiveCapacity.java;h=923e1bdb53d855786b01698f41b81ff79951e440;hb=3c60e0fd0da579be9932801c1be2b32014c944a5;hp=777c3b66e941c3f912913f158726890959e42d26;hpb=d941cc4e66ea53ce81912a04d35b164344f3a7ee;p=ldk-java diff --git a/src/main/java/org/ldk/structs/EffectiveCapacity.java b/src/main/java/org/ldk/structs/EffectiveCapacity.java index 777c3b66..923e1bdb 100644 --- a/src/main/java/org/ldk/structs/EffectiveCapacity.java +++ b/src/main/java/org/ldk/structs/EffectiveCapacity.java @@ -78,9 +78,17 @@ public class EffectiveCapacity extends CommonBase { * The funding amount denominated in millisatoshi. */ public final long capacity_msat; + /** + * The maximum HTLC amount denominated in millisatoshi. + */ + public final org.ldk.structs.Option_u64Z htlc_maximum_msat; private Total(long ptr, bindings.LDKEffectiveCapacity.Total obj) { super(null, ptr); this.capacity_msat = obj.capacity_msat; + long htlc_maximum_msat = obj.htlc_maximum_msat; + org.ldk.structs.Option_u64Z htlc_maximum_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(htlc_maximum_msat); + if (htlc_maximum_msat_hu_conv != null) { htlc_maximum_msat_hu_conv.ptrs_to.add(this); }; + this.htlc_maximum_msat = htlc_maximum_msat_hu_conv; } } /** @@ -114,8 +122,8 @@ public class EffectiveCapacity extends CommonBase { long ret = bindings.EffectiveCapacity_clone(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; } @@ -126,8 +134,8 @@ public class EffectiveCapacity extends CommonBase { long ret = bindings.EffectiveCapacity_exact_liquidity(liquidity_msat); Reference.reachabilityFence(liquidity_msat); if (ret >= 0 && ret <= 4096) { return null; } - EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + 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(ret_hu_conv); }; return ret_hu_conv; } @@ -138,20 +146,21 @@ public class EffectiveCapacity extends CommonBase { long ret = bindings.EffectiveCapacity_maximum_htlc(amount_msat); Reference.reachabilityFence(amount_msat); if (ret >= 0 && ret <= 4096) { return null; } - EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + 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(ret_hu_conv); }; return ret_hu_conv; } /** * Utility method to constructs a new Total-variant EffectiveCapacity */ - public static EffectiveCapacity total(long capacity_msat) { - long ret = bindings.EffectiveCapacity_total(capacity_msat); + public static EffectiveCapacity total(long capacity_msat, Option_u64Z htlc_maximum_msat) { + long ret = bindings.EffectiveCapacity_total(capacity_msat, htlc_maximum_msat.ptr); Reference.reachabilityFence(capacity_msat); + Reference.reachabilityFence(htlc_maximum_msat); if (ret >= 0 && ret <= 4096) { return null; } - EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + 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(ret_hu_conv); }; return ret_hu_conv; } @@ -161,8 +170,8 @@ public class EffectiveCapacity extends CommonBase { public static EffectiveCapacity infinite() { long ret = bindings.EffectiveCapacity_infinite(); if (ret >= 0 && ret <= 4096) { return null; } - EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + 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(ret_hu_conv); }; return ret_hu_conv; } @@ -172,8 +181,8 @@ public class EffectiveCapacity extends CommonBase { public static EffectiveCapacity unknown() { long ret = bindings.EffectiveCapacity_unknown(); if (ret >= 0 && ret <= 4096) { return null; } - EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + 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(ret_hu_conv); }; return ret_hu_conv; }