X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FReplyChannelRange.java;h=4f6db16001a3436e2e9b30c1d41c76b7ba679938;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=b02a85876d852692f832988a636ba31ed0aab049;hpb=b0c50b891cbca28d3bd1d86276c132ff5221d8e4;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ReplyChannelRange.java b/src/main/java/org/ldk/structs/ReplyChannelRange.java index b02a8587..4f6db160 100644 --- a/src/main/java/org/ldk/structs/ReplyChannelRange.java +++ b/src/main/java/org/ldk/structs/ReplyChannelRange.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; /** @@ -96,7 +97,8 @@ public class ReplyChannelRange extends CommonBase { */ public static ReplyChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg) { long ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg); - ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -106,7 +108,8 @@ public class ReplyChannelRange extends CommonBase { */ public ReplyChannelRange clone() { long ret = bindings.ReplyChannelRange_clone(this.ptr); - ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -116,6 +119,7 @@ public class ReplyChannelRange extends CommonBase { */ public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) { long ret = bindings.ReplyChannelRange_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }