Fix returning traits in trait calls, move towards clone on return
[ldk-java] / src / main / jni / bindings.c
index a4119f78f4027d05f5a7320217fd9fe4a50c1591..93ad2e57aae3c48107f54cc73ba52fb6a7df89b4 100644 (file)
@@ -88,13 +88,14 @@ void* __wrap_calloc(size_t nmemb, size_t len) {
        return res;
 }
 void __wrap_free(void* ptr) {
+       if (ptr == NULL) return;
        alloc_freed(ptr);
        __real_free(ptr);
 }
 
 void* __real_realloc(void* ptr, size_t newlen);
 void* __wrap_realloc(void* ptr, size_t len) {
-       alloc_freed(ptr);
+       if (ptr != NULL) alloc_freed(ptr);
        void* res = __real_realloc(ptr, len);
        new_allocation(res, "realloc call");
        return res;
@@ -470,23 +471,27 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1new(JNIEnv
        }
        return (long)ret;
 }
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1usize_1_1Transaction_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) {
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1usize_1_1Transaction_1new(JNIEnv *_env, jclass _b, jlong a, jbyteArray b) {
        LDKC2TupleTempl_usize__Transaction* ret = MALLOC(sizeof(LDKC2TupleTempl_usize__Transaction), "LDKC2TupleTempl_usize__Transaction");
        ret->a = a;
-       LDKTransaction b_conv = *(LDKTransaction*)b;
-       ret->b = b_conv;
+       LDKTransaction b_ref;
+       b_ref.datalen = (*_env)->GetArrayLength (_env, b);
+       b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data);
+       b_ref.data_is_owned = false;
+       ret->b = b_ref;
        return (long)ret;
 }
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) {
        LDKC2TupleTempl_usize__Transaction *tuple = (LDKC2TupleTempl_usize__Transaction*)ptr;
        return tuple->a;
 }
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) {
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) {
        LDKC2TupleTempl_usize__Transaction *tuple = (LDKC2TupleTempl_usize__Transaction*)ptr;
-       LDKTransaction *b_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-       *b_copy = tuple->b;
-       long b_ref = (long)b_copy;
-       return b_ref;
+       LDKTransaction b_var = tuple->b;
+       jbyteArray b_arr = (*_env)->NewByteArray(_env, b_var.datalen);
+       (*_env)->SetByteArrayRegion(_env, b_arr, 0, b_var.datalen, b_var.data);
+       return b_arr;
 }
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
        return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok;
@@ -528,10 +533,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1OutPoint_1_1
                a_conv = OutPoint_clone(&a_conv);
        ret->a = a_conv;
        LDKCVec_u8Z b_ref;
-       b_ref.data = (*_env)->GetByteArrayElements (_env, b, NULL);
        b_ref.datalen = (*_env)->GetArrayLength (_env, b);
+       b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data);
        ret->b = b_ref;
-       //TODO: Really need to call (*_env)->ReleaseByteArrayElements(_env, b, (int8_t*)b_ref.data, 0); here
        return (long)ret;
 }
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) {
@@ -1886,13 +1891,19 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_j
        LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
-       LDKTransaction *commitment_tx_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-       *commitment_tx_copy = commitment_tx;
-       long commitment_tx_ref = (long)commitment_tx_copy;
+       LDKTransaction commitment_tx_var = commitment_tx;
+       jbyteArray commitment_tx_arr = (*_env)->NewByteArray(_env, commitment_tx_var.datalen);
+       (*_env)->SetByteArrayRegion(_env, commitment_tx_arr, 0, commitment_tx_var.datalen, commitment_tx_var.data);
+       Transaction_free(commitment_tx_var);
        LDKPreCalculatedTxCreationKeys keys_var = *keys;
+       if (keys->inner != NULL)
+               keys_var = PreCalculatedTxCreationKeys_clone(keys);
        CHECK((((long)keys_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&keys_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long keys_ref = (long)keys_var.inner & ~1;
+       long keys_ref = (long)keys_var.inner;
+       if (keys_var.is_owned) {
+               keys_ref |= 1;
+       }
        LDKCVec_HTLCOutputInCommitmentZ htlcs_var = htlcs;
        jlongArray htlcs_arr = (*_env)->NewLongArray(_env, htlcs_var.datalen);
        jlong *htlcs_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, htlcs_arr, NULL);
@@ -1910,7 +1921,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_j
        FREE(htlcs_var.data);
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
-       LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_counterparty_commitment_meth, feerate_per_kw, commitment_tx_ref, keys_ref, htlcs_arr);
+       LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_counterparty_commitment_meth, feerate_per_kw, commitment_tx_arr, keys_ref, htlcs_arr);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret;
        FREE((void*)ret);
        return ret_conv;
@@ -1920,9 +1931,14 @@ LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, con
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
        LDKHolderCommitmentTransaction holder_commitment_tx_var = *holder_commitment_tx;
+       if (holder_commitment_tx->inner != NULL)
+               holder_commitment_tx_var = HolderCommitmentTransaction_clone(holder_commitment_tx);
        CHECK((((long)holder_commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&holder_commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long holder_commitment_tx_ref = (long)holder_commitment_tx_var.inner & ~1;
+       long holder_commitment_tx_ref = (long)holder_commitment_tx_var.inner;
+       if (holder_commitment_tx_var.is_owned) {
+               holder_commitment_tx_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_holder_commitment_meth, holder_commitment_tx_ref);
@@ -1935,9 +1951,14 @@ LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(c
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
        LDKHolderCommitmentTransaction holder_commitment_tx_var = *holder_commitment_tx;
+       if (holder_commitment_tx->inner != NULL)
+               holder_commitment_tx_var = HolderCommitmentTransaction_clone(holder_commitment_tx);
        CHECK((((long)holder_commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&holder_commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long holder_commitment_tx_ref = (long)holder_commitment_tx_var.inner & ~1;
+       long holder_commitment_tx_ref = (long)holder_commitment_tx_var.inner;
+       if (holder_commitment_tx_var.is_owned) {
+               holder_commitment_tx_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_holder_commitment_htlc_transactions_meth, holder_commitment_tx_ref);
@@ -1949,18 +1970,24 @@ LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, L
        LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
-       LDKTransaction *justice_tx_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-       *justice_tx_copy = justice_tx;
-       long justice_tx_ref = (long)justice_tx_copy;
+       LDKTransaction justice_tx_var = justice_tx;
+       jbyteArray justice_tx_arr = (*_env)->NewByteArray(_env, justice_tx_var.datalen);
+       (*_env)->SetByteArrayRegion(_env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
+       Transaction_free(justice_tx_var);
        jbyteArray per_commitment_key_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, per_commitment_key_arr, 0, 32, *per_commitment_key);
        LDKHTLCOutputInCommitment htlc_var = *htlc;
+       if (htlc->inner != NULL)
+               htlc_var = HTLCOutputInCommitment_clone(htlc);
        CHECK((((long)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long htlc_ref = (long)htlc_var.inner & ~1;
+       long htlc_ref = (long)htlc_var.inner;
+       if (htlc_var.is_owned) {
+               htlc_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
-       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_justice_transaction_meth, justice_tx_ref, input, amount, per_commitment_key_arr, htlc_ref);
+       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_justice_transaction_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret;
        FREE((void*)ret);
        return ret_conv;
@@ -1969,18 +1996,24 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* t
        LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
-       LDKTransaction *htlc_tx_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-       *htlc_tx_copy = htlc_tx;
-       long htlc_tx_ref = (long)htlc_tx_copy;
+       LDKTransaction htlc_tx_var = htlc_tx;
+       jbyteArray htlc_tx_arr = (*_env)->NewByteArray(_env, htlc_tx_var.datalen);
+       (*_env)->SetByteArrayRegion(_env, htlc_tx_arr, 0, htlc_tx_var.datalen, htlc_tx_var.data);
+       Transaction_free(htlc_tx_var);
        jbyteArray per_commitment_point_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form);
        LDKHTLCOutputInCommitment htlc_var = *htlc;
+       if (htlc->inner != NULL)
+               htlc_var = HTLCOutputInCommitment_clone(htlc);
        CHECK((((long)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long htlc_ref = (long)htlc_var.inner & ~1;
+       long htlc_ref = (long)htlc_var.inner;
+       if (htlc_var.is_owned) {
+               htlc_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
-       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_ref, input, amount, per_commitment_point_arr, htlc_ref);
+       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret;
        FREE((void*)ret);
        return ret_conv;
@@ -1989,12 +2022,13 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, L
        LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
-       LDKTransaction *closing_tx_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-       *closing_tx_copy = closing_tx;
-       long closing_tx_ref = (long)closing_tx_copy;
+       LDKTransaction closing_tx_var = closing_tx;
+       jbyteArray closing_tx_arr = (*_env)->NewByteArray(_env, closing_tx_var.datalen);
+       (*_env)->SetByteArrayRegion(_env, closing_tx_arr, 0, closing_tx_var.datalen, closing_tx_var.data);
+       Transaction_free(closing_tx_var);
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
-       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_closing_transaction_meth, closing_tx_ref);
+       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_closing_transaction_meth, closing_tx_arr);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret;
        FREE((void*)ret);
        return ret_conv;
@@ -2004,9 +2038,14 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg,
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
        LDKUnsignedChannelAnnouncement msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = UnsignedChannelAnnouncement_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_channel_announcement_meth, msg_ref);
@@ -2019,9 +2058,14 @@ void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points,
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
        LDKChannelPublicKeys channel_points_var = *channel_points;
+       if (channel_points->inner != NULL)
+               channel_points_var = ChannelPublicKeys_clone(channel_points);
        CHECK((((long)channel_points_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&channel_points_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long channel_points_ref = (long)channel_points_var.inner & ~1;
+       long channel_points_ref = (long)channel_points_var.inner;
+       if (channel_points_var.is_owned) {
+               channel_points_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->on_accept_meth, channel_points_ref, counterparty_selected_contest_delay, holder_selected_contest_delay);
@@ -2053,17 +2097,17 @@ static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobje
        CHECK(calls->release_commitment_secret_meth != NULL);
        calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
        CHECK(calls->key_derivation_params_meth != NULL);
-       calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(IJJ[J)J");
+       calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(I[BJ[J)J");
        CHECK(calls->sign_counterparty_commitment_meth != NULL);
        calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J");
        CHECK(calls->sign_holder_commitment_meth != NULL);
        calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J");
        CHECK(calls->sign_holder_commitment_htlc_transactions_meth != NULL);
-       calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
+       calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "([BJJ[BJ)J");
        CHECK(calls->sign_justice_transaction_meth != NULL);
-       calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "(JJJ[BJ)J");
+       calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "([BJJ[BJ)J");
        CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL);
-       calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
+       calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "([B)J");
        CHECK(calls->sign_closing_transaction_meth != NULL);
        calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
        CHECK(calls->sign_channel_announcement_meth != NULL);
@@ -2127,12 +2171,16 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1key_1derivation_
        return (long)ret_ref;
 }
 
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1commitment(JNIEnv * _env, jclass _b, jlong this_arg, jint feerate_per_kw, jlong commitment_tx, jlong keys, jlongArray htlcs) {
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1commitment(JNIEnv * _env, jclass _b, jlong this_arg, jint feerate_per_kw, jbyteArray commitment_tx, jlong keys, jlongArray htlcs) {
        LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
-       LDKTransaction commitment_tx_conv = *(LDKTransaction*)commitment_tx;
+       LDKTransaction commitment_tx_ref;
+       commitment_tx_ref.datalen = (*_env)->GetArrayLength (_env, commitment_tx);
+       commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, commitment_tx, 0, commitment_tx_ref.datalen, commitment_tx_ref.data);
+       commitment_tx_ref.data_is_owned = true;
        LDKPreCalculatedTxCreationKeys keys_conv;
        keys_conv.inner = (void*)(keys & (~1));
-       keys_conv.is_owned = (keys & 1) || (keys == 0);
+       keys_conv.is_owned = false;
        LDKCVec_HTLCOutputInCommitmentZ htlcs_constr;
        htlcs_constr.datalen = (*_env)->GetArrayLength (_env, htlcs);
        if (htlcs_constr.datalen > 0)
@@ -2151,7 +2199,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterpar
        }
        (*_env)->ReleaseLongArrayElements (_env, htlcs, htlcs_vals, 0);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
-       *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, feerate_per_kw, commitment_tx_conv, &keys_conv, htlcs_constr);
+       *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, feerate_per_kw, commitment_tx_ref, &keys_conv, htlcs_constr);
        return (long)ret_conv;
 }
 
@@ -2159,7 +2207,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1co
        LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
        LDKHolderCommitmentTransaction holder_commitment_tx_conv;
        holder_commitment_tx_conv.inner = (void*)(holder_commitment_tx & (~1));
-       holder_commitment_tx_conv.is_owned = (holder_commitment_tx & 1) || (holder_commitment_tx == 0);
+       holder_commitment_tx_conv.is_owned = false;
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
        *ret_conv = (this_arg_conv->sign_holder_commitment)(this_arg_conv->this_arg, &holder_commitment_tx_conv);
        return (long)ret_conv;
@@ -2169,46 +2217,58 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1co
        LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
        LDKHolderCommitmentTransaction holder_commitment_tx_conv;
        holder_commitment_tx_conv.inner = (void*)(holder_commitment_tx & (~1));
-       holder_commitment_tx_conv.is_owned = (holder_commitment_tx & 1) || (holder_commitment_tx == 0);
+       holder_commitment_tx_conv.is_owned = false;
        LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
        *ret_conv = (this_arg_conv->sign_holder_commitment_htlc_transactions)(this_arg_conv->this_arg, &holder_commitment_tx_conv);
        return (long)ret_conv;
 }
 
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jlong justice_tx, jlong input, jlong amount, jbyteArray per_commitment_key, jlong htlc) {
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray justice_tx, jlong input, jlong amount, jbyteArray per_commitment_key, jlong htlc) {
        LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
-       LDKTransaction justice_tx_conv = *(LDKTransaction*)justice_tx;
+       LDKTransaction justice_tx_ref;
+       justice_tx_ref.datalen = (*_env)->GetArrayLength (_env, justice_tx);
+       justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
+       justice_tx_ref.data_is_owned = true;
        unsigned char per_commitment_key_arr[32];
        CHECK((*_env)->GetArrayLength (_env, per_commitment_key) == 32);
        (*_env)->GetByteArrayRegion (_env, per_commitment_key, 0, 32, per_commitment_key_arr);
        unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
        LDKHTLCOutputInCommitment htlc_conv;
        htlc_conv.inner = (void*)(htlc & (~1));
-       htlc_conv.is_owned = (htlc & 1) || (htlc == 0);
+       htlc_conv.is_owned = false;
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
-       *ret_conv = (this_arg_conv->sign_justice_transaction)(this_arg_conv->this_arg, justice_tx_conv, input, amount, per_commitment_key_ref, &htlc_conv);
+       *ret_conv = (this_arg_conv->sign_justice_transaction)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv);
        return (long)ret_conv;
 }
 
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1htlc_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jlong htlc_tx, jlong input, jlong amount, jbyteArray per_commitment_point, jlong htlc) {
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1htlc_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_tx, jlong input, jlong amount, jbyteArray per_commitment_point, jlong htlc) {
        LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
-       LDKTransaction htlc_tx_conv = *(LDKTransaction*)htlc_tx;
+       LDKTransaction htlc_tx_ref;
+       htlc_tx_ref.datalen = (*_env)->GetArrayLength (_env, htlc_tx);
+       htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, htlc_tx, 0, htlc_tx_ref.datalen, htlc_tx_ref.data);
+       htlc_tx_ref.data_is_owned = true;
        LDKPublicKey per_commitment_point_ref;
        CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33);
        (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
        LDKHTLCOutputInCommitment htlc_conv;
        htlc_conv.inner = (void*)(htlc & (~1));
-       htlc_conv.is_owned = (htlc & 1) || (htlc == 0);
+       htlc_conv.is_owned = false;
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
-       *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_conv, input, amount, per_commitment_point_ref, &htlc_conv);
+       *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv);
        return (long)ret_conv;
 }
 
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1closing_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jlong closing_tx) {
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1closing_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray closing_tx) {
        LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
-       LDKTransaction closing_tx_conv = *(LDKTransaction*)closing_tx;
+       LDKTransaction closing_tx_ref;
+       closing_tx_ref.datalen = (*_env)->GetArrayLength (_env, closing_tx);
+       closing_tx_ref.data = MALLOC(closing_tx_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, closing_tx, 0, closing_tx_ref.datalen, closing_tx_ref.data);
+       closing_tx_ref.data_is_owned = true;
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
-       *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, closing_tx_conv);
+       *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, closing_tx_ref);
        return (long)ret_conv;
 }
 
@@ -2216,7 +2276,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1channel_1a
        LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
        LDKUnsignedChannelAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
        *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
        return (long)ret_conv;
@@ -2226,7 +2286,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1on_1accept(JNIEnv
        LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
        LDKChannelPublicKeys channel_points_conv;
        channel_points_conv.inner = (void*)(channel_points & (~1));
-       channel_points_conv.is_owned = (channel_points & 1) || (channel_points == 0);
+       channel_points_conv.is_owned = false;
        (this_arg_conv->on_accept)(this_arg_conv->this_arg, &channel_points_conv, counterparty_selected_contest_delay, holder_selected_contest_delay);
 }
 
@@ -2488,9 +2548,14 @@ void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LD
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
        LDKOutPoint outpoint_var = *outpoint;
+       if (outpoint->inner != NULL)
+               outpoint_var = OutPoint_clone(outpoint);
        CHECK((((long)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long outpoint_ref = (long)outpoint_var.inner & ~1;
+       long outpoint_ref = (long)outpoint_var.inner;
+       if (outpoint_var.is_owned) {
+               outpoint_ref |= 1;
+       }
        LDKu8slice script_pubkey_var = script_pubkey;
        jbyteArray script_pubkey_arr = (*_env)->NewByteArray(_env, script_pubkey_var.datalen);
        (*_env)->SetByteArrayRegion(_env, script_pubkey_arr, 0, script_pubkey_var.datalen, script_pubkey_var.data);
@@ -2549,8 +2614,8 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx(JNIEnv *
        (*_env)->GetByteArrayRegion (_env, txid, 0, 32, txid_arr);
        unsigned char (*txid_ref)[32] = &txid_arr;
        LDKu8slice script_pubkey_ref;
-       script_pubkey_ref.data = (*_env)->GetByteArrayElements (_env, script_pubkey, NULL);
        script_pubkey_ref.datalen = (*_env)->GetArrayLength (_env, script_pubkey);
+       script_pubkey_ref.data = (*_env)->GetByteArrayElements (_env, script_pubkey, NULL);
        (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
        (*_env)->ReleaseByteArrayElements(_env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0);
 }
@@ -2559,10 +2624,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEn
        LDKFilter* this_arg_conv = (LDKFilter*)this_arg;
        LDKOutPoint outpoint_conv;
        outpoint_conv.inner = (void*)(outpoint & (~1));
-       outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
+       outpoint_conv.is_owned = false;
        LDKu8slice script_pubkey_ref;
-       script_pubkey_ref.data = (*_env)->GetByteArrayElements (_env, script_pubkey, NULL);
        script_pubkey_ref.datalen = (*_env)->GetArrayLength (_env, script_pubkey);
+       script_pubkey_ref.data = (*_env)->GetByteArrayElements (_env, script_pubkey, NULL);
        (this_arg_conv->register_output)(this_arg_conv->this_arg, &outpoint_conv, script_pubkey_ref);
        (*_env)->ReleaseByteArrayElements(_env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0);
 }
@@ -2577,12 +2642,13 @@ void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
        LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
-       LDKTransaction *tx_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-       *tx_copy = tx;
-       long tx_ref = (long)tx_copy;
+       LDKTransaction tx_var = tx;
+       jbyteArray tx_arr = (*_env)->NewByteArray(_env, tx_var.datalen);
+       (*_env)->SetByteArrayRegion(_env, tx_arr, 0, tx_var.datalen, tx_var.data);
+       Transaction_free(tx_var);
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
-       return (*_env)->CallVoidMethod(_env, obj, j_calls->broadcast_transaction_meth, tx_ref);
+       return (*_env)->CallVoidMethod(_env, obj, j_calls->broadcast_transaction_meth, tx_arr);
 }
 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
        LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
@@ -2605,7 +2671,7 @@ static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env
        atomic_init(&calls->refcnt, 1);
        DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
        calls->o = (*env)->NewWeakGlobalRef(env, o);
-       calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
+       calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "([B)V");
        CHECK(calls->broadcast_transaction_meth != NULL);
 
        LDKBroadcasterInterface ret = {
@@ -2625,10 +2691,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1ge
        CHECK(ret != NULL);
        return ret;
 }
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jlong tx) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray tx) {
        LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg;
-       LDKTransaction tx_conv = *(LDKTransaction*)tx;
-       (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_conv);
+       LDKTransaction tx_ref;
+       tx_ref.datalen = (*_env)->GetArrayLength (_env, tx);
+       tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, tx, 0, tx_ref.datalen, tx_ref.data);
+       tx_ref.data_is_owned = true;
+       (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
 }
 
 typedef struct LDKFeeEstimator_JCalls {
@@ -2720,23 +2790,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1
        LDKCVecTempl_Transaction *vec = (LDKCVecTempl_Transaction*)ptr;
        return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTransaction));
 }
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1new(JNIEnv *env, jclass _b, jlongArray elems){
-       LDKCVecTempl_Transaction *ret = MALLOC(sizeof(LDKCVecTempl_Transaction), "LDKCVecTempl_Transaction");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKTransaction) * ret->datalen, "LDKCVecTempl_Transaction Data");
-               jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       jlong arr_elem = java_elems[i];
-                       LDKTransaction arr_elem_conv = *(LDKTransaction*)arr_elem;
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (long)ret;
-}
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
        LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *vec = (LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)ptr;
        return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut));
@@ -2789,8 +2842,9 @@ LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
        CHECK(obj != NULL);
        jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_destination_script_meth);
        LDKCVec_u8Z arg_ref;
-       arg_ref.data = (*_env)->GetByteArrayElements (_env, arg, NULL);
        arg_ref.datalen = (*_env)->GetArrayLength (_env, arg);
+       arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data);
        return arg_ref;
 }
 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
@@ -2813,10 +2867,7 @@ LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64
        CHECK(obj != NULL);
        LDKChannelKeys* ret = (LDKChannelKeys*)(*_env)->CallLongMethod(_env, obj, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
        LDKChannelKeys ret_conv = *(LDKChannelKeys*)ret;
-       if (ret_conv.free == LDKChannelKeys_JCalls_free) {
-               // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKChannelKeys_JCalls_clone(ret_conv.this_arg);
-       }
+       ret_conv = ChannelKeys_clone(ret);
        return ret_conv;
 }
 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
