X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FTwoTuple_BlockHashChannelManagerZ.java;h=1caafd1b355eeca60aee571be2a5182344eb6ebe;hb=300b54d26fe5ed89f472ef821ebf67d56c917e49;hp=38761c9a9a7587504aa28033fddd156ee6e6d1a8;hpb=f6c75b182a7786062a4966e8939701ef59092509;p=ldk-java diff --git a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java index 38761c9a..1caafd1b 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java @@ -4,6 +4,7 @@ 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; @@ -24,6 +25,7 @@ public class TwoTuple_BlockHashChannelManagerZ extends CommonBase { */ public byte[] get_a() { byte[] ret = bindings.C2Tuple_BlockHashChannelManagerZ_get_a(this.ptr); + Reference.reachabilityFence(this); return ret; } @@ -32,9 +34,10 @@ public class TwoTuple_BlockHashChannelManagerZ extends CommonBase { */ public ChannelManager get_b() { long ret = bindings.C2Tuple_BlockHashChannelManagerZ_get_b(this.ptr); - if (ret < 1024) { return null; } - ChannelManager ret_hu_conv = new ChannelManager(null, ret); - ret_hu_conv.ptrs_to.add(this); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelManager(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -42,17 +45,25 @@ public class TwoTuple_BlockHashChannelManagerZ extends CommonBase { * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements. */ public static TwoTuple_BlockHashChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Logger b_logger, KeysInterface b_keys_manager, UserConfig b_config, ChainParameters b_params) { - long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(a, bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_logger == null ? 0 : b_logger.ptr, b_keys_manager == null ? 0 : b_keys_manager.ptr, b_config == null ? 0 : b_config.ptr & ~1, b_params == null ? 0 : b_params.ptr & ~1)); - if (ret < 1024) { return null; } + long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_logger == null ? 0 : b_logger.ptr, b_keys_manager == null ? 0 : b_keys_manager.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr)); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b_fee_est); + Reference.reachabilityFence(b_chain_monitor); + Reference.reachabilityFence(b_tx_broadcaster); + Reference.reachabilityFence(b_logger); + Reference.reachabilityFence(b_keys_manager); + Reference.reachabilityFence(b_config); + Reference.reachabilityFence(b_params); + if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_BlockHashChannelManagerZ ret_hu_conv = new TwoTuple_BlockHashChannelManagerZ(null, ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(b_fee_est); - ret_hu_conv.ptrs_to.add(b_chain_monitor); - ret_hu_conv.ptrs_to.add(b_tx_broadcaster); - ret_hu_conv.ptrs_to.add(b_logger); - ret_hu_conv.ptrs_to.add(b_keys_manager); - ret_hu_conv.ptrs_to.add(b_config); - ret_hu_conv.ptrs_to.add(b_params); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_fee_est); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_chain_monitor); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_tx_broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_config); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_params); }; return ret_hu_conv; }