X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FWatchedOutput.java;h=2014286be97b0751c91150819184870f7be2d40b;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=bb38965aeee054295ebe7dbf69bb35ffd249a7e5;hpb=db1a11032b4164540a2d3403696be12bbca70e94;p=ldk-java diff --git a/src/main/java/org/ldk/structs/WatchedOutput.java b/src/main/java/org/ldk/structs/WatchedOutput.java index bb38965a..2014286b 100644 --- a/src/main/java/org/ldk/structs/WatchedOutput.java +++ b/src/main/java/org/ldk/structs/WatchedOutput.java @@ -54,8 +54,8 @@ public class WatchedOutput extends CommonBase { */ public OutPoint get_outpoint() { long ret = bindings.WatchedOutput_get_outpoint(this.ptr); - if (ret < 1024) { return null; } - OutPoint ret_hu_conv = new OutPoint(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -65,7 +65,6 @@ public class WatchedOutput extends CommonBase { */ public void set_outpoint(OutPoint val) { bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -88,10 +87,9 @@ public class WatchedOutput extends CommonBase { */ public static WatchedOutput of(byte[] block_hash_arg, OutPoint outpoint_arg, byte[] script_pubkey_arg) { long ret = bindings.WatchedOutput_new(block_hash_arg, outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg); - if (ret < 1024) { return null; } - WatchedOutput ret_hu_conv = new WatchedOutput(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WatchedOutput(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(outpoint_arg); return ret_hu_conv; } @@ -100,8 +98,8 @@ public class WatchedOutput extends CommonBase { */ public WatchedOutput clone() { long ret = bindings.WatchedOutput_clone(this.ptr); - if (ret < 1024) { return null; } - WatchedOutput ret_hu_conv = new WatchedOutput(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WatchedOutput(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; }