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) {
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);
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);