@@ -3070,9 +3121,14 @@ void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id,
                their_features_ref |= 1;
        }
        LDKOpenChannel msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = OpenChannel_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
@@ -3091,9 +3147,14 @@ void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_i
                their_features_ref |= 1;
        }
        LDKAcceptChannel msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = AcceptChannel_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
@@ -3105,9 +3166,14 @@ void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKFundingCreated msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = FundingCreated_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
@@ -3119,9 +3185,14 @@ void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_i
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKFundingSigned msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = FundingSigned_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
@@ -3133,9 +3204,14 @@ void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_i
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKFundingLocked msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = FundingLocked_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref);
@@ -3147,9 +3223,14 @@ void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, con
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKShutdown msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = Shutdown_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, msg_ref);
@@ -3161,9 +3242,14 @@ void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_i
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKClosingSigned msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = ClosingSigned_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
@@ -3175,9 +3261,14 @@ void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKUpdateAddHTLC msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = UpdateAddHTLC_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
@@ -3189,9 +3280,14 @@ void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_n
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKUpdateFulfillHTLC msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = UpdateFulfillHTLC_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
@@ -3203,9 +3299,14 @@ void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKUpdateFailHTLC msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = UpdateFailHTLC_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
@@ -3217,9 +3318,14 @@ void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKUpdateFailMalformedHTLC msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = UpdateFailMalformedHTLC_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
@@ -3231,9 +3337,14 @@ void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_nod
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKCommitmentSigned msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = CommitmentSigned_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
@@ -3245,9 +3356,14 @@ void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_i
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKRevokeAndACK msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = RevokeAndACK_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
@@ -3259,9 +3375,14 @@ void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, c
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKUpdateFee msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = UpdateFee_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
@@ -3273,9 +3394,14 @@ void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey the
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKAnnouncementSignatures msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = AnnouncementSignatures_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
@@ -3297,9 +3423,14 @@ void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, cons
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKInit msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = Init_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
@@ -3311,9 +3442,14 @@ void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_n
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKChannelReestablish msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = ChannelReestablish_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
@@ -3325,9 +3461,14 @@ void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const
        jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
        LDKErrorMessage msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = ErrorMessage_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref);
@@ -3441,7 +3582,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        // Warning: we may need a move here but can't clone!
        LDKOpenChannel msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
 }
 
@@ -3456,7 +3597,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        // Warning: we may need a move here but can't clone!
        LDKAcceptChannel msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
 }
 
@@ -3467,7 +3608,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKFundingCreated msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3478,7 +3619,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKFundingSigned msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3489,7 +3630,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKFundingLocked msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3500,7 +3641,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKShutdown msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3511,7 +3652,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKClosingSigned msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3522,7 +3663,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKUpdateAddHTLC msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3533,7 +3674,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKUpdateFulfillHTLC msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3544,7 +3685,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKUpdateFailHTLC msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3555,7 +3696,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKUpdateFailMalformedHTLC msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3566,7 +3707,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKCommitmentSigned msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3577,7 +3718,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKRevokeAndACK msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3588,7 +3729,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKUpdateFee msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3599,7 +3740,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKAnnouncementSignatures msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3618,7 +3759,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1c
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKInit msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3629,7 +3770,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKChannelReestablish msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3640,7 +3781,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
        LDKErrorMessage msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -3910,9 +4051,14 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_a
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
        LDKNodeAnnouncement msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = NodeAnnouncement_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_node_announcement_meth, msg_ref);
@@ -3925,9 +4071,14 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* thi
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
        LDKChannelAnnouncement msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = ChannelAnnouncement_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_channel_announcement_meth, msg_ref);
@@ -3940,9 +4091,14 @@ LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg,
        JNIEnv *_env;
        DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK);
        LDKChannelUpdate msg_var = *msg;
+       if (msg->inner != NULL)
+               msg_var = ChannelUpdate_clone(msg);
        CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       long msg_ref = (long)msg_var.inner & ~1;
+       long msg_ref = (long)msg_var.inner;
+       if (msg_var.is_owned) {
+               msg_ref |= 1;
+       }
        jobject obj = (*_env)->NewLocalRef(_env, j_calls->o);
        CHECK(obj != NULL);
        LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_channel_update_meth, msg_ref);
@@ -4083,7 +4239,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle
        LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg;
        LDKNodeAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
        return (long)ret_conv;
@@ -4093,7 +4249,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle
        LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg;
        LDKChannelAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
        return (long)ret_conv;
@@ -4103,7 +4259,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle
        LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg;
        LDKChannelUpdate msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
-       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv.is_owned = false;
        LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
        return (long)ret_conv;
@@ -4260,8 +4416,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1o
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray data, jboolean resume_read) {
        LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg;
        LDKu8slice data_ref;
-       data_ref.data = (*_env)->GetByteArrayElements (_env, data, NULL);
        data_ref.datalen = (*_env)->GetArrayLength (_env, data);
+       data_ref.data = (*_env)->GetByteArrayElements (_env, data, NULL);
        jlong ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
        (*_env)->ReleaseByteArrayElements(_env, data, (int8_t*)data_ref.data, 0);
        return ret_val;
@@ -4577,11 +4733,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleEr
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jbyteArray arg) {
        LDKCVec_u8Z arg_ref;
-       arg_ref.data = (*_env)->GetByteArrayElements (_env, arg, NULL);
        arg_ref.datalen = (*_env)->GetArrayLength (_env, arg);
+       arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data);
        LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
        *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_ref);
-       (*_env)->ReleaseByteArrayElements(_env, arg, (int8_t*)arg_ref.data, 0);
        return (long)ret_conv;
 }
 
@@ -4866,11 +5022,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactio
        else
                arg_constr.data = NULL;
        long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL);
-       for (size_t d = 0; d < arg_constr.datalen; d++) {
-               long arr_conv_29 = arg_vals[d];
-               LDKC2Tuple_usizeTransactionZ arr_conv_29_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_29;
-               FREE((void*)arr_conv_29);
-               arg_constr.data[d] = arr_conv_29_conv;
+       for (size_t y = 0; y < arg_constr.datalen; y++) {
+               long arr_conv_24 = arg_vals[y];
+               LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24;
+               FREE((void*)arr_conv_24);
+               arg_constr.data[y] = arr_conv_24_conv;
        }
        (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0);
        CVec_C2Tuple_usizeTransactionZZ_free(arg_constr);
@@ -5162,20 +5318,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescripto
        CVec_SpendableOutputDescriptorZ_free(arg_constr);
 }
 
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jobjectArray arg) {
        LDKCVec_TransactionZ arg_constr;
        arg_constr.datalen = (*_env)->GetArrayLength (_env, arg);
        if (arg_constr.datalen > 0)
                arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
        else
                arg_constr.data = NULL;
-       long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL);
-       for (size_t n = 0; n < arg_constr.datalen; n++) {
-               long arr_conv_13 = arg_vals[n];
-               LDKTransaction arr_conv_13_conv = *(LDKTransaction*)arr_conv_13;
-               arg_constr.data[n] = arr_conv_13_conv;
+       for (size_t i = 0; i < arg_constr.datalen; i++) {
+               jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, arg, i);
+               LDKTransaction arr_conv_8_ref;
+               arr_conv_8_ref.datalen = (*_env)->GetArrayLength (_env, arr_conv_8);
+               arr_conv_8_ref.data = MALLOC(arr_conv_8_ref.datalen, "LDKTransaction Bytes");
+               (*_env)->GetByteArrayRegion(_env, arr_conv_8, 0, arr_conv_8_ref.datalen, arr_conv_8_ref.data);
+               arr_conv_8_ref.data_is_owned = true;
+               arg_constr.data[i] = arr_conv_8_ref;
        }
-       (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0);
        CVec_TransactionZ_free(arg_constr);
 }
 
@@ -5291,15 +5449,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env
 
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jbyteArray arg) {
        LDKCVec_u8Z arg_ref;
-       arg_ref.data = (*_env)->GetByteArrayElements (_env, arg, NULL);
        arg_ref.datalen = (*_env)->GetArrayLength (_env, arg);
+       arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data);
        CVec_u8Z_free(arg_ref);
-       (*_env)->ReleaseByteArrayElements(_env, arg, (int8_t*)arg_ref.data, 0);
 }
 
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
-       LDKTransaction _res_conv = *(LDKTransaction*)_res;
-       Transaction_free(_res_conv);
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jbyteArray _res) {
+       LDKTransaction _res_ref;
+       _res_ref.datalen = (*_env)->GetArrayLength (_env, _res);
+       _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, _res, 0, _res_ref.datalen, _res_ref.data);
+       _res_ref.data_is_owned = true;
+       Transaction_free(_res_ref);
 }
 
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
@@ -5308,10 +5470,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jcl
        TxOut_free(_res_conv);
 }
 
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
-       LDKTransaction b_conv = *(LDKTransaction*)b;
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jbyteArray b) {
+       LDKTransaction b_ref;
+       b_ref.datalen = (*_env)->GetArrayLength (_env, b);
+       b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data);
+       b_ref.data_is_owned = true;
        LDKC2Tuple_usizeTransactionZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
-       *ret_ref = C2Tuple_usizeTransactionZ_new(a, b_conv);
+       *ret_ref = C2Tuple_usizeTransactionZ_new(a, b_ref);
        return (long)ret_ref;
 }
 
@@ -5334,11 +5500,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new
        if (a_conv.inner != NULL)
                a_conv = OutPoint_clone(&a_conv);
        LDKCVec_u8Z b_ref;
-       b_ref.data = (*_env)->GetByteArrayElements (_env, b, NULL);
        b_ref.datalen = (*_env)->GetArrayLength (_env, b);
+       b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data);
        LDKC2Tuple_OutPointScriptZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
        *ret_ref = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
-       (*_env)->ReleaseByteArrayElements(_env, b, (int8_t*)b_ref.data, 0);
        return (long)ret_ref;
 }
 
@@ -5545,7 +5711,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(J
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelHandshakeConfig orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -5559,7 +5725,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
        return ret_val;
 }
@@ -5567,14 +5733,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1m
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -5582,14 +5748,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -5597,7 +5763,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
@@ -5633,7 +5799,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(J
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelHandshakeLimits orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -5647,7 +5813,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -5655,14 +5821,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -5670,14 +5836,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -5685,14 +5851,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -5700,14 +5866,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
        return ret_val;
 }
@@ -5715,14 +5881,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelHandshakeLimits_get_min_dust_limit_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -5730,14 +5896,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_min_dust_limit_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelHandshakeLimits_get_max_dust_limit_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -5745,14 +5911,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_max_dust_limit_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
        return ret_val;
 }
@@ -5760,14 +5926,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1m
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
 }
 
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
        return ret_val;
 }
@@ -5775,14 +5941,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1ge
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -5790,7 +5956,7 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
 }
 
@@ -5826,7 +5992,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelConfig orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -5840,7 +6006,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = ChannelConfig_get_fee_proportional_millionths(&this_ptr_conv);
        return ret_val;
 }
@@ -5848,14 +6014,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1propo
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelConfig_set_fee_proportional_millionths(&this_ptr_conv, val);
 }
 
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = ChannelConfig_get_announced_channel(&this_ptr_conv);
        return ret_val;
 }
@@ -5863,14 +6029,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announ
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelConfig_set_announced_channel(&this_ptr_conv, val);
 }
 
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
        return ret_val;
 }
@@ -5878,7 +6044,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
 }
 
