X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FAPIError.java;h=ac94c9ce3ee5d9607ce9543fad480498ff38d8fd;hb=890e35a4387758c0447aab34166caa579bbf3a08;hp=1cdc5ab7610053e629dc570b8692a783ee8b92bf;hpb=2a8741cb87eb2b82381a6220a98f80f741147837;p=ldk-java diff --git a/src/main/java/org/ldk/structs/APIError.java b/src/main/java/org/ldk/structs/APIError.java index 1cdc5ab7..ac94c9ce 100644 --- a/src/main/java/org/ldk/structs/APIError.java +++ b/src/main/java/org/ldk/structs/APIError.java @@ -134,7 +134,7 @@ public class APIError extends CommonBase { super(null, ptr); long script = obj.script; org.ldk.structs.ShutdownScript script_hu_conv = null; if (script < 0 || script > 4096) { script_hu_conv = new org.ldk.structs.ShutdownScript(null, script); } - script_hu_conv.ptrs_to.add(this); + if (script_hu_conv != null) { script_hu_conv.ptrs_to.add(this); }; this.script = script_hu_conv; } } @@ -152,7 +152,7 @@ public class APIError extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.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; } @@ -164,7 +164,7 @@ public class APIError extends CommonBase { Reference.reachabilityFence(err); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.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; } @@ -177,7 +177,7 @@ public class APIError extends CommonBase { Reference.reachabilityFence(feerate); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.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; } @@ -189,7 +189,7 @@ public class APIError extends CommonBase { Reference.reachabilityFence(err); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.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; } @@ -201,7 +201,7 @@ public class APIError extends CommonBase { Reference.reachabilityFence(err); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.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; } @@ -212,7 +212,7 @@ public class APIError extends CommonBase { long ret = bindings.APIError_monitor_update_failed(); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.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; } @@ -220,11 +220,12 @@ public class APIError extends CommonBase { * Utility method to constructs a new IncompatibleShutdownScript-variant APIError */ public static APIError incompatible_shutdown_script(ShutdownScript script) { - long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr & ~1); + long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr); Reference.reachabilityFence(script); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.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); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(script); }; return ret_hu_conv; }