Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Filter.java
index 092c65614100a5045588eb204eac935026cba488..e1dc712cca1aebca459a927599300c127aaeb3ab 100644 (file)
@@ -20,11 +20,10 @@ import java.util.Arrays;
  * 
  * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
  * should not block on I/O. Implementations should instead queue the newly monitored data to be
- * processed later. Then, in order to block until the data has been processed, any `Watch`
+ * processed later. Then, in order to block until the data has been processed, any [`Watch`]
  * invocation that has called the `Filter` must return [`TemporaryFailure`].
  * 
- * [`Watch`]: trait.Watch.html
- * [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure
+ * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
  * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
  * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
  */
@@ -49,10 +48,17 @@ public class Filter extends CommonBase {
                 */
                void register_tx(byte[] txid, byte[] script_pubkey);
                /**
-                * Registers interest in spends of a transaction output identified by `outpoint` having
-                * `script_pubkey` as the spending condition.
+                * Registers interest in spends of a transaction output.
+                * 
+                * Optionally, when `output.block_hash` is set, should return any transaction spending the
+                * output that is found in the corresponding block along with its index.
+                * 
+                * This return value is useful for Electrum clients in order to supply in-block descendant
+                * transactions which otherwise were not included. This is not necessary for other clients if
+                * such descendant transactions were already included (e.g., when a BIP 157 client provides the
+                * full block).
                 */
-               void register_output(OutPoint outpoint, byte[] script_pubkey);
+               Option_C2Tuple_usizeTransactionZZ register_output(WatchedOutput output);
        }
        private static class LDKFilterHolder { Filter held; }
        public static Filter new_impl(FilterInterface arg) {
@@ -61,9 +67,12 @@ public class Filter extends CommonBase {
                        @Override public void register_tx(byte[] txid, byte[] script_pubkey) {
                                arg.register_tx(txid, script_pubkey);
                        }
-                       @Override public void register_output(long outpoint, byte[] script_pubkey) {
-                               OutPoint outpoint_hu_conv = new OutPoint(null, outpoint);
-                               arg.register_output(outpoint_hu_conv, script_pubkey);
+                       @Override public long register_output(long output) {
+                               WatchedOutput output_hu_conv = new WatchedOutput(null, output);
+                               output_hu_conv.ptrs_to.add(this);
+                               Option_C2Tuple_usizeTransactionZZ ret = arg.register_output(output_hu_conv);
+                               long result = ret.ptr;
+                               return result;
                        }
                });
                return impl_holder.held;
@@ -77,12 +86,22 @@ public class Filter extends CommonBase {
        }
 
        /**
-        * Registers interest in spends of a transaction output identified by `outpoint` having
-        * `script_pubkey` as the spending condition.
+        * Registers interest in spends of a transaction output.
+        * 
+        * Optionally, when `output.block_hash` is set, should return any transaction spending the
+        * output that is found in the corresponding block along with its index.
+        * 
+        * This return value is useful for Electrum clients in order to supply in-block descendant
+        * transactions which otherwise were not included. This is not necessary for other clients if
+        * such descendant transactions were already included (e.g., when a BIP 157 client provides the
+        * full block).
         */
-       public void register_output(OutPoint outpoint, byte[] script_pubkey) {
-               bindings.Filter_register_output(this.ptr, outpoint == null ? 0 : outpoint.ptr & ~1, script_pubkey);
-               this.ptrs_to.add(outpoint);
+       public Option_C2Tuple_usizeTransactionZZ register_output(WatchedOutput output) {
+               long ret = bindings.Filter_register_output(this.ptr, output == null ? 0 : output.ptr & ~1);
+               Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(this);
+               this.ptrs_to.add(output);
+               return ret_hu_conv;
        }
 
 }