[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / WatchedOutput.java
index c39cab5c8782438d34f3fe7b82f4f79f1466b8cb..ba3a0745184bd26fef6719a9ab68c1a8a3b561b0 100644 (file)
@@ -13,7 +13,7 @@ import javax.annotation.Nullable;
  * 
  * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
  * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
- * the return value of [`Filter::register_output`].
+ * [`Confirm::transactions_confirmed`].
  * 
  * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
  * may have been spent there. See [`Filter::register_output`] for details.
@@ -61,7 +61,7 @@ public class WatchedOutput extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -72,7 +72,7 @@ public class WatchedOutput extends CommonBase {
                bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
-               this.ptrs_to.add(val);
+               if (this != null) { this.ptrs_to.add(val); };
        }
 
        /**
@@ -103,8 +103,8 @@ public class WatchedOutput extends CommonBase {
                Reference.reachabilityFence(script_pubkey_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WatchedOutput(null, ret); }
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
-               ret_hu_conv.ptrs_to.add(outpoint_arg);
+               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(outpoint_arg); };
                return ret_hu_conv;
        }
 
@@ -122,10 +122,27 @@ public class WatchedOutput extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WatchedOutput(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if two WatchedOutputs contain equal inner contents.
+        * This ignores pointers and is_owned flags and looks at the values in fields.
+        * Two objects with NULL inner values will be considered "equal" here.
+        */
+       public boolean eq(WatchedOutput b) {
+               boolean ret = bindings.WatchedOutput_eq(this.ptr, b == null ? 0 : b.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(b);
+               if (this != null) { this.ptrs_to.add(b); };
+               return ret;
+       }
+
+       @Override public boolean equals(Object o) {
+               if (!(o instanceof WatchedOutput)) return false;
+               return this.eq((WatchedOutput)o);
+       }
        /**
         * Checks if two WatchedOutputs contain equal inner contents.
         */