X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FEffectiveCapacity.java;h=923e1bdb53d855786b01698f41b81ff79951e440;hb=300b54d26fe5ed89f472ef821ebf67d56c917e49;hp=7357afd1f2d3eeaf591086a41c31105173418a5e;hpb=ff3dacec3be60f870d81f6df11bd9fff92aa6047;p=ldk-java diff --git a/src/main/java/org/ldk/structs/EffectiveCapacity.java b/src/main/java/org/ldk/structs/EffectiveCapacity.java index 7357afd1..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; } } /** @@ -115,7 +123,7 @@ public class EffectiveCapacity extends CommonBase { 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; } @@ -127,7 +135,7 @@ public class EffectiveCapacity extends CommonBase { Reference.reachabilityFence(liquidity_msat); 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(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -139,19 +147,20 @@ public class EffectiveCapacity extends CommonBase { Reference.reachabilityFence(amount_msat); 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(ret_hu_conv); + 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; } org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -162,7 +171,7 @@ public class EffectiveCapacity extends CommonBase { long ret = bindings.EffectiveCapacity_infinite(); 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(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -173,7 +182,7 @@ public class EffectiveCapacity extends CommonBase { long ret = bindings.EffectiveCapacity_unknown(); 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(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; }