Merge pull request #47 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / ChannelManager.java
index 6f5e447ecef0482a84a5bb4860cebe280407a38b..e3ce61382a98ac6be58f9434692a44106dbe4105 100644 (file)
@@ -78,8 +78,6 @@ public class ChannelManager extends CommonBase {
                ret_hu_conv.ptrs_to.add(tx_broadcaster);
                ret_hu_conv.ptrs_to.add(logger);
                ret_hu_conv.ptrs_to.add(keys_manager);
-               ret_hu_conv.ptrs_to.add(config);
-               ret_hu_conv.ptrs_to.add(params);
                return ret_hu_conv;
        }
 
@@ -119,7 +117,6 @@ public class ChannelManager extends CommonBase {
                long ret = bindings.ChannelManager_create_channel(this.ptr, their_network_key, channel_value_satoshis, push_msat, user_id, override_config == null ? 0 : override_config.ptr & ~1);
                if (ret < 1024) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
-               this.ptrs_to.add(override_config);
                return ret_hu_conv;
        }
 
@@ -473,15 +470,12 @@ public class ChannelManager extends CommonBase {
         * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
         * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
         */
-       public TwoTuple<byte[], byte[]> create_inbound_payment(Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) {
+       public TwoTuple_PaymentHashPaymentSecretZ create_inbound_payment(Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) {
                long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
                if (ret < 1024) { return null; }
-               byte[] ret_a = bindings.LDKC2Tuple_PaymentHashPaymentSecretZ_get_a(ret);
-               byte[] ret_b = bindings.LDKC2Tuple_PaymentHashPaymentSecretZ_get_b(ret);
-               TwoTuple<byte[], byte[]> ret_conv = new TwoTuple<byte[], byte[]>(ret_a, ret_b, () -> {
-                       bindings.C2Tuple_PaymentHashPaymentSecretZ_free(ret);
-               });
-               return ret_conv;
+               TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
        }
 
        /**