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=4e19d30ebf5c228d6d2c965c2ad4093e0e594bb0;hpb=1b870a3ffab1c0024411e30102bc6d198300f095;p=ldk-java diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index 4e19d30e..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; } @@ -249,8 +251,9 @@ public class AcceptChannel extends CommonBase { /** * Read a AcceptChannel from a byte array, created by AcceptChannel_write */ - public static Result_AcceptChannelDecodeErrorZ constructor_read(byte[] ser) { + 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; }