@@ -5907,7 +6073,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKChannelConfig obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ChannelConfig_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -5917,8 +6083,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNI
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKChannelConfig ret_var = ChannelConfig_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -5940,7 +6106,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUserConfig orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -5954,7 +6120,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv * _e
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -5968,7 +6134,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelHandshakeConfig val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -5980,7 +6146,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -5994,7 +6160,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channe
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelHandshakeLimits val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -6006,7 +6172,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6020,7 +6186,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1opt
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelConfig val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -6118,7 +6284,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _e
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlongArray txdata, jint height) {
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char header_arr[80];
        CHECK((*_env)->GetArrayLength (_env, header) == 80);
        (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
@@ -6130,11 +6296,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected
        else
                txdata_constr.data = NULL;
        long* txdata_vals = (*_env)->GetLongArrayElements (_env, txdata, NULL);
-       for (size_t d = 0; d < txdata_constr.datalen; d++) {
-               long arr_conv_29 = txdata_vals[d];
-               LDKC2Tuple_usizeTransactionZ arr_conv_29_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_29;
-               FREE((void*)arr_conv_29);
-               txdata_constr.data[d] = arr_conv_29_conv;
+       for (size_t y = 0; y < txdata_constr.datalen; y++) {
+               long arr_conv_24 = txdata_vals[y];
+               LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24;
+               FREE((void*)arr_conv_24);
+               txdata_constr.data[y] = arr_conv_24_conv;
        }
        (*_env)->ReleaseLongArrayElements (_env, txdata, txdata_vals, 0);
        ChainMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height);
@@ -6143,7 +6309,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char header_arr[80];
        CHECK((*_env)->GetArrayLength (_env, header) == 80);
        (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
@@ -6181,7 +6347,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _e
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
        *ret = ChainMonitor_as_Watch(&this_arg_conv);
        return (long)ret;
@@ -6190,7 +6356,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEn
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
        *ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
        return (long)ret;
@@ -6206,7 +6372,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNI
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelMonitorUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6220,7 +6386,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(J
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelMonitorUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
        return ret_val;
 }
@@ -6228,14 +6394,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1up
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelMonitorUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKChannelMonitorUpdate obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ChannelMonitorUpdate_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -6245,8 +6411,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1wr
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6281,7 +6447,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _e
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKMonitorEvent orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKMonitorEvent ret_var = MonitorEvent_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6302,7 +6468,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKHTLCUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6316,7 +6482,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv * _e
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKHTLCUpdate obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = HTLCUpdate_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -6326,8 +6492,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKHTLCUpdate ret_var = HTLCUpdate_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6349,7 +6515,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKChannelMonitorUpdate updates_conv;
        updates_conv.inner = (void*)(updates & (~1));
        updates_conv.is_owned = (updates & 1) || (updates == 0);
@@ -6365,7 +6531,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monit
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        jlong ret_val = ChannelMonitor_get_latest_update_id(&this_arg_conv);
        return ret_val;
 }
@@ -6373,7 +6539,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKC2Tuple_OutPointScriptZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
        *ret_ref = ChannelMonitor_get_funding_txo(&this_arg_conv);
        return (long)ret_ref;
@@ -6382,7 +6548,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_
 JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
        jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen);
        jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL);
@@ -6404,7 +6570,7 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and
 JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
        jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen);
        jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL);
@@ -6419,21 +6585,20 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and
        return ret_arr;
 }
 
-JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
+JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKLogger* logger_conv = (LDKLogger*)logger;
        LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
-       jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen);
-       jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL);
-       for (size_t n = 0; n < ret_var.datalen; n++) {
-               LDKTransaction *arr_conv_13_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-               *arr_conv_13_copy = ret_var.data[n];
-               long arr_conv_13_ref = (long)arr_conv_13_copy;
-               ret_arr_ptr[n] = arr_conv_13_ref;
+       jobjectArray ret_arr = (*_env)->NewObjectArray(_env, ret_var.datalen, arr_of_B_clz, NULL);
+       for (size_t i = 0; i < ret_var.datalen; i++) {
+               LDKTransaction arr_conv_8_var = ret_var.data[i];
+               jbyteArray arr_conv_8_arr = (*_env)->NewByteArray(_env, arr_conv_8_var.datalen);
+               (*_env)->SetByteArrayRegion(_env, arr_conv_8_arr, 0, arr_conv_8_var.datalen, arr_conv_8_var.data);
+               Transaction_free(arr_conv_8_var);
+               (*_env)->SetObjectArrayElement(_env, ret_arr, i, arr_conv_8_arr);
        }
-       (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0);
        CVec_TransactionZ_free(ret_var);
        return ret_arr;
 }
@@ -6441,7 +6606,7 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1lat
 JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlongArray txdata, jint height, jlong broadcaster, jlong fee_estimator, jlong logger) {
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char header_arr[80];
        CHECK((*_env)->GetArrayLength (_env, header) == 80);
        (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
@@ -6453,11 +6618,11 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1c
        else
                txdata_constr.data = NULL;
        long* txdata_vals = (*_env)->GetLongArrayElements (_env, txdata, NULL);
-       for (size_t d = 0; d < txdata_constr.datalen; d++) {
-               long arr_conv_29 = txdata_vals[d];
-               LDKC2Tuple_usizeTransactionZ arr_conv_29_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_29;
-               FREE((void*)arr_conv_29);
-               txdata_constr.data[d] = arr_conv_29_conv;
+       for (size_t y = 0; y < txdata_constr.datalen; y++) {
+               long arr_conv_24 = txdata_vals[y];
+               LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24;
+               FREE((void*)arr_conv_24);
+               txdata_constr.data[y] = arr_conv_24_conv;
        }
        (*_env)->ReleaseLongArrayElements (_env, txdata, txdata_vals, 0);
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
@@ -6491,7 +6656,7 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1c
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint height, jlong broadcaster, jlong fee_estimator, jlong logger) {
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char header_arr[80];
        CHECK((*_env)->GetArrayLength (_env, header) == 80);
        (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
@@ -6524,7 +6689,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env,
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKOutPoint orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6538,7 +6703,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv * _env
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOutPoint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv));
        return ret_arr;
@@ -6547,7 +6712,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIE
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOutPoint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -6557,7 +6722,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOutPoint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = OutPoint_get_index(&this_ptr_conv);
        return ret_val;
 }
@@ -6565,7 +6730,7 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKOutPoint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OutPoint_set_index(&this_ptr_conv, val);
 }
 
@@ -6586,7 +6751,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env,
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKOutPoint this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data);
        return arg_arr;
@@ -6595,7 +6760,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1i
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKOutPoint obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = OutPoint_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -6605,8 +6770,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKOutPoint ret_var = OutPoint_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6632,6 +6797,13 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1cl
        return ret_ref;
 }
 
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) {
+       LDKChannelKeys* orig_conv = (LDKChannelKeys*)orig;
+       LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
+       *ret = ChannelKeys_clone(orig_conv);
+       return (long)ret;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
        FREE((void*)this_ptr);
@@ -6654,7 +6826,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIE
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKInMemoryChannelKeys orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKInMemoryChannelKeys ret_var = InMemoryChannelKeys_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6668,7 +6840,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1clone(JN
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(&this_ptr_conv));
        return ret_arr;
@@ -6677,7 +6849,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSecretKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.bytes);
@@ -6687,7 +6859,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1fund
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(&this_ptr_conv));
        return ret_arr;
@@ -6696,7 +6868,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSecretKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.bytes);
@@ -6706,7 +6878,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revo
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(&this_ptr_conv));
        return ret_arr;
@@ -6715,7 +6887,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSecretKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.bytes);
@@ -6725,7 +6897,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1paym
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(&this_ptr_conv));
        return ret_arr;
@@ -6734,7 +6906,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSecretKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.bytes);
@@ -6744,7 +6916,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1dela
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(&this_ptr_conv));
        return ret_arr;
@@ -6753,7 +6925,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSecretKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.bytes);
@@ -6763,7 +6935,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(&this_ptr_conv));
        return ret_arr;
@@ -6772,7 +6944,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKInMemoryChannelKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -6813,7 +6985,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1new(JNIE
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKInMemoryChannelKeys this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKChannelPublicKeys ret_var = InMemoryChannelKeys_counterparty_pubkeys(&this_arg_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6827,7 +6999,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterp
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKInMemoryChannelKeys this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        jshort ret_val = InMemoryChannelKeys_counterparty_selected_contest_delay(&this_arg_conv);
        return ret_val;
 }
@@ -6835,7 +7007,7 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counter
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKInMemoryChannelKeys this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        jshort ret_val = InMemoryChannelKeys_holder_selected_contest_delay(&this_arg_conv);
        return ret_val;
 }
@@ -6843,7 +7015,7 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKInMemoryChannelKeys this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
        *ret = InMemoryChannelKeys_as_ChannelKeys(&this_arg_conv);
        return (long)ret;
@@ -6852,7 +7024,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1Chan
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKInMemoryChannelKeys obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = InMemoryChannelKeys_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -6862,8 +7034,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1wri
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKInMemoryChannelKeys ret_var = InMemoryChannelKeys_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6901,7 +7073,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv * _en
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv * _env, jclass _b, jlong this_arg, jlong channel_value_satoshis, jlong params_1, jlong params_2) {
        LDKKeysManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKInMemoryChannelKeys ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_1, params_2);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6915,7 +7087,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKKeysManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
        *ret = KeysManager_as_KeysInterface(&this_arg_conv);
        return (long)ret;
@@ -6938,7 +7110,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelDetails orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -6952,7 +7124,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -6961,7 +7133,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1cha
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -6971,7 +7143,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelDetails_get_remote_network_id(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -6980,7 +7152,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1rem
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -6990,7 +7162,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1n
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKInitFeatures ret_var = ChannelDetails_get_counterparty_features(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -7004,7 +7176,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterp
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKInitFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -7015,7 +7187,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterpa
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -7023,14 +7195,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelDetails_get_user_id(&this_ptr_conv);
        return ret_val;
 }
@@ -7038,14 +7210,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelDetails_set_user_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -7053,14 +7225,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -7068,14 +7240,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = ChannelDetails_get_is_live(&this_ptr_conv);
        return ret_val;
 }
@@ -7083,7 +7255,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1l
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelDetails_set_is_live(&this_ptr_conv, val);
 }
 
@@ -7139,7 +7311,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_network_key, jlong channel_value_satoshis, jlong push_msat, jlong user_id, jlong override_config) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKPublicKey their_network_key_ref;
        CHECK((*_env)->GetArrayLength (_env, their_network_key) == 33);
        (*_env)->GetByteArrayRegion (_env, their_network_key, 0, 33, their_network_key_ref.compressed_form);
@@ -7156,7 +7328,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1chann
 JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
        jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen);
        jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL);
@@ -7178,7 +7350,7 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1ch
 JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
        jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen);
        jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL);
@@ -7200,7 +7372,7 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1us
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char channel_id_arr[32];
        CHECK((*_env)->GetArrayLength (_env, channel_id) == 32);
        (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
@@ -7213,7 +7385,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channe
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char channel_id_arr[32];
        CHECK((*_env)->GetArrayLength (_env, channel_id) == 32);
        (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
@@ -7224,17 +7396,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        ChannelManager_force_close_all_channels(&this_arg_conv);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv * _env, jclass _b, jlong this_arg, jlong route, jbyteArray payment_hash, jbyteArray payment_secret) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKRoute route_conv;
        route_conv.inner = (void*)(route & (~1));
-       route_conv.is_owned = (route & 1) || (route == 0);
+       route_conv.is_owned = false;
        LDKThirtyTwoBytes payment_hash_ref;
        CHECK((*_env)->GetArrayLength (_env, payment_hash) == 32);
        (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_ref.data);
@@ -7249,7 +7421,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray temporary_channel_id, jlong funding_txo) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char temporary_channel_id_arr[32];
        CHECK((*_env)->GetArrayLength (_env, temporary_channel_id) == 32);
        (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
@@ -7265,7 +7437,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1trans
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray rgb, jbyteArray alias, jlongArray addresses) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKThreeBytes rgb_ref;
        CHECK((*_env)->GetArrayLength (_env, rgb) == 3);
        (*_env)->GetByteArrayRegion (_env, rgb, 0, 3, rgb_ref.data);
