Merge pull request #119 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / Confirm.java
index 485c486fb819d42705d0c773d14d3e9984cb211a..4ecf6a8c3e4132c627ce55e746a220310ec4084f 100644 (file)
@@ -68,7 +68,7 @@ public class Confirm extends CommonBase {
                 * in the event of a chain reorganization, it must not be called with a `header` that is no
                 * longer in the chain as of the last call to [`best_block_updated`].
                 * 
-                * [chain order]: Confirm#Order
+                * [chain order]: Confirm#order
                 * [`best_block_updated`]: Self::best_block_updated
                 */
                void transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height);
@@ -76,8 +76,8 @@ public class Confirm extends CommonBase {
                 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
                 * 
                 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
-                * reorganized out of the best chain. Once called, the given transaction should not be returned
-                * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
+                * reorganized out of the best chain. Once called, the given transaction will not be returned
+                * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
                 * 
                 * [`get_relevant_txids`]: Self::get_relevant_txids
                 * [`transactions_confirmed`]: Self::transactions_confirmed
@@ -93,9 +93,9 @@ public class Confirm extends CommonBase {
                /**
                 * Returns transactions that should be monitored for reorganization out of the chain.
                 * 
-                * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
-                * confirmations to be safe from a chain reorganization. Should not include any transactions
-                * passed to [`transaction_unconfirmed`] unless later reconfirmed.
+                * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
+                * confirmations to be safe from a chain reorganization. Will not include any transactions
+                * passed to [`transaction_unconfirmed`], unless later reconfirmed.
                 * 
                 * May be called to determine the subset of transactions that must still be monitored for
                 * reorganization. Will be idempotent between calls but may change as a result of calls to the
@@ -117,19 +117,23 @@ public class Confirm extends CommonBase {
                                for (int c = 0; c < txdata_conv_28_len; c++) {
                                        long txdata_conv_28 = txdata[c];
                                        TwoTuple_usizeTransactionZ txdata_conv_28_hu_conv = new TwoTuple_usizeTransactionZ(null, txdata_conv_28);
-                                       txdata_conv_28_hu_conv.ptrs_to.add(this);
+                                       if (txdata_conv_28_hu_conv != null) { txdata_conv_28_hu_conv.ptrs_to.add(this); };
                                        txdata_conv_28_arr[c] = txdata_conv_28_hu_conv;
                                }
                                arg.transactions_confirmed(header, txdata_conv_28_arr, height);
+                               Reference.reachabilityFence(arg);
                        }
                        @Override public void transaction_unconfirmed(byte[] txid) {
                                arg.transaction_unconfirmed(txid);
+                               Reference.reachabilityFence(arg);
                        }
                        @Override public void best_block_updated(byte[] header, int height) {
                                arg.best_block_updated(header, height);
+                               Reference.reachabilityFence(arg);
                        }
                        @Override public byte[][] get_relevant_txids() {
                                byte[][] ret = arg.get_relevant_txids();
+                               Reference.reachabilityFence(arg);
                                byte[][] result = ret != null ? Arrays.stream(ret).map(ret_conv_8 -> InternalUtils.check_arr_len(ret_conv_8, 32)).toArray(byte[][]::new) : null;
                                return result;
                        }
@@ -148,7 +152,7 @@ public class Confirm extends CommonBase {
         * in the event of a chain reorganization, it must not be called with a `header` that is no
         * longer in the chain as of the last call to [`best_block_updated`].
         * 
-        * [chain order]: Confirm#Order
+        * [chain order]: Confirm#order
         * [`best_block_updated`]: Self::best_block_updated
         */
        public void transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height) {
@@ -163,8 +167,8 @@ public class Confirm extends CommonBase {
         * Processes a transaction that is no longer confirmed as result of a chain reorganization.
         * 
         * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
-        * reorganized out of the best chain. Once called, the given transaction should not be returned
-        * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
+        * reorganized out of the best chain. Once called, the given transaction will not be returned
+        * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
         * 
         * [`get_relevant_txids`]: Self::get_relevant_txids
         * [`transactions_confirmed`]: Self::transactions_confirmed
@@ -191,9 +195,9 @@ public class Confirm extends CommonBase {
        /**
         * Returns transactions that should be monitored for reorganization out of the chain.
         * 
-        * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
-        * confirmations to be safe from a chain reorganization. Should not include any transactions
-        * passed to [`transaction_unconfirmed`] unless later reconfirmed.
+        * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
+        * confirmations to be safe from a chain reorganization. Will not include any transactions
+        * passed to [`transaction_unconfirmed`], unless later reconfirmed.
         * 
         * May be called to determine the subset of transactions that must still be monitored for
         * reorganization. Will be idempotent between calls but may change as a result of calls to the