X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FAcceptChannel.java;h=09125fe31b528e7520fcaf7b0d758a1576b6f000;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=cc61466ef5f0100f68a14870956413a6b9f6b5ad;hpb=b6cc0960eaee5a5bbc7fde79a56152d6dcd649d8;p=ldk-java diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index cc61466e..09125fe3 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; /** @@ -233,7 +234,8 @@ public class AcceptChannel extends CommonBase { */ public AcceptChannel clone() { long ret = bindings.AcceptChannel_clone(this.ptr); - AcceptChannel ret_hu_conv = new AcceptChannel(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AcceptChannel(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -251,6 +253,7 @@ public class AcceptChannel extends CommonBase { */ public static Result_AcceptChannelDecodeErrorZ read(byte[] ser) { long ret = bindings.AcceptChannel_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }