X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FInvalidShutdownScript.java;h=da942ebc59e881348a6aa9e84a6535b73acf3e87;hb=3c60e0fd0da579be9932801c1be2b32014c944a5;hp=89b502bc4951dca54e171ea95e65b47bfc34903e;hpb=f3e670e9341decac613d33fc52febf19cea32f20;p=ldk-java diff --git a/src/main/java/org/ldk/structs/InvalidShutdownScript.java b/src/main/java/org/ldk/structs/InvalidShutdownScript.java index 89b502bc..da942ebc 100644 --- a/src/main/java/org/ldk/structs/InvalidShutdownScript.java +++ b/src/main/java/org/ldk/structs/InvalidShutdownScript.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; @@ -22,20 +23,23 @@ public class InvalidShutdownScript extends CommonBase { /** * The script that did not meet the requirements from [BOLT #2]. * - * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md */ public byte[] get_script() { byte[] ret = bindings.InvalidShutdownScript_get_script(this.ptr); + Reference.reachabilityFence(this); return ret; } /** * The script that did not meet the requirements from [BOLT #2]. * - * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md */ public void set_script(byte[] val) { bindings.InvalidShutdownScript_set_script(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); } /** @@ -43,14 +47,16 @@ public class InvalidShutdownScript extends CommonBase { */ public static InvalidShutdownScript of(byte[] script_arg) { long ret = bindings.InvalidShutdownScript_new(script_arg); + Reference.reachabilityFence(script_arg); if (ret >= 0 && ret <= 4096) { return null; } - InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvalidShutdownScript(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); + org.ldk.structs.InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } long clone_ptr() { long ret = bindings.InvalidShutdownScript_clone_ptr(this.ptr); + Reference.reachabilityFence(this); return ret; } @@ -59,9 +65,10 @@ public class InvalidShutdownScript extends CommonBase { */ public InvalidShutdownScript clone() { long ret = bindings.InvalidShutdownScript_clone(this.ptr); + Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvalidShutdownScript(null, ret); } - ret_hu_conv.ptrs_to.add(this); + org.ldk.structs.InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; }