@@ -7292,21 +7464,21 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1nod
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
 }
 
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        ChannelManager_timer_chan_freshness_every_min(&this_arg_conv);
 }
 
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_hash, jbyteArray payment_secret) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char payment_hash_arr[32];
        CHECK((*_env)->GetArrayLength (_env, payment_hash) == 32);
        (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
@@ -7321,7 +7493,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_preimage, jbyteArray payment_secret, jlong expected_amount) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKThirtyTwoBytes payment_preimage_ref;
        CHECK((*_env)->GetArrayLength (_env, payment_preimage) == 32);
        (*_env)->GetByteArrayRegion (_env, payment_preimage, 0, 32, payment_preimage_ref.data);
@@ -7335,7 +7507,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1fun
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form);
        return arg_arr;
@@ -7344,17 +7516,17 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1monitor_1updated(JNIEnv * _env, jclass _b, jlong this_arg, jlong funding_txo, jlong highest_applied_update_id) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKOutPoint funding_txo_conv;
        funding_txo_conv.inner = (void*)(funding_txo & (~1));
-       funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+       funding_txo_conv.is_owned = false;
        ChannelManager_channel_monitor_updated(&this_arg_conv, &funding_txo_conv, highest_applied_update_id);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
        *ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
        return (long)ret;
@@ -7363,7 +7535,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSe
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
        *ret = ChannelManager_as_EventsProvider(&this_arg_conv);
        return (long)ret;
@@ -7372,7 +7544,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsPro
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlongArray txdata, jint height) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char header_arr[80];
        CHECK((*_env)->GetArrayLength (_env, header) == 80);
        (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
@@ -7384,11 +7556,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connect
        else
                txdata_constr.data = NULL;
        long* txdata_vals = (*_env)->GetLongArrayElements (_env, txdata, NULL);
-       for (size_t d = 0; d < txdata_constr.datalen; d++) {
-               long arr_conv_29 = txdata_vals[d];
-               LDKC2Tuple_usizeTransactionZ arr_conv_29_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_29;
-               FREE((void*)arr_conv_29);
-               txdata_constr.data[d] = arr_conv_29_conv;
+       for (size_t y = 0; y < txdata_constr.datalen; y++) {
+               long arr_conv_24 = txdata_vals[y];
+               LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24;
+               FREE((void*)arr_conv_24);
+               txdata_constr.data[y] = arr_conv_24_conv;
        }
        (*_env)->ReleaseLongArrayElements (_env, txdata, txdata_vals, 0);
        ChannelManager_block_connected(&this_arg_conv, header_ref, txdata_constr, height);
@@ -7397,7 +7569,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connect
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char header_arr[80];
        CHECK((*_env)->GetArrayLength (_env, header) == 80);
        (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
@@ -7408,7 +7580,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconn
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
        *ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
        return (long)ret;
@@ -7424,7 +7596,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(J
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        long ret_ret = (long)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv);
        return ret_ret;
 }
@@ -7432,7 +7604,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
        if (val_conv.free == LDKKeysInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
@@ -7444,7 +7616,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1k
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        long ret_ret = (long)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv);
        return ret_ret;
 }
@@ -7452,7 +7624,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
        if (val_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
@@ -7464,7 +7636,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1f
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        long ret_ret = (long)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv);
        return ret_ret;
 }
@@ -7472,7 +7644,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKWatch val_conv = *(LDKWatch*)val;
        if (val_conv.free == LDKWatch_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
@@ -7484,7 +7656,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1c
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        long ret_ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv);
        return ret_ret;
 }
@@ -7492,7 +7664,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
        if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
@@ -7504,7 +7676,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1t
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        long ret_ret = (long)ChannelManagerReadArgs_get_logger(&this_ptr_conv);
        return ret_ret;
 }
@@ -7512,7 +7684,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKLogger val_conv = *(LDKLogger*)val;
        if (val_conv.free == LDKLogger_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
@@ -7524,7 +7696,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1l
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -7538,7 +7710,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUserConfig val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -7620,7 +7792,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jcla
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKInit orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKInit ret_var = Init_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -7641,7 +7813,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _e
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKErrorMessage orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -7655,7 +7827,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKErrorMessage this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -7664,7 +7836,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1chann
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKErrorMessage this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -7674,7 +7846,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKErrorMessage this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKStr _str = ErrorMessage_get_data(&this_ptr_conv);
        char* _buf = MALLOC(_str.len + 1, "str conv buf");
        memcpy(_buf, _str.chars, _str.len);
@@ -7687,12 +7859,12 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNI
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKErrorMessage this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_u8Z val_ref;
-       val_ref.data = (*_env)->GetByteArrayElements (_env, val, NULL);
        val_ref.datalen = (*_env)->GetArrayLength (_env, val);
+       val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, val, 0, val_ref.datalen, val_ref.data);
        ErrorMessage_set_data(&this_ptr_conv, val_ref);
-       (*_env)->ReleaseByteArrayElements(_env, val, (int8_t*)val_ref.data, 0);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jbyteArray data_arg) {
@@ -7700,8 +7872,9 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _e
        CHECK((*_env)->GetArrayLength (_env, channel_id_arg) == 32);
        (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
        LDKCVec_u8Z data_arg_ref;
-       data_arg_ref.data = (*_env)->GetByteArrayElements (_env, data_arg, NULL);
        data_arg_ref.datalen = (*_env)->GetArrayLength (_env, data_arg);
+       data_arg_ref.data = MALLOC(data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, data_arg, 0, data_arg_ref.datalen, data_arg_ref.data);
        LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -7709,7 +7882,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _e
        if (ret_var.is_owned) {
                ret_ref |= 1;
        }
-       (*_env)->ReleaseByteArrayElements(_env, data_arg, (int8_t*)data_arg_ref.data, 0);
        return ret_ref;
 }
 
@@ -7723,7 +7895,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jcla
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKPing orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKPing ret_var = Ping_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -7737,7 +7909,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv * _env, jc
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKPing this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = Ping_get_ponglen(&this_ptr_conv);
        return ret_val;
 }
@@ -7745,14 +7917,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKPing this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        Ping_set_ponglen(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKPing this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = Ping_get_byteslen(&this_ptr_conv);
        return ret_val;
 }
@@ -7760,7 +7932,7 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKPing this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        Ping_set_byteslen(&this_ptr_conv, val);
 }
 
@@ -7785,7 +7957,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jcla
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKPong orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKPong ret_var = Pong_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -7799,7 +7971,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv * _env, jc
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKPong this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = Pong_get_byteslen(&this_ptr_conv);
        return ret_val;
 }
@@ -7807,7 +7979,7 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKPong this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        Pong_set_byteslen(&this_ptr_conv, val);
 }
 
@@ -7832,7 +8004,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _en
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKOpenChannel orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -7846,7 +8018,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv * _
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -7855,7 +8027,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -7865,7 +8037,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -7874,7 +8046,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1tempor
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -7884,7 +8056,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1c
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = OpenChannel_get_funding_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -7892,14 +8064,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1sa
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = OpenChannel_get_push_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -7907,14 +8079,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_push_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -7922,14 +8094,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -7937,14 +8109,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -7952,14 +8124,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1re
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -7967,14 +8139,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minim
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
        return ret_val;
 }
@@ -7982,14 +8154,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -7997,14 +8169,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_to_self_delay(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
        return ret_val;
 }
@@ -8012,14 +8184,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accep
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8028,7 +8200,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1fundin
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8038,7 +8210,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pub
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8047,7 +8219,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revoca
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8057,7 +8229,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8066,7 +8238,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1paymen
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8076,7 +8248,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1poi
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8085,7 +8257,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delaye
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8095,7 +8267,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1pay
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8104,7 +8276,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8114,7 +8286,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepo
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8123,7 +8295,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8133,7 +8305,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1
 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyte ret_val = OpenChannel_get_channel_flags(&this_ptr_conv);
        return ret_val;
 }
@@ -8141,7 +8313,7 @@ JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1fl
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        OpenChannel_set_channel_flags(&this_ptr_conv, val);
 }
 
@@ -8155,7 +8327,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKAcceptChannel orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8169,7 +8341,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -8178,7 +8350,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temp
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8188,7 +8360,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -8196,14 +8368,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1lim
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -8211,14 +8383,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -8226,14 +8398,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -8241,14 +8413,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1min
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = AcceptChannel_get_minimum_depth(&this_ptr_conv);
        return ret_val;
 }
@@ -8256,14 +8428,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1d
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -8271,14 +8443,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
        return ret_val;
 }
@@ -8286,14 +8458,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1acc
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8302,7 +8474,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fund
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8312,7 +8484,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1p
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8321,7 +8493,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revo
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8331,7 +8503,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8340,7 +8512,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1paym
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8350,7 +8522,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1p
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8359,7 +8531,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dela
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8369,7 +8541,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1p
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8378,7 +8550,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8388,7 +8560,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1base
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8397,7 +8569,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1firs
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8414,7 +8586,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKFundingCreated orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8428,7 +8600,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -8437,7 +8609,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1tem
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8447,7 +8619,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv));
        return ret_arr;
@@ -8456,7 +8628,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fun
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8466,7 +8638,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv);
        return ret_val;
 }
@@ -8474,14 +8646,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        FundingCreated_set_funding_output_index(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -8490,7 +8662,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1sig
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -8527,7 +8699,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKFundingSigned orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8541,7 +8713,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKFundingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -8550,7 +8722,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1chan
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKFundingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8560,7 +8732,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1i
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKFundingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -8569,7 +8741,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1sign
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKFundingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -8603,7 +8775,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKFundingLocked orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8617,7 +8789,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKFundingLocked this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -8626,7 +8798,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1chan
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKFundingLocked this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8636,7 +8808,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1i
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKFundingLocked this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -8645,7 +8817,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKFundingLocked this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -8679,7 +8851,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env,
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKShutdown orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKShutdown ret_var = Shutdown_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8693,7 +8865,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv * _env
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKShutdown this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -8702,7 +8874,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKShutdown this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8712,7 +8884,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNI
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKShutdown this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKu8slice arg_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -8722,12 +8894,12 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpub
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKShutdown this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_u8Z val_ref;
-       val_ref.data = (*_env)->GetByteArrayElements (_env, val, NULL);
        val_ref.datalen = (*_env)->GetArrayLength (_env, val);
+       val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, val, 0, val_ref.datalen, val_ref.data);
        Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
-       (*_env)->ReleaseByteArrayElements(_env, val, (int8_t*)val_ref.data, 0);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jbyteArray scriptpubkey_arg) {
@@ -8735,8 +8907,9 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env,
        CHECK((*_env)->GetArrayLength (_env, channel_id_arg) == 32);
        (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
        LDKCVec_u8Z scriptpubkey_arg_ref;
-       scriptpubkey_arg_ref.data = (*_env)->GetByteArrayElements (_env, scriptpubkey_arg, NULL);
        scriptpubkey_arg_ref.datalen = (*_env)->GetArrayLength (_env, scriptpubkey_arg);
+       scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data);
        LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8744,7 +8917,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env,
        if (ret_var.is_owned) {
                ret_ref |= 1;
        }
-       (*_env)->ReleaseByteArrayElements(_env, scriptpubkey_arg, (int8_t*)scriptpubkey_arg_ref.data, 0);
        return ret_ref;
 }
 
@@ -8758,7 +8930,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKClosingSigned orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8772,7 +8944,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -8781,7 +8953,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1chan
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8791,7 +8963,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1i
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -8799,14 +8971,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1sato
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -8815,7 +8987,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1sign
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -8849,7 +9021,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUpdateAddHTLC orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8863,7 +9035,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -8872,7 +9044,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1chan
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8882,7 +9054,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1i
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
        return ret_val;
 }
@@ -8890,14 +9062,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -8905,14 +9077,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1m
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv));
        return ret_arr;
@@ -8921,7 +9093,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1paym
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8931,7 +9103,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1h
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
        return ret_val;
 }
@@ -8939,7 +9111,7 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expi
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
 }
 
@@ -8953,7 +9125,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUpdateFulfillHTLC orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -8967,7 +9139,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIE
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -8976,7 +9148,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -8986,7 +9158,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channe
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
        return ret_val;
 }
@@ -8994,14 +9166,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv));
        return ret_arr;
@@ -9010,7 +9182,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9044,7 +9216,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUpdateFailHTLC orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9058,7 +9230,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFailHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -9067,7 +9239,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1cha
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUpdateFailHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9077,7 +9249,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFailHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
        return ret_val;
 }
@@ -9085,7 +9257,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUpdateFailHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
 }
 
@@ -9099,7 +9271,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUpdateFailMalformedHTLC orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9113,7 +9285,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clon
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -9122,7 +9294,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9132,7 +9304,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
        return ret_val;
 }
@@ -9140,14 +9312,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
        return ret_val;
 }
@@ -9155,7 +9327,7 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
 }
 
@@ -9169,7 +9341,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKCommitmentSigned orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9183,7 +9355,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEn
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -9192,7 +9364,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1c
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9202,7 +9374,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -9211,7 +9383,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1s
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -9221,7 +9393,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signatu
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jobjectArray val) {
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_SignatureZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -9278,7 +9450,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _e
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKRevokeAndACK orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9292,7 +9464,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -9301,7 +9473,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1chann
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9311,7 +9483,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv));
        return ret_arr;
@@ -9320,7 +9492,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9330,7 +9502,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commit
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -9339,7 +9511,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -9376,7 +9548,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env,
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUpdateFee orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9390,7 +9562,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv * _en
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -9399,7 +9571,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUpdateFee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9409,7 +9581,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JN
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUpdateFee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
        return ret_val;
 }
@@ -9417,7 +9589,7 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKUpdateFee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
 }
 
@@ -9445,7 +9617,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKDataLossProtect orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9459,7 +9631,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKDataLossProtect this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv));
        return ret_arr;
@@ -9468,7 +9640,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1yo
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKDataLossProtect this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9478,7 +9650,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1la
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKDataLossProtect this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -9487,7 +9659,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKDataLossProtect this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -9521,7 +9693,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEn
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelReestablish orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9535,7 +9707,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNI
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -9544,7 +9716,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9554,7 +9726,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1chann
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
        return ret_val;
 }
@@ -9562,14 +9734,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
        return ret_val;
 }
@@ -9577,7 +9749,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
 }
 
@@ -9591,7 +9763,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(J
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKAnnouncementSignatures orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9605,7 +9777,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -9614,7 +9786,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9624,7 +9796,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1c
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -9632,14 +9804,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -9648,7 +9820,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -9658,7 +9830,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1n
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -9667,7 +9839,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -9718,7 +9890,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUnsignedNodeAnnouncement orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9732,7 +9904,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clo
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9746,7 +9918,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -9757,7 +9929,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
        return ret_val;
 }
@@ -9765,14 +9937,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -9781,7 +9953,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -9791,7 +9963,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv));
        return ret_arr;
@@ -9800,7 +9972,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThreeBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 3);
        (*_env)->GetByteArrayRegion (_env, val, 0, 3, val_ref.data);
@@ -9810,7 +9982,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv));
        return ret_arr;
@@ -9819,7 +9991,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -9829,7 +10001,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_NetAddressZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -9857,7 +10029,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKNodeAnnouncement orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9871,7 +10043,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEn
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -9880,7 +10052,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1s
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -9890,7 +10062,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signatu
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9904,7 +10076,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1conten
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUnsignedNodeAnnouncement val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -9942,7 +10114,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1f
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUnsignedChannelAnnouncement orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9956,7 +10128,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -9970,7 +10142,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -9981,7 +10153,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -9990,7 +10162,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncem
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -10000,7 +10172,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -10008,14 +10180,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -10024,7 +10196,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncem
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -10034,7 +10206,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -10043,7 +10215,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncem
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -10053,7 +10225,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -10062,7 +10234,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncem
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -10072,7 +10244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -10081,7 +10253,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncem
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -10098,7 +10270,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIE
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelAnnouncement orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10112,7 +10284,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JN
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -10121,7 +10293,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -10131,7 +10303,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -10140,7 +10312,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -10150,7 +10322,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -10159,7 +10331,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -10169,7 +10341,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -10178,7 +10350,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -10188,7 +10360,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10202,7 +10374,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1con
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUnsignedChannelAnnouncement val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -10249,7 +10421,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JN
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKUnsignedChannelUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10263,7 +10435,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -10272,7 +10444,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1g
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -10282,7 +10454,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ch
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -10290,14 +10462,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1s
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
        return ret_val;
 }
@@ -10305,14 +10477,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1ti
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyte ret_val = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
        return ret_val;
 }
@@ -10320,14 +10492,14 @@ JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1f
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -10335,14 +10507,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -10350,14 +10522,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1h
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -10365,14 +10537,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fe
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
        return ret_val;
 }
@@ -10380,7 +10552,7 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fe
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
 }
 
@@ -10394,7 +10566,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10408,7 +10580,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -10417,7 +10589,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1sign
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -10427,7 +10599,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10441,7 +10613,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUnsignedChannelUpdate val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -10479,7 +10651,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKQueryChannelRange orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10493,7 +10665,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIE
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -10502,7 +10674,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -10512,7 +10684,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
        return ret_val;
 }
@@ -10520,14 +10692,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
        return ret_val;
 }
@@ -10535,7 +10707,7 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
 }
 
@@ -10563,7 +10735,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKReplyChannelRange orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10577,7 +10749,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIE
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -10586,7 +10758,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -10596,7 +10768,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
        return ret_val;
 }
@@ -10604,14 +10776,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
        return ret_val;
 }
@@ -10619,14 +10791,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
 }
 
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = ReplyChannelRange_get_full_information(&this_ptr_conv);
        return ret_val;
 }
@@ -10634,14 +10806,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1fu
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ReplyChannelRange_set_full_information(&this_ptr_conv, val);
 }
 
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_u64Z val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -10693,7 +10865,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNI
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKQueryShortChannelIds orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10707,7 +10879,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(J
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKQueryShortChannelIds this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -10716,7 +10888,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1ge
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKQueryShortChannelIds this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -10726,7 +10898,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1cha
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKQueryShortChannelIds this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_u64Z val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -10778,7 +10950,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKReplyShortChannelIdsEnd orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10792,7 +10964,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clon
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKReplyShortChannelIdsEnd this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -10801,7 +10973,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKReplyShortChannelIdsEnd this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -10811,7 +10983,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKReplyShortChannelIdsEnd this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
        return ret_val;
 }
@@ -10819,7 +10991,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1g
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKReplyShortChannelIdsEnd this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
 }
 
@@ -10847,7 +11019,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JN
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKGossipTimestampFilter orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -10861,7 +11033,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -10870,7 +11042,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1g
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -10880,7 +11052,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ch
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
        return ret_val;
 }
@@ -10888,14 +11060,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1fi
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
        return ret_val;
 }
@@ -10903,7 +11075,7 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1ti
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
 }
 
@@ -10945,7 +11117,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKLightningError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKStr _str = LightningError_get_err(&this_ptr_conv);
        char* _buf = MALLOC(_str.len + 1, "str conv buf");
        memcpy(_buf, _str.chars, _str.len);
@@ -10958,18 +11130,18 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JN
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKLightningError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_u8Z val_ref;
-       val_ref.data = (*_env)->GetByteArrayElements (_env, val, NULL);
        val_ref.datalen = (*_env)->GetArrayLength (_env, val);
+       val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, val, 0, val_ref.datalen, val_ref.data);
        LightningError_set_err(&this_ptr_conv, val_ref);
-       (*_env)->ReleaseByteArrayElements(_env, val, (int8_t*)val_ref.data, 0);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKLightningError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
        *ret_copy = LightningError_get_action(&this_ptr_conv);
        long ret_ref = (long)ret_copy;
@@ -10979,7 +11151,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(J
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKLightningError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKErrorAction val_conv = *(LDKErrorAction*)val;
        FREE((void*)val);
        LightningError_set_action(&this_ptr_conv, val_conv);
@@ -10987,8 +11159,9 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JN
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jbyteArray err_arg, jlong action_arg) {
        LDKCVec_u8Z err_arg_ref;
-       err_arg_ref.data = (*_env)->GetByteArrayElements (_env, err_arg, NULL);
        err_arg_ref.datalen = (*_env)->GetArrayLength (_env, err_arg);
+       err_arg_ref.data = MALLOC(err_arg_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*_env)->GetByteArrayRegion(_env, err_arg, 0, err_arg_ref.datalen, err_arg_ref.data);
        LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
        FREE((void*)action_arg);
        LDKLightningError ret_var = LightningError_new(err_arg_ref, action_arg_conv);
@@ -10998,7 +11171,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *
        if (ret_var.is_owned) {
                ret_ref |= 1;
        }
-       (*_env)->ReleaseByteArrayElements(_env, err_arg, (int8_t*)err_arg_ref.data, 0);
        return ret_ref;
 }
 
@@ -11012,7 +11184,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKCommitmentUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11026,7 +11198,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEn
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_UpdateAddHTLCZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -11050,7 +11222,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_UpdateFulfillHTLCZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -11074,7 +11246,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_UpdateFailHTLCZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -11098,7 +11270,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_UpdateFailMalformedHTLCZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -11122,7 +11294,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11136,7 +11308,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKUpdateFee val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -11148,7 +11320,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11162,7 +11334,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commit
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCommitmentSigned val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -11289,7 +11461,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JN
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKAcceptChannel obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = AcceptChannel_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11299,8 +11471,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNI
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKAcceptChannel ret_var = AcceptChannel_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11315,7 +11487,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKAnnouncementSignatures obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = AnnouncementSignatures_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11325,8 +11497,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKAnnouncementSignatures ret_var = AnnouncementSignatures_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11341,7 +11513,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKChannelReestablish obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ChannelReestablish_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11351,8 +11523,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1writ
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKChannelReestablish ret_var = ChannelReestablish_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11367,7 +11539,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIE
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKClosingSigned obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ClosingSigned_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11377,8 +11549,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNI
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKClosingSigned ret_var = ClosingSigned_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11393,7 +11565,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKCommitmentSigned obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = CommitmentSigned_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11403,8 +11575,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKCommitmentSigned ret_var = CommitmentSigned_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11419,7 +11591,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKFundingCreated obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = FundingCreated_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11429,8 +11601,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JN
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKFundingCreated ret_var = FundingCreated_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11445,7 +11617,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKFundingSigned obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = FundingSigned_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11455,8 +11627,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNI
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKFundingSigned ret_var = FundingSigned_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11471,7 +11643,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKFundingLocked obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = FundingLocked_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11481,8 +11653,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNI
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKFundingLocked ret_var = FundingLocked_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11497,7 +11669,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKInit obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = Init_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11507,8 +11679,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _en
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKInit ret_var = Init_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11523,7 +11695,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jcl
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKOpenChannel obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = OpenChannel_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11533,8 +11705,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEn
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKOpenChannel ret_var = OpenChannel_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11549,7 +11721,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _e
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKRevokeAndACK obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = RevokeAndACK_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11559,8 +11731,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIE
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKRevokeAndACK ret_var = RevokeAndACK_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11575,7 +11747,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKShutdown obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = Shutdown_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11585,8 +11757,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKShutdown ret_var = Shutdown_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11601,7 +11773,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env,
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKUpdateFailHTLC obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = UpdateFailHTLC_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11611,8 +11783,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JN
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKUpdateFailHTLC ret_var = UpdateFailHTLC_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11627,7 +11799,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKUpdateFailMalformedHTLC obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = UpdateFailMalformedHTLC_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11637,8 +11809,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11653,7 +11825,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKUpdateFee obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = UpdateFee_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11663,8 +11835,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKUpdateFee ret_var = UpdateFee_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11679,7 +11851,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKUpdateFulfillHTLC obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = UpdateFulfillHTLC_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11689,8 +11861,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11705,7 +11877,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEn
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKUpdateAddHTLC obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = UpdateAddHTLC_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11715,8 +11887,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNI
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKUpdateAddHTLC ret_var = UpdateAddHTLC_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11731,7 +11903,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKPing obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = Ping_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11741,8 +11913,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _en
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKPing ret_var = Ping_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11757,7 +11929,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jcl
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKPong obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = Pong_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11767,8 +11939,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _en
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKPong ret_var = Pong_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11783,7 +11955,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jcl
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKUnsignedChannelAnnouncement obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = UnsignedChannelAnnouncement_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11793,8 +11965,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncem
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11809,7 +11981,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKChannelAnnouncement obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ChannelAnnouncement_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11819,8 +11991,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1wri
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKChannelAnnouncement ret_var = ChannelAnnouncement_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11835,7 +12007,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNI
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKUnsignedChannelUpdate obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = UnsignedChannelUpdate_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11845,8 +12017,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1w
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11861,7 +12033,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(J
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKChannelUpdate obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ChannelUpdate_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11871,8 +12043,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNI
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKChannelUpdate ret_var = ChannelUpdate_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11887,7 +12059,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKErrorMessage obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ErrorMessage_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11897,8 +12069,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIE
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKErrorMessage ret_var = ErrorMessage_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11913,7 +12085,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKUnsignedNodeAnnouncement obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = UnsignedNodeAnnouncement_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11923,8 +12095,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11939,7 +12111,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1rea
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKNodeAnnouncement obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = NodeAnnouncement_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11949,8 +12121,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKNodeAnnouncement ret_var = NodeAnnouncement_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11964,8 +12136,8 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKQueryShortChannelIds ret_var = QueryShortChannelIds_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -11980,7 +12152,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JN
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKQueryShortChannelIds obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = QueryShortChannelIds_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -11990,8 +12162,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1wr
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12006,7 +12178,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKReplyShortChannelIdsEnd obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ReplyShortChannelIdsEnd_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -12016,8 +12188,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKQueryChannelRange ret_var = QueryChannelRange_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12032,7 +12204,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEn
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKQueryChannelRange obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = QueryChannelRange_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -12042,8 +12214,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKReplyChannelRange ret_var = ReplyChannelRange_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12058,7 +12230,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEn
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKReplyChannelRange obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ReplyChannelRange_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -12068,8 +12240,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKGossipTimestampFilter ret_var = GossipTimestampFilter_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12084,7 +12256,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(J
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKGossipTimestampFilter obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = GossipTimestampFilter_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -12102,7 +12274,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKMessageHandler this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        long ret_ret = (long)MessageHandler_get_chan_handler(&this_ptr_conv);
        return ret_ret;
 }
@@ -12110,7 +12282,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1ha
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKMessageHandler this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
        if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
@@ -12122,7 +12294,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1han
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKMessageHandler this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        long ret_ret = (long)MessageHandler_get_route_handler(&this_ptr_conv);
        return ret_ret;
 }
@@ -12130,7 +12302,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1h
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKMessageHandler this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
        if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
@@ -12160,6 +12332,13 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *
        return ret_ref;
 }
 
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv * _env, jclass _b, jlong orig) {
+       LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig;
+       LDKSocketDescriptor* ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
+       *ret = SocketDescriptor_clone(orig_conv);
+       return (long)ret;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
        FREE((void*)this_ptr);
@@ -12176,7 +12355,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKPeerHandleError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
        return ret_val;
 }
@@ -12184,7 +12363,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKPeerHandleError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
 }
 
@@ -12236,7 +12415,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv * _en
 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
        jobjectArray ret_arr = (*_env)->NewObjectArray(_env, ret_var.datalen, arr_of_B_clz, NULL);
        for (size_t i = 0; i < ret_var.datalen; i++) {
@@ -12251,7 +12430,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong descriptor) {
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKPublicKey their_node_id_ref;
        CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33);
        (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
@@ -12268,7 +12447,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1c
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
        if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
@@ -12282,7 +12461,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1co
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
        LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
        *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
@@ -12292,11 +12471,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1s
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jbyteArray data) {
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
        LDKu8slice data_ref;
-       data_ref.data = (*_env)->GetByteArrayElements (_env, data, NULL);
        data_ref.datalen = (*_env)->GetArrayLength (_env, data);
+       data_ref.data = (*_env)->GetByteArrayElements (_env, data, NULL);
        LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
        *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
        (*_env)->ReleaseByteArrayElements(_env, data, (int8_t*)data_ref.data, 0);
@@ -12306,14 +12485,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIE
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        PeerManager_process_events(&this_arg_conv);
 }
 
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
        PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
 }
@@ -12321,7 +12500,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnec
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        PeerManager_timer_tick_occured(&this_arg_conv);
 }
 
@@ -12396,7 +12575,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKTxCreationKeys orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12410,7 +12589,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12419,7 +12598,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12429,7 +12608,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1comm
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12438,7 +12617,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1rev
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12448,7 +12627,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocatio
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12457,7 +12636,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1bro
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12467,7 +12646,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12476,7 +12655,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1cou
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12486,7 +12665,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersi
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12495,7 +12674,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1bro
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12531,7 +12710,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv *
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKTxCreationKeys obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = TxCreationKeys_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -12541,8 +12720,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JN
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKTxCreationKeys ret_var = TxCreationKeys_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12561,6 +12740,20 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1f
        PreCalculatedTxCreationKeys_free(this_ptr_conv);
 }
 
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) {
+       LDKPreCalculatedTxCreationKeys orig_conv;
+       orig_conv.inner = (void*)(orig & (~1));
+       orig_conv.is_owned = false;
+       LDKPreCalculatedTxCreationKeys ret_var = PreCalculatedTxCreationKeys_clone(&orig_conv);
+       CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       long ret_ref = (long)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
        LDKTxCreationKeys keys_conv;
        keys_conv.inner = (void*)(keys & (~1));
@@ -12580,7 +12773,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKPreCalculatedTxCreationKeys this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKTxCreationKeys ret_var = PreCalculatedTxCreationKeys_trust_key_derivation(&this_arg_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12594,7 +12787,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKPreCalculatedTxCreationKeys this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, PreCalculatedTxCreationKeys_per_commitment_point(&this_arg_conv).compressed_form);
        return arg_arr;
@@ -12610,7 +12803,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKChannelPublicKeys orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12624,7 +12817,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIE
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12633,7 +12826,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12643,7 +12836,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1fundin
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12652,7 +12845,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12662,7 +12855,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revoca
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12671,7 +12864,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12681,7 +12874,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1paymen
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12690,7 +12883,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12700,7 +12893,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delaye
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -12709,7 +12902,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -12745,7 +12938,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKChannelPublicKeys obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ChannelPublicKeys_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -12755,8 +12948,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKChannelPublicKeys ret_var = ChannelPublicKeys_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12813,7 +13006,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(J
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKHTLCOutputInCommitment orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12827,7 +13020,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
        return ret_val;
 }
@@ -12835,14 +13028,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1ge
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -12850,14 +13043,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
        return ret_val;
 }
@@ -12865,14 +13058,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1c
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv));
        return ret_arr;
@@ -12881,7 +13074,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -12891,7 +13084,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1p
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKHTLCOutputInCommitment obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = HTLCOutputInCommitment_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -12901,8 +13094,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12917,10 +13110,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
        LDKHTLCOutputInCommitment htlc_conv;
        htlc_conv.inner = (void*)(htlc & (~1));
-       htlc_conv.is_owned = (htlc & 1) || (htlc == 0);
+       htlc_conv.is_owned = false;
        LDKTxCreationKeys keys_conv;
        keys_conv.inner = (void*)(keys & (~1));
-       keys_conv.is_owned = (keys & 1) || (keys == 0);
+       keys_conv.is_owned = false;
        LDKCVec_u8Z arg_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -12942,24 +13135,25 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscr
        return arg_arr;
 }
 
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jshort contest_delay, jlong htlc, jbyteArray broadcaster_delayed_payment_key, jbyteArray revocation_key) {
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jshort contest_delay, jlong htlc, jbyteArray broadcaster_delayed_payment_key, jbyteArray revocation_key) {
        unsigned char prev_hash_arr[32];
        CHECK((*_env)->GetArrayLength (_env, prev_hash) == 32);
        (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
        unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
        LDKHTLCOutputInCommitment htlc_conv;
        htlc_conv.inner = (void*)(htlc & (~1));
-       htlc_conv.is_owned = (htlc & 1) || (htlc == 0);
+       htlc_conv.is_owned = false;
        LDKPublicKey broadcaster_delayed_payment_key_ref;
        CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_key) == 33);
        (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
        LDKPublicKey revocation_key_ref;
        CHECK((*_env)->GetArrayLength (_env, revocation_key) == 33);
        (*_env)->GetByteArrayRegion (_env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
-       LDKTransaction *ret_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-       *ret_copy = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
-       long ret_ref = (long)ret_copy;
-       return ret_ref;
+       LDKTransaction arg_var = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
+       jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+       (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+       Transaction_free(arg_var);
+       return arg_arr;
 }
 
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
@@ -12972,7 +13166,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1f
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKHolderCommitmentTransaction orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -12983,28 +13177,33 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1
        return ret_ref;
 }
 
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
-       LDKTransaction *ret_copy = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
-       *ret_copy = HolderCommitmentTransaction_get_unsigned_tx(&this_ptr_conv);
-       long ret_ref = (long)ret_copy;
-       return ret_ref;
+       this_ptr_conv.is_owned = false;
+       LDKTransaction arg_var = HolderCommitmentTransaction_get_unsigned_tx(&this_ptr_conv);
+       jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+       (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+       Transaction_free(arg_var);
+       return arg_arr;
 }
 
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
-       LDKTransaction val_conv = *(LDKTransaction*)val;
-       HolderCommitmentTransaction_set_unsigned_tx(&this_ptr_conv, val_conv);
+       this_ptr_conv.is_owned = false;
+       LDKTransaction val_ref;
+       val_ref.datalen = (*_env)->GetArrayLength (_env, val);
+       val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, val, 0, val_ref.datalen, val_ref.data);
+       val_ref.data_is_owned = true;
+       HolderCommitmentTransaction_set_unsigned_tx(&this_ptr_conv, val_ref);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form);
        return arg_arr;
@@ -13013,7 +13212,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransact
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKSignature val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 64);
        (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form);
@@ -13023,7 +13222,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = HolderCommitmentTransaction_get_feerate_per_kw(&this_ptr_conv);
        return ret_val;
 }
@@ -13031,14 +13230,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1g
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        HolderCommitmentTransaction_set_feerate_per_kw(&this_ptr_conv, val);
 }
 
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -13056,8 +13255,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s
        HolderCommitmentTransaction_set_per_htlc(&this_ptr_conv, val_constr);
 }
 
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new_1missing_1holder_1sig(JNIEnv * _env, jclass _b, jlong unsigned_tx, jbyteArray counterparty_sig, jbyteArray holder_funding_key, jbyteArray counterparty_funding_key, jlong keys, jint feerate_per_kw, jlongArray htlc_data) {
-       LDKTransaction unsigned_tx_conv = *(LDKTransaction*)unsigned_tx;
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new_1missing_1holder_1sig(JNIEnv * _env, jclass _b, jbyteArray unsigned_tx, jbyteArray counterparty_sig, jbyteArray holder_funding_key, jbyteArray counterparty_funding_key, jlong keys, jint feerate_per_kw, jlongArray htlc_data) {
+       LDKTransaction unsigned_tx_ref;
+       unsigned_tx_ref.datalen = (*_env)->GetArrayLength (_env, unsigned_tx);
+       unsigned_tx_ref.data = MALLOC(unsigned_tx_ref.datalen, "LDKTransaction Bytes");
+       (*_env)->GetByteArrayRegion(_env, unsigned_tx, 0, unsigned_tx_ref.datalen, unsigned_tx_ref.data);
+       unsigned_tx_ref.data_is_owned = true;
        LDKSignature counterparty_sig_ref;
        CHECK((*_env)->GetArrayLength (_env, counterparty_sig) == 64);
        (*_env)->GetByteArrayRegion (_env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form);
@@ -13086,7 +13289,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1
                htlc_data_constr.data[q] = arr_conv_42_conv;
        }
        (*_env)->ReleaseLongArrayElements (_env, htlc_data, htlc_data_vals, 0);
-       LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new_missing_holder_sig(unsigned_tx_conv, counterparty_sig_ref, holder_funding_key_ref, counterparty_funding_key_ref, keys_conv, feerate_per_kw, htlc_data_constr);
+       LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new_missing_holder_sig(unsigned_tx_ref, counterparty_sig_ref, holder_funding_key_ref, counterparty_funding_key_ref, keys_conv, feerate_per_kw, htlc_data_constr);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
        long ret_ref = (long)ret_var.inner;
@@ -13099,7 +13302,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKHolderCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKTxCreationKeys ret_var = HolderCommitmentTransaction_trust_key_derivation(&this_arg_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13113,7 +13316,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKHolderCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, HolderCommitmentTransaction_txid(&this_arg_conv).data);
        return arg_arr;
@@ -13122,14 +13325,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransact
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1holder_1sig(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_key, jbyteArray funding_redeemscript, jlong channel_value_satoshis) {
        LDKHolderCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char funding_key_arr[32];
        CHECK((*_env)->GetArrayLength (_env, funding_key) == 32);
        (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
        unsigned char (*funding_key_ref)[32] = &funding_key_arr;
        LDKu8slice funding_redeemscript_ref;
-       funding_redeemscript_ref.data = (*_env)->GetByteArrayElements (_env, funding_redeemscript, NULL);
        funding_redeemscript_ref.datalen = (*_env)->GetArrayLength (_env, funding_redeemscript);
+       funding_redeemscript_ref.data = (*_env)->GetByteArrayElements (_env, funding_redeemscript, NULL);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, HolderCommitmentTransaction_get_holder_sig(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
        (*_env)->ReleaseByteArrayElements(_env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
@@ -13139,7 +13342,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransact
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_base_key, jshort counterparty_selected_contest_delay) {
        LDKHolderCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        unsigned char htlc_base_key_arr[32];
        CHECK((*_env)->GetArrayLength (_env, htlc_base_key) == 32);
        (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
@@ -13152,7 +13355,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKHolderCommitmentTransaction obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = HolderCommitmentTransaction_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -13162,8 +13365,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransact
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13206,7 +13409,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env,
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKRouteHop orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13220,7 +13423,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv * _env
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -13229,7 +13432,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JN
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -13239,7 +13442,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13253,7 +13456,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -13264,7 +13467,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = RouteHop_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -13272,14 +13475,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        RouteHop_set_short_channel_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13293,7 +13496,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1featu
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -13304,7 +13507,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1featur
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = RouteHop_get_fee_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -13312,14 +13515,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIE
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        RouteHop_set_fee_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -13327,7 +13530,7 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1d
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
@@ -13363,7 +13566,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jcl
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKRoute orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKRoute ret_var = Route_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13377,7 +13580,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv * _env, j
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jobjectArray val) {
        LDKRoute this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_CVec_RouteHopZZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -13449,7 +13652,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jcl
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKRoute obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = Route_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -13459,8 +13662,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _e
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKRoute ret_var = Route_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13482,7 +13685,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env,
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKRouteHint orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13496,7 +13699,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv * _en
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, RouteHint_get_src_node_id(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -13505,7 +13708,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1nod
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -13515,7 +13718,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = RouteHint_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -13523,14 +13726,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channe
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        RouteHint_set_short_channel_id(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKRoutingFees ret_var = RouteHint_get_fees(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13544,7 +13747,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv *
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKRoutingFees val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -13556,7 +13759,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv *
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = RouteHint_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -13564,14 +13767,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        RouteHint_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = RouteHint_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -13579,7 +13782,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        RouteHint_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
@@ -13608,7 +13811,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv * _env, jcl
        (*_env)->GetByteArrayRegion (_env, our_node_id, 0, 33, our_node_id_ref.compressed_form);
        LDKNetworkGraph network_conv;
        network_conv.inner = (void*)(network & (~1));
-       network_conv.is_owned = (network & 1) || (network == 0);
+       network_conv.is_owned = false;
        LDKPublicKey target_ref;
        CHECK((*_env)->GetArrayLength (_env, target) == 33);
        (*_env)->GetByteArrayRegion (_env, target, 0, 33, target_ref.compressed_form);
@@ -13717,7 +13920,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKNetGraphMsgHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKLockedNetworkGraph ret_var = NetGraphMsgHandler_read_locked_graph(&this_arg_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13731,7 +13934,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1loc
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKLockedNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKNetworkGraph ret_var = LockedNetworkGraph_graph(&this_arg_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13745,7 +13948,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNI
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
        LDKNetGraphMsgHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
        *ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv);
        return (long)ret;
@@ -13761,7 +13964,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(J
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = DirectionalChannelInfo_get_last_update(&this_ptr_conv);
        return ret_val;
 }
@@ -13769,14 +13972,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1l
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        DirectionalChannelInfo_set_last_update(&this_ptr_conv, val);
 }
 
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jboolean ret_val = DirectionalChannelInfo_get_enabled(&this_ptr_conv);
        return ret_val;
 }
@@ -13784,14 +13987,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1ge
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        DirectionalChannelInfo_set_enabled(&this_ptr_conv, val);
 }
 
 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jshort ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -13799,14 +14002,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        DirectionalChannelInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jlong ret_val = DirectionalChannelInfo_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -13814,14 +14017,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13835,7 +14038,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelUpdate val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -13847,7 +14050,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKDirectionalChannelInfo obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = DirectionalChannelInfo_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -13857,8 +14060,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13880,7 +14083,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _en
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13894,7 +14097,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JN
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -13905,7 +14108,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNI
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelInfo_get_node_one(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -13914,7 +14117,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -13924,7 +14127,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JN
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13938,7 +14141,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1tw
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKDirectionalChannelInfo val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -13949,7 +14152,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelInfo_get_node_two(&this_ptr_conv).compressed_form);
        return arg_arr;
@@ -13958,7 +14161,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKPublicKey val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 33);
        (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form);
@@ -13968,7 +14171,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JN
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -13982,7 +14185,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1on
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKDirectionalChannelInfo val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -13993,7 +14196,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14007,7 +14210,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcemen
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKChannelAnnouncement val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -14019,7 +14222,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKChannelInfo obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = ChannelInfo_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -14029,8 +14232,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEn
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKChannelInfo ret_var = ChannelInfo_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14052,7 +14255,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _en
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv * _env, jclass _b, jlong orig) {
        LDKRoutingFees orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = (orig & 1) || (orig == 0);
+       orig_conv.is_owned = false;
        LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14066,7 +14269,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv * _
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRoutingFees this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = RoutingFees_get_base_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -14074,14 +14277,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(J
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKRoutingFees this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        RoutingFees_set_base_msat(&this_ptr_conv, val);
 }
 
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKRoutingFees this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = RoutingFees_get_proportional_millionths(&this_ptr_conv);
        return ret_val;
 }
@@ -14089,7 +14292,7 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKRoutingFees this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
 }
 
@@ -14106,8 +14309,8 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _en
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKRoutingFees ret_var = RoutingFees_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14122,7 +14325,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _e
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKRoutingFees obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = RoutingFees_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -14140,7 +14343,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNI
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14154,7 +14357,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1fe
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -14165,7 +14368,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1fea
 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jint ret_val = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
        return ret_val;
 }
@@ -14173,14 +14376,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1las
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
 }
 
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv));
        return ret_arr;
@@ -14189,7 +14392,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1ge
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThreeBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 3);
        (*_env)->GetByteArrayRegion (_env, val, 0, 3, val_ref.data);
@@ -14199,7 +14402,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
        (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(&this_ptr_conv));
        return ret_arr;
@@ -14208,7 +14411,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1ge
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKThirtyTwoBytes val_ref;
        CHECK((*_env)->GetArrayLength (_env, val) == 32);
        (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
@@ -14218,7 +14421,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ali
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_NetAddressZ val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -14239,7 +14442,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1add
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14253,7 +14456,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1an
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeAnnouncement val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -14305,7 +14508,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNI
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKNodeAnnouncementInfo obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = NodeAnnouncementInfo_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -14315,8 +14518,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1wr
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14338,7 +14541,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env,
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) {
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKCVec_u64Z val_constr;
        val_constr.datalen = (*_env)->GetArrayLength (_env, val);
        if (val_constr.datalen > 0)
@@ -14357,7 +14560,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14371,7 +14574,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inboun
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKRoutingFees val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -14383,7 +14586,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14397,7 +14600,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+       this_ptr_conv.is_owned = false;
        LDKNodeAnnouncementInfo val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
@@ -14440,7 +14643,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv * _env,
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKNodeInfo obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = NodeInfo_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -14450,8 +14653,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKNodeInfo ret_var = NodeInfo_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14466,7 +14669,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env,
 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
        LDKNetworkGraph obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
-       obj_conv.is_owned = (obj & 1) || (obj == 0);
+       obj_conv.is_owned = false;
        LDKCVec_u8Z arg_var = NetworkGraph_write(&obj_conv);
        jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
        (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
@@ -14476,8 +14679,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIE
 
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
        LDKu8slice ser_ref;
-       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+       ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
        LDKNetworkGraph ret_var = NetworkGraph_read(ser_ref);
        CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
@@ -14503,7 +14706,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _e
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1from_1update(JNIEnv * _env, jclass _b, jlong this_arg, jlong short_channel_id, jboolean is_permanent) {
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv.is_owned = false;
        NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent);
 }