*commitment_tx_copy = commitment_tx;
long commitment_tx_ref = (long)commitment_tx_copy;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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 = (orig & 1) || (orig == 0);
+ 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));