Work around our stupid hack with a stupid hack (see XXX in genbindings.py)
[ldk-java] / src / main / java / org / ldk / structs / InMemoryChannelKeys.java
index 01e2d48447994aecafe601b644b29231b0f827d0..fa9ad9d5de46b0c3db28cb1c36cbe580d8895f16 100644 (file)
@@ -14,12 +14,6 @@ public class InMemoryChannelKeys extends CommonBase {
                if (ptr != 0) { bindings.InMemoryChannelKeys_free(ptr); }
        }
 
-       public InMemoryChannelKeys clone() {
-               long ret = bindings.InMemoryChannelKeys_clone(this.ptr);
-               InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
-               return ret_hu_conv;
-       }
-
        public byte[] get_funding_key() {
                byte[] ret = bindings.InMemoryChannelKeys_get_funding_key(this.ptr);
                return ret;
@@ -74,15 +68,24 @@ public class InMemoryChannelKeys extends CommonBase {
                bindings.InMemoryChannelKeys_set_commitment_seed(this.ptr, val);
        }
 
+       public InMemoryChannelKeys clone() {
+               long ret = bindings.InMemoryChannelKeys_clone(this.ptr);
+               InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
        public static InMemoryChannelKeys constructor_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, TwoTuple<Long, Long> key_derivation_params) {
                long ret = bindings.InMemoryChannelKeys_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, bindings.C2Tuple_u64u64Z_new(key_derivation_params.a, key_derivation_params.b));
                InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
        public ChannelPublicKeys counterparty_pubkeys() {
                long ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr);
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
@@ -104,12 +107,14 @@ public class InMemoryChannelKeys extends CommonBase {
        public OutPoint funding_outpoint() {
                long ret = bindings.InMemoryChannelKeys_funding_outpoint(this.ptr);
                OutPoint ret_hu_conv = new OutPoint(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
        public ChannelTransactionParameters get_channel_parameters() {
                long ret = bindings.InMemoryChannelKeys_get_channel_parameters(this.ptr);
                ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }