if (record_var.is_owned) {
record_ref |= 1;
}
- js_invoke_function_1(j_calls->instance_ptr, 0, (uint32_t)record_ref);
+ js_invoke_function_u_u(j_calls->instance_ptr, 0, (uint32_t)record_ref);
}
static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__);
memcpy(genesis_hash_arr->elems, *genesis_hash, 32);
int64_t short_channel_id_conv = short_channel_id;
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 1, (uint32_t)genesis_hash_arr, (uint32_t)short_channel_id_conv);
+ uint32_t ret = js_invoke_function_u_bb(j_calls->instance_ptr, 1, (uint32_t)genesis_hash_arr, (uint32_t)short_channel_id_conv);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
int64_t idx_conv = idx;
- int8_tArray ret = (int8_tArray)js_invoke_function_1(j_calls->instance_ptr, 2, (uint32_t)idx_conv);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_b(j_calls->instance_ptr, 2, (uint32_t)idx_conv);
LDKPublicKey ret_ref;
CHECK(ret->arr_len == 33);
memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
int64_t idx_conv = idx;
- int8_tArray ret = (int8_tArray)js_invoke_function_1(j_calls->instance_ptr, 3, (uint32_t)idx_conv);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_b(j_calls->instance_ptr, 3, (uint32_t)idx_conv);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
}
FREE(preimages_var.data);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 4, (uint32_t)holder_tx_ref, (uint32_t)preimages_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 4, (uint32_t)holder_tx_ref, (uint32_t)preimages_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
}
LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 5);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 5);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
}
FREE(preimages_var.data);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 6, (uint32_t)commitment_tx_ref, (uint32_t)preimages_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 6, (uint32_t)commitment_tx_ref, (uint32_t)preimages_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
int64_t idx_conv = idx;
int8_tArray secret_arr = init_int8_tArray(32, __LINE__);
memcpy(secret_arr->elems, *secret, 32);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 7, (uint32_t)idx_conv, (uint32_t)secret_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 7, (uint32_t)idx_conv, (uint32_t)secret_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 8, (uint32_t)commitment_tx_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 8, (uint32_t)commitment_tx_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
int64_t amount_conv = amount;
int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
- uint32_t ret = js_invoke_function_4(j_calls->instance_ptr, 9, (uint32_t)justice_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_key_arr);
+ uint32_t ret = js_invoke_function_u_uuuu(j_calls->instance_ptr, 9, (uint32_t)justice_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_key_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
- uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_key_arr, (uint32_t)htlc_ref);
+ uint32_t ret = js_invoke_function_u_uuuuu(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_key_arr, (uint32_t)htlc_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
- uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 11, (uint32_t)htlc_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_point_arr, (uint32_t)htlc_ref);
+ uint32_t ret = js_invoke_function_u_uuuuu(j_calls->instance_ptr, 11, (uint32_t)htlc_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_point_arr, (uint32_t)htlc_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
if (closing_tx_var.is_owned) {
closing_tx_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 12, (uint32_t)closing_tx_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 12, (uint32_t)closing_tx_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 13, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 13, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
if (channel_parameters_var.is_owned) {
channel_parameters_ref |= 1;
}
- js_invoke_function_1(j_calls->instance_ptr, 14, (uint32_t)channel_parameters_ref);
+ js_invoke_function_u_u(j_calls->instance_ptr, 14, (uint32_t)channel_parameters_ref);
}
static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
else
preimages_constr.data = NULL;
- int8_tArray* preimages_vals = (void*) preimages->elems /* XXX preimages leaks */;
+ int8_tArray* preimages_vals = (void*) preimages->elems;
for (size_t m = 0; m < preimages_constr.datalen; m++) {
int8_tArray preimages_conv_12 = preimages_vals[m];
LDKThirtyTwoBytes preimages_conv_12_ref;
memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
preimages_constr.data[m] = preimages_conv_12_ref;
}
+ FREE(preimages);
LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
*ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
return (uint32_t)ret_conv;
preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
else
preimages_constr.data = NULL;
- int8_tArray* preimages_vals = (void*) preimages->elems /* XXX preimages leaks */;
+ int8_tArray* preimages_vals = (void*) preimages->elems;
for (size_t m = 0; m < preimages_constr.datalen; m++) {
int8_tArray preimages_conv_12 = preimages_vals[m];
LDKThirtyTwoBytes preimages_conv_12_ref;
memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
preimages_constr.data[m] = preimages_conv_12_ref;
}
+ FREE(preimages);
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, &commitment_tx_conv, preimages_constr);
return (uint32_t)ret_conv;
}
LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 15);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 15);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
if (monitor_var.is_owned) {
monitor_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 16, (uint32_t)funding_txo_ref, (uint32_t)monitor_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 16, (uint32_t)funding_txo_ref, (uint32_t)monitor_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
if (update_var.is_owned) {
update_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 17, (uint32_t)funding_txo_ref, (uint32_t)update_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 17, (uint32_t)funding_txo_ref, (uint32_t)update_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
}
LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_0(j_calls->instance_ptr, 18);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_(j_calls->instance_ptr, 18);
LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t m = 0; m < ret_constr.datalen; m++) {
uint32_t ret_conv_38 = ret_vals[m];
void* ret_conv_38_ptr = (void*)(((uintptr_t)ret_conv_38) & ~1);
FREE((void*)ret_conv_38);
ret_constr.data[m] = ret_conv_38_conv;
}
+ FREE(ret);
return ret_constr;
}
static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__);
memcpy(tx_arr->elems, tx_var.data, tx_var.datalen);
Transaction_free(tx_var);
- js_invoke_function_1(j_calls->instance_ptr, 19, (uint32_t)tx_arr);
+ js_invoke_function_u_u(j_calls->instance_ptr, 19, (uint32_t)tx_arr);
}
static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
uint32_t recipient_conv = LDKRecipient_to_js(recipient);
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 20, (uint32_t)recipient_conv);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 20, (uint32_t)recipient_conv);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
}
LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 21);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 21);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
}
LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- uint32_t ret = js_invoke_function_0(j_calls->instance_ptr, 22);
+ uint32_t ret = js_invoke_function_u_(j_calls->instance_ptr, 22);
LDKShutdownScript ret_conv;
ret_conv.inner = (void*)(ret & (~1));
ret_conv.is_owned = (ret & 1) || (ret == 0);
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
jboolean inbound_conv = inbound;
int64_t channel_value_satoshis_conv = channel_value_satoshis;
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 23, (uint32_t)inbound_conv, (uint32_t)channel_value_satoshis_conv);
+ uint32_t ret = js_invoke_function_u_bb(j_calls->instance_ptr, 23, (uint32_t)inbound_conv, (uint32_t)channel_value_satoshis_conv);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKSign ret_conv = *(LDKSign*)(ret_ptr);
}
LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 24);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 24);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
LDKu8slice reader_var = reader;
int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 25, (uint32_t)reader_arr);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 25, (uint32_t)reader_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
FREE(invoice_data_var.data);
uint32_t receipient_conv = LDKRecipient_to_js(receipient);
- uint32_t ret = js_invoke_function_3(j_calls->instance_ptr, 26, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, (uint32_t)receipient_conv);
+ uint32_t ret = js_invoke_function_u_uuu(j_calls->instance_ptr, 26, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, (uint32_t)receipient_conv);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
}
LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 27);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 27);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKu8slice reader_ref;
reader_ref.datalen = reader->arr_len;
- reader_ref.data = reader->elems /* XXX reader leaks */;
+ reader_ref.data = reader->elems;
LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
*ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
+ FREE(reader);
return (uint32_t)ret_conv;
}
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKu8slice hrp_bytes_ref;
hrp_bytes_ref.datalen = hrp_bytes->arr_len;
- hrp_bytes_ref.data = hrp_bytes->elems /* XXX hrp_bytes leaks */;
+ hrp_bytes_ref.data = hrp_bytes->elems;
LDKCVec_u5Z invoice_data_constr;
invoice_data_constr.datalen = invoice_data->arr_len;
if (invoice_data_constr.datalen > 0)
invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
else
invoice_data_constr.data = NULL;
- int8_t* invoice_data_vals = (void*) invoice_data->elems /* XXX invoice_data leaks */;
+ int8_t* invoice_data_vals = (void*) invoice_data->elems;
for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
int8_t invoice_data_conv_7 = invoice_data_vals[h];
invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
}
+ FREE(invoice_data);
LDKRecipient receipient_conv = LDKRecipient_from_js(receipient);
LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
*ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
+ FREE(hrp_bytes);
return (uint32_t)ret_conv;
}
uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
- return js_invoke_function_1(j_calls->instance_ptr, 28, (uint32_t)confirmation_target_conv);
+ return js_invoke_function_u_u(j_calls->instance_ptr, 28, (uint32_t)confirmation_target_conv);
}
static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
}
uint16_t type_id_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- return js_invoke_function_0(j_calls->instance_ptr, 29);
+ return js_invoke_function_u_(j_calls->instance_ptr, 29);
}
LDKStr debug_str_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- jstring ret = (jstring)js_invoke_function_0(j_calls->instance_ptr, 30);
+ jstring ret = (jstring)js_invoke_function_u_(j_calls->instance_ptr, 30);
LDKStr ret_conv = str_ref_to_owned_c(ret);
return ret_conv;
}
LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 31);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 31);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
LDKu8slice script_pubkey_var = script_pubkey;
int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__);
memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen);
- js_invoke_function_2(j_calls->instance_ptr, 32, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 32, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr);
}
LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
if (output_var.is_owned) {
output_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 33, (uint32_t)output_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 33, (uint32_t)output_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
unsigned char (*txid_ref)[32] = &txid_arr;
LDKu8slice script_pubkey_ref;
script_pubkey_ref.datalen = script_pubkey->arr_len;
- script_pubkey_ref.data = script_pubkey->elems /* XXX script_pubkey leaks */;
+ script_pubkey_ref.data = script_pubkey->elems;
(this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
+ FREE(script_pubkey);
}
uint32_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint32_t this_arg, uint32_t output) {
}
LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_0(j_calls->instance_ptr, 34);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_(j_calls->instance_ptr, 34);
LDKCVec_MessageSendEventZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t s = 0; s < ret_constr.datalen; s++) {
uint32_t ret_conv_18 = ret_vals[s];
void* ret_conv_18_ptr = (void*)(((uintptr_t)ret_conv_18) & ~1);
FREE((void*)ret_conv_18);
ret_constr.data[s] = ret_conv_18_conv;
}
+ FREE(ret);
return ret_constr;
}
static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
*ret_event = Event_clone(event);
- js_invoke_function_1(j_calls->instance_ptr, 35, (uint32_t)(uint32_t)ret_event);
+ js_invoke_function_u_u(j_calls->instance_ptr, 35, (uint32_t)(uint32_t)ret_event);
}
static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*handler_ret = handler;
- js_invoke_function_1(j_calls->instance_ptr, 36, (uint32_t)(uint32_t)handler_ret);
+ js_invoke_function_u_u(j_calls->instance_ptr, 36, (uint32_t)(uint32_t)handler_ret);
}
static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
if (usage_var.is_owned) {
usage_ref |= 1;
}
- return js_invoke_function_4(j_calls->instance_ptr, 37, (uint32_t)short_channel_id_conv, (uint32_t)source_ref, (uint32_t)target_ref, (uint32_t)usage_ref);
+ return js_invoke_function_b_uuuu(j_calls->instance_ptr, 37, (uint32_t)short_channel_id_conv, (uint32_t)source_ref, (uint32_t)target_ref, (uint32_t)usage_ref);
}
void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
FREE(path_var.data);
int64_t short_channel_id_conv = short_channel_id;
- js_invoke_function_2(j_calls->instance_ptr, 38, (uint32_t)path_arr, (uint32_t)short_channel_id_conv);
+ js_invoke_function_u_bb(j_calls->instance_ptr, 38, (uint32_t)path_arr, (uint32_t)short_channel_id_conv);
}
void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
}
FREE(path_var.data);
- js_invoke_function_1(j_calls->instance_ptr, 39, (uint32_t)path_arr);
+ js_invoke_function_u_u(j_calls->instance_ptr, 39, (uint32_t)path_arr);
}
LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 40);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 40);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
path_constr.data = NULL;
- uint32_t* path_vals = path->elems /* XXX path leaks */;
+ uint32_t* path_vals = path->elems;
for (size_t k = 0; k < path_constr.datalen; k++) {
uint32_t path_conv_10 = path_vals[k];
LDKRouteHop path_conv_10_conv;
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
+ FREE(path);
(this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
}
path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
path_constr.data = NULL;
- uint32_t* path_vals = path->elems /* XXX path leaks */;
+ uint32_t* path_vals = path->elems;
for (size_t k = 0; k < path_constr.datalen; k++) {
uint32_t path_conv_10 = path_vals[k];
LDKRouteHop path_conv_10_conv;
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
+ FREE(path);
(this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
}
if (channel_manager_var.is_owned) {
channel_manager_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 41, (uint32_t)channel_manager_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 41, (uint32_t)channel_manager_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
if (network_graph_var.is_owned) {
network_graph_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 42, (uint32_t)network_graph_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 42, (uint32_t)network_graph_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
if (scorer_var.is_owned) {
scorer_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 43, (uint32_t)scorer_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 43, (uint32_t)scorer_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
FREE(txdata_var.data);
int32_t height_conv = height;
- js_invoke_function_3(j_calls->instance_ptr, 44, (uint32_t)header_arr, (uint32_t)txdata_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 44, (uint32_t)header_arr, (uint32_t)txdata_arr, (uint32_t)height_conv);
}
void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__);
memcpy(block_arr->elems, block_var.data, block_var.datalen);
int32_t height_conv = height;
- js_invoke_function_2(j_calls->instance_ptr, 45, (uint32_t)block_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 45, (uint32_t)block_arr, (uint32_t)height_conv);
}
void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
int8_tArray header_arr = init_int8_tArray(80, __LINE__);
memcpy(header_arr->elems, *header, 80);
int32_t height_conv = height;
- js_invoke_function_2(j_calls->instance_ptr, 46, (uint32_t)header_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 46, (uint32_t)header_arr, (uint32_t)height_conv);
}
static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
txdata_constr.data = NULL;
- uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */;
+ uint32_t* txdata_vals = txdata->elems;
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
+ FREE(txdata);
(this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
}
LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
LDKu8slice block_ref;
block_ref.datalen = block->arr_len;
- block_ref.data = block->elems /* XXX block leaks */;
+ block_ref.data = block->elems;
(this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
+ FREE(block);
}
void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint32_t this_arg, int8_tArray header, int32_t height) {
FREE(txdata_var.data);
int32_t height_conv = height;
- js_invoke_function_3(j_calls->instance_ptr, 47, (uint32_t)header_arr, (uint32_t)txdata_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 47, (uint32_t)header_arr, (uint32_t)txdata_arr, (uint32_t)height_conv);
}
void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
memcpy(txid_arr->elems, *txid, 32);
- js_invoke_function_1(j_calls->instance_ptr, 48, (uint32_t)txid_arr);
+ js_invoke_function_u_u(j_calls->instance_ptr, 48, (uint32_t)txid_arr);
}
void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
int8_tArray header_arr = init_int8_tArray(80, __LINE__);
memcpy(header_arr->elems, *header, 80);
int32_t height_conv = height;
- js_invoke_function_2(j_calls->instance_ptr, 49, (uint32_t)header_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 49, (uint32_t)header_arr, (uint32_t)height_conv);
}
LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
- ptrArray ret = (ptrArray)js_invoke_function_0(j_calls->instance_ptr, 50);
+ ptrArray ret = (ptrArray)js_invoke_function_u_(j_calls->instance_ptr, 50);
LDKCVec_TxidZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
else
ret_constr.data = NULL;
- int8_tArray* ret_vals = (void*) ret->elems /* XXX ret leaks */;
+ int8_tArray* ret_vals = (void*) ret->elems;
for (size_t m = 0; m < ret_constr.datalen; m++) {
int8_tArray ret_conv_12 = ret_vals[m];
LDKThirtyTwoBytes ret_conv_12_ref;
memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12);
ret_constr.data[m] = ret_conv_12_ref;
}
+ FREE(ret);
return ret_constr;
}
static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
txdata_constr.data = NULL;
- uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */;
+ uint32_t* txdata_vals = txdata->elems;
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
+ FREE(txdata);
(this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
}
if (update_id_var.is_owned) {
update_id_ref |= 1;
}
- uint32_t ret = js_invoke_function_3(j_calls->instance_ptr, 51, (uint32_t)channel_id_ref, (uint32_t)data_ref, (uint32_t)update_id_ref);
+ uint32_t ret = js_invoke_function_u_uuu(j_calls->instance_ptr, 51, (uint32_t)channel_id_ref, (uint32_t)data_ref, (uint32_t)update_id_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
if (update_id_var.is_owned) {
update_id_ref |= 1;
}
- uint32_t ret = js_invoke_function_4(j_calls->instance_ptr, 52, (uint32_t)channel_id_ref, (uint32_t)update_ref, (uint32_t)data_ref, (uint32_t)update_id_ref);
+ uint32_t ret = js_invoke_function_u_uuuu(j_calls->instance_ptr, 52, (uint32_t)channel_id_ref, (uint32_t)update_ref, (uint32_t)data_ref, (uint32_t)update_id_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_3(j_calls->instance_ptr, 53, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 53, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
}
void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_3(j_calls->instance_ptr, 54, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 54, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
}
void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 55, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 55, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 56, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 56, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 57, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 57, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_3(j_calls->instance_ptr, 58, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 58, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
}
void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 59, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 59, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
jboolean no_connection_possible_conv = no_connection_possible;
- js_invoke_function_2(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, (uint32_t)no_connection_possible_conv);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, (uint32_t)no_connection_possible_conv);
}
void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 73, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 73, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 74, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 74, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 75, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 75, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int64_t starting_point_conv = starting_point;
int8_t batch_amount_conv = batch_amount;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_2(j_calls->instance_ptr, 76, (uint32_t)starting_point_conv, (uint32_t)batch_amount_conv);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_uu(j_calls->instance_ptr, 76, (uint32_t)starting_point_conv, (uint32_t)batch_amount_conv);
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t h = 0; h < ret_constr.datalen; h++) {
uint32_t ret_conv_59 = ret_vals[h];
void* ret_conv_59_ptr = (void*)(((uintptr_t)ret_conv_59) & ~1);
FREE((void*)ret_conv_59);
ret_constr.data[h] = ret_conv_59_conv;
}
+ FREE(ret);
return ret_constr;
}
LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__);
memcpy(starting_point_arr->elems, starting_point.compressed_form, 33);
int8_t batch_amount_conv = batch_amount;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_2(j_calls->instance_ptr, 77, (uint32_t)starting_point_arr, (uint32_t)batch_amount_conv);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_uu(j_calls->instance_ptr, 77, (uint32_t)starting_point_arr, (uint32_t)batch_amount_conv);
LDKCVec_NodeAnnouncementZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t s = 0; s < ret_constr.datalen; s++) {
uint32_t ret_conv_18 = ret_vals[s];
LDKNodeAnnouncement ret_conv_18_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv);
ret_constr.data[s] = ret_conv_18_conv;
}
+ FREE(ret);
return ret_constr;
}
void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
if (init_var.is_owned) {
init_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, (uint32_t)init_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, (uint32_t)init_ref);
}
LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
LDKu8slice buffer_var = buffer;
int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 83, (uint32_t)message_type_conv, (uint32_t)buffer_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 83, (uint32_t)message_type_conv, (uint32_t)buffer_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
LDKu8slice buffer_ref;
buffer_ref.datalen = buffer->arr_len;
- buffer_ref.data = buffer->elems /* XXX buffer leaks */;
+ buffer_ref.data = buffer->elems;
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
+ FREE(buffer);
return (uint32_t)ret_conv;
}
*msg_ret = msg;
int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 84, (uint32_t)(uint32_t)msg_ret, (uint32_t)sender_node_id_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 84, (uint32_t)(uint32_t)msg_ret, (uint32_t)sender_node_id_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
}
LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_0(j_calls->instance_ptr, 85);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_(j_calls->instance_ptr, 85);
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t z = 0; z < ret_constr.datalen; z++) {
uint32_t ret_conv_25 = ret_vals[z];
void* ret_conv_25_ptr = (void*)(((uintptr_t)ret_conv_25) & ~1);
FREE((void*)ret_conv_25);
ret_constr.data[z] = ret_conv_25_conv;
}
+ FREE(ret);
return ret_constr;
}
static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__);
memcpy(data_arr->elems, data_var.data, data_var.datalen);
jboolean resume_read_conv = resume_read;
- return js_invoke_function_2(j_calls->instance_ptr, 86, (uint32_t)data_arr, (uint32_t)resume_read_conv);
+ return js_invoke_function_u_uu(j_calls->instance_ptr, 86, (uint32_t)data_arr, (uint32_t)resume_read_conv);
}
void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- js_invoke_function_0(j_calls->instance_ptr, 87);
+ js_invoke_function_u_(j_calls->instance_ptr, 87);
}
bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*other_arg_clone = SocketDescriptor_clone(other_arg);
- return js_invoke_function_1(j_calls->instance_ptr, 88, (uint32_t)(uint32_t)other_arg_clone);
+ return js_invoke_function_u_u(j_calls->instance_ptr, 88, (uint32_t)(uint32_t)other_arg_clone);
}
uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- return js_invoke_function_0(j_calls->instance_ptr, 89);
+ return js_invoke_function_b_(j_calls->instance_ptr, 89);
}
static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
LDKu8slice data_ref;
data_ref.datalen = data->arr_len;
- data_ref.data = data->elems /* XXX data leaks */;
+ data_ref.data = data->elems;
uint32_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
+ FREE(data);
return ret_conv;
}
}
LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
- uint32_t ret = js_invoke_function_0(j_calls->instance_ptr, 90);
+ uint32_t ret = js_invoke_function_u_(j_calls->instance_ptr, 90);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKScore ret_conv = *(LDKScore*)(ret_ptr);
}
LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 91);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 91);
LDKPublicKey ret_ref;
CHECK(ret->arr_len == 33);
memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
}
LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_0(j_calls->instance_ptr, 92);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_(j_calls->instance_ptr, 92);
LDKCVec_ChannelDetailsZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t q = 0; q < ret_constr.datalen; q++) {
uint32_t ret_conv_16 = ret_vals[q];
LDKChannelDetails ret_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
ret_constr.data[q] = ret_conv_16_conv;
}
+ FREE(ret);
return ret_constr;
}
LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
memcpy(payment_hash_arr->elems, payment_hash.data, 32);
int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
memcpy(payment_secret_arr->elems, payment_secret.data, 32);
- uint32_t ret = js_invoke_function_3(j_calls->instance_ptr, 93, (uint32_t)route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr);
+ uint32_t ret = js_invoke_function_u_uuu(j_calls->instance_ptr, 93, (uint32_t)route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
}
int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
memcpy(payment_preimage_arr->elems, payment_preimage.data, 32);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 94, (uint32_t)route_ref, (uint32_t)payment_preimage_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 94, (uint32_t)route_ref, (uint32_t)payment_preimage_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
}
int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
memcpy(payment_id_arr->elems, payment_id.data, 32);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 95, (uint32_t)route_ref, (uint32_t)payment_id_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 95, (uint32_t)route_ref, (uint32_t)payment_id_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
memcpy(payment_id_arr->elems, payment_id.data, 32);
- js_invoke_function_1(j_calls->instance_ptr, 96, (uint32_t)payment_id_arr);
+ js_invoke_function_u_u(j_calls->instance_ptr, 96, (uint32_t)payment_id_arr);
}
static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
}
// WARNING: This object doesn't live past this scope, needs clone!
uint32_t ret_scorer = ((uintptr_t)scorer) | 1;
- uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 97, (uint32_t)payer_arr, (uint32_t)route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, (uint32_t)ret_scorer);
+ uint32_t ret = js_invoke_function_u_uuuuu(j_calls->instance_ptr, 97, (uint32_t)payer_arr, (uint32_t)route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, (uint32_t)ret_scorer);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
first_hops_constr.data = NULL;
- uint32_t* first_hops_vals = first_hops->elems /* XXX first_hops leaks */;
+ uint32_t* first_hops_vals = first_hops->elems;
for (size_t q = 0; q < first_hops_constr.datalen; q++) {
uint32_t first_hops_conv_16 = first_hops_vals[q];
LDKChannelDetails first_hops_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
first_hops_constr.data[q] = first_hops_conv_16_conv;
}
+ FREE(first_hops);
first_hops_ptr = &first_hops_constr;
}
void* scorer_ptr = (void*)(((uintptr_t)scorer) & ~1);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKSignature _res_conv_12_ref;
memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_SignatureZ_free(_res_constr);
}
o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
o_constr.data = NULL;
- int8_tArray* o_vals = (void*) o->elems /* XXX o leaks */;
+ int8_tArray* o_vals = (void*) o->elems;
for (size_t m = 0; m < o_constr.datalen; m++) {
int8_tArray o_conv_12 = o_vals[m];
LDKSignature o_conv_12_ref;
memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12);
o_constr.data[m] = o_conv_12_ref;
}
+ FREE(o);
LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
*ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
return (uint32_t)ret_conv;
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t k = 0; k < _res_constr.datalen; k++) {
uint32_t _res_conv_10 = _res_vals[k];
LDKRouteHop _res_conv_10_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
_res_constr.data[k] = _res_conv_10_conv;
}
+ FREE(_res);
CVec_RouteHopZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
else
_res_constr.data = NULL;
- uint32_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ uint32_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
uint32_tArray _res_conv_12 = _res_vals[m];
LDKCVec_RouteHopZ _res_conv_12_constr;
_res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
_res_conv_12_constr.data = NULL;
- uint32_t* _res_conv_12_vals = _res_conv_12->elems /* XXX _res_conv_12 leaks */;
+ uint32_t* _res_conv_12_vals = _res_conv_12->elems;
for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
uint32_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
LDKRouteHop _res_conv_12_conv_10_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
_res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
}
+ FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_constr;
}
+ FREE(_res);
CVec_CVec_RouteHopZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t l = 0; l < _res_constr.datalen; l++) {
uint32_t _res_conv_11 = _res_vals[l];
LDKRouteHint _res_conv_11_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
_res_constr.data[l] = _res_conv_11_conv;
}
+ FREE(_res);
CVec_RouteHintZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_14 = _res_vals[o];
LDKRouteHintHop _res_conv_14_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
_res_constr.data[o] = _res_conv_14_conv;
}
+ FREE(_res);
CVec_RouteHintHopZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t q = 0; q < _res_constr.datalen; q++) {
uint32_t _res_conv_16 = _res_vals[q];
LDKChannelDetails _res_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
_res_constr.data[q] = _res_conv_16_conv;
}
+ FREE(_res);
CVec_ChannelDetailsZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKPublicKey _res_conv_12_ref;
memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_PublicKeyZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t b = 0; b < _res_constr.datalen; b++) {
uint32_t _res_conv_27 = _res_vals[b];
void* _res_conv_27_ptr = (void*)(((uintptr_t)_res_conv_27) & ~1);
FREE((void*)_res_conv_27);
_res_constr.data[b] = _res_conv_27_conv;
}
+ FREE(_res);
CVec_SpendableOutputDescriptorZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t s = 0; s < _res_constr.datalen; s++) {
uint32_t _res_conv_18 = _res_vals[s];
void* _res_conv_18_ptr = (void*)(((uintptr_t)_res_conv_18) & ~1);
FREE((void*)_res_conv_18);
_res_constr.data[s] = _res_conv_18_conv;
}
+ FREE(_res);
CVec_MessageSendEventZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t c = 0; c < _res_constr.datalen; c++) {
uint32_t _res_conv_28 = _res_vals[c];
void* _res_conv_28_ptr = (void*)(((uintptr_t)_res_conv_28) & ~1);
FREE((void*)_res_conv_28);
_res_constr.data[c] = _res_conv_28_conv;
}
+ FREE(_res);
CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKThirtyTwoBytes _res_conv_12_ref;
memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_TxidZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_14 = _res_vals[o];
void* _res_conv_14_ptr = (void*)(((uintptr_t)_res_conv_14) & ~1);
FREE((void*)_res_conv_14);
_res_constr.data[o] = _res_conv_14_conv;
}
+ FREE(_res);
CVec_MonitorEventZ_free(_res_constr);
}
b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
else
b_constr.data = NULL;
- uint32_t* b_vals = b->elems /* XXX b leaks */;
+ uint32_t* b_vals = b->elems;
for (size_t o = 0; o < b_constr.datalen; o++) {
uint32_t b_conv_14 = b_vals[o];
void* b_conv_14_ptr = (void*)(((uintptr_t)b_conv_14) & ~1);
b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)b_conv_14) & ~1));
b_constr.data[o] = b_conv_14_conv;
}
+ FREE(b);
LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ");
*ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_new(a_conv, b_constr);
return ((uint32_t)ret_conv);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
uint32_t _res_conv_38 = _res_vals[m];
void* _res_conv_38_ptr = (void*)(((uintptr_t)_res_conv_38) & ~1);
FREE((void*)_res_conv_38);
_res_constr.data[m] = _res_conv_38_conv;
}
+ FREE(_res);
CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_59 = _res_vals[h];
void* _res_conv_59_ptr = (void*)(((uintptr_t)_res_conv_59) & ~1);
FREE((void*)_res_conv_59);
_res_constr.data[h] = _res_conv_59_conv;
}
+ FREE(_res);
CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t s = 0; s < _res_constr.datalen; s++) {
uint32_t _res_conv_18 = _res_vals[s];
LDKNodeAnnouncement _res_conv_18_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv);
_res_constr.data[s] = _res_conv_18_conv;
}
+ FREE(_res);
CVec_NodeAnnouncementZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
uint32_t _res_conv_12 = _res_vals[m];
void* _res_conv_12_ptr = (void*)(((uintptr_t)_res_conv_12) & ~1);
FREE((void*)_res_conv_12);
_res_constr.data[m] = _res_conv_12_conv;
}
+ FREE(_res);
CVec_NetAddressZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
_res_constr.data = NULL;
- int64_t* _res_vals = _res->elems /* XXX _res leaks */;
+ int64_t* _res_vals = _res->elems;
for (size_t i = 0; i < _res_constr.datalen; i++) {
int64_t _res_conv_8 = _res_vals[i];
_res_constr.data[i] = _res_conv_8;
}
+ FREE(_res);
CVec_u64Z_free(_res_constr);
}
o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
o_constr.data = NULL;
- uint32_t* o_vals = o->elems /* XXX o leaks */;
+ uint32_t* o_vals = o->elems;
for (size_t m = 0; m < o_constr.datalen; m++) {
uint32_t o_conv_12 = o_vals[m];
void* o_conv_12_ptr = (void*)(((uintptr_t)o_conv_12) & ~1);
o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o_conv_12) & ~1));
o_constr.data[m] = o_conv_12_conv;
}
+ FREE(o);
LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
*ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKThirtyTwoBytes _res_conv_12_ref;
memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_PaymentPreimageZ_free(_res_constr);
}
b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
b_constr.data = NULL;
- int8_tArray* b_vals = (void*) b->elems /* XXX b leaks */;
+ int8_tArray* b_vals = (void*) b->elems;
for (size_t m = 0; m < b_constr.datalen; m++) {
int8_tArray b_conv_12 = b_vals[m];
LDKSignature b_conv_12_ref;
memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12);
b_constr.data[m] = b_conv_12_ref;
}
+ FREE(b);
LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
*ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
return ((uint32_t)ret_conv);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
else
_res_constr.data = NULL;
- int8_t* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_t* _res_vals = (void*) _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
int8_t _res_conv_7 = _res_vals[h];
_res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
}
+ FREE(_res);
CVec_u5Z_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKCVec_u8Z _res_conv_12_ref;
memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_CVec_u8ZZ_free(_res_constr);
}
o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
else
o_constr.data = NULL;
- int8_tArray* o_vals = (void*) o->elems /* XXX o leaks */;
+ int8_tArray* o_vals = (void*) o->elems;
for (size_t m = 0; m < o_constr.datalen; m++) {
int8_tArray o_conv_12 = o_vals[m];
LDKCVec_u8Z o_conv_12_ref;
memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12);
o_constr.data[m] = o_conv_12_ref;
}
+ FREE(o);
LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
*ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
return (uint32_t)ret_conv;
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_7 = _res_vals[h];
void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
+ FREE(_res);
CVec_TxOutZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t w = 0; w < _res_constr.datalen; w++) {
uint32_t _res_conv_22 = _res_vals[w];
void* _res_conv_22_ptr = (void*)(((uintptr_t)_res_conv_22) & ~1);
FREE((void*)_res_conv_22);
_res_constr.data[w] = _res_conv_22_conv;
}
+ FREE(_res);
CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t k = 0; k < _res_constr.datalen; k++) {
uint32_t _res_conv_10 = _res_vals[k];
void* _res_conv_10_ptr = (void*)(((uintptr_t)_res_conv_10) & ~1);
FREE((void*)_res_conv_10);
_res_constr.data[k] = _res_conv_10_conv;
}
+ FREE(_res);
CVec_APIErrorZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t q = 0; q < _res_constr.datalen; q++) {
uint32_t _res_conv_16 = _res_vals[q];
LDKChannelMonitor _res_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
_res_constr.data[q] = _res_conv_16_conv;
}
+ FREE(_res);
CVec_ChannelMonitorZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_14 = _res_vals[o];
LDKPrivateRoute _res_conv_14_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
_res_constr.data[o] = _res_conv_14_conv;
}
+ FREE(_res);
CVec_PrivateRouteZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t v = 0; v < _res_constr.datalen; v++) {
uint32_t _res_conv_21 = _res_vals[v];
void* _res_conv_21_ptr = (void*)(((uintptr_t)_res_conv_21) & ~1);
FREE((void*)_res_conv_21);
_res_constr.data[v] = _res_conv_21_conv;
}
+ FREE(_res);
CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
}
b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
else
b_constr.data = NULL;
- uint32_t* b_vals = b->elems /* XXX b leaks */;
+ uint32_t* b_vals = b->elems;
for (size_t v = 0; v < b_constr.datalen; v++) {
uint32_t b_conv_21 = b_vals[v];
void* b_conv_21_ptr = (void*)(((uintptr_t)b_conv_21) & ~1);
b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uintptr_t)b_conv_21) & ~1));
b_constr.data[v] = b_conv_21_conv;
}
+ FREE(b);
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
*ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
return ((uint32_t)ret_conv);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_40 = _res_vals[o];
void* _res_conv_40_ptr = (void*)(((uintptr_t)_res_conv_40) & ~1);
FREE((void*)_res_conv_40);
_res_constr.data[o] = _res_conv_40_conv;
}
+ FREE(_res);
CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_7 = _res_vals[h];
void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
+ FREE(_res);
CVec_EventZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKTransaction _res_conv_12_ref;
_res_conv_12_ref.data_is_owned = true;
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_TransactionZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t u = 0; u < _res_constr.datalen; u++) {
uint32_t _res_conv_20 = _res_vals[u];
void* _res_conv_20_ptr = (void*)(((uintptr_t)_res_conv_20) & ~1);
FREE((void*)_res_conv_20);
_res_constr.data[u] = _res_conv_20_conv;
}
+ FREE(_res);
CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
}
b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
else
b_constr.data = NULL;
- uint32_t* b_vals = b->elems /* XXX b leaks */;
+ uint32_t* b_vals = b->elems;
for (size_t u = 0; u < b_constr.datalen; u++) {
uint32_t b_conv_20 = b_vals[u];
void* b_conv_20_ptr = (void*)(((uintptr_t)b_conv_20) & ~1);
b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uintptr_t)b_conv_20) & ~1));
b_constr.data[u] = b_conv_20_conv;
}
+ FREE(b);
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
return ((uint32_t)ret_conv);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t n = 0; n < _res_constr.datalen; n++) {
uint32_t _res_conv_39 = _res_vals[n];
void* _res_conv_39_ptr = (void*)(((uintptr_t)_res_conv_39) & ~1);
FREE((void*)_res_conv_39);
_res_constr.data[n] = _res_conv_39_conv;
}
+ FREE(_res);
CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t j = 0; j < _res_constr.datalen; j++) {
uint32_t _res_conv_9 = _res_vals[j];
void* _res_conv_9_ptr = (void*)(((uintptr_t)_res_conv_9) & ~1);
FREE((void*)_res_conv_9);
_res_constr.data[j] = _res_conv_9_conv;
}
+ FREE(_res);
CVec_BalanceZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t z = 0; z < _res_constr.datalen; z++) {
uint32_t _res_conv_25 = _res_vals[z];
void* _res_conv_25_ptr = (void*)(((uintptr_t)_res_conv_25) & ~1);
FREE((void*)_res_conv_25);
_res_constr.data[z] = _res_conv_25_conv;
}
+ FREE(_res);
CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t p = 0; p < _res_constr.datalen; p++) {
uint32_t _res_conv_15 = _res_vals[p];
LDKUpdateAddHTLC _res_conv_15_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
_res_constr.data[p] = _res_conv_15_conv;
}
+ FREE(_res);
CVec_UpdateAddHTLCZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t t = 0; t < _res_constr.datalen; t++) {
uint32_t _res_conv_19 = _res_vals[t];
LDKUpdateFulfillHTLC _res_conv_19_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
_res_constr.data[t] = _res_conv_19_conv;
}
+ FREE(_res);
CVec_UpdateFulfillHTLCZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t q = 0; q < _res_constr.datalen; q++) {
uint32_t _res_conv_16 = _res_vals[q];
LDKUpdateFailHTLC _res_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
_res_constr.data[q] = _res_conv_16_conv;
}
+ FREE(_res);
CVec_UpdateFailHTLCZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t z = 0; z < _res_constr.datalen; z++) {
uint32_t _res_conv_25 = _res_vals[z];
LDKUpdateFailMalformedHTLC _res_conv_25_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
_res_constr.data[z] = _res_conv_25_conv;
}
+ FREE(_res);
CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t k = 0; k < _res_constr.datalen; k++) {
uint32_t _res_conv_10 = _res_vals[k];
LDKOutPoint _res_conv_10_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
_res_constr.data[k] = _res_conv_10_conv;
}
+ FREE(_res);
CVec_OutPointZ_free(_res_constr);
}
uint32_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
*ret_conv = PaymentPurpose_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
*ret_conv = ClosureReason_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
path_constr.data = NULL;
- uint32_t* path_vals = path->elems /* XXX path leaks */;
+ uint32_t* path_vals = path->elems;
for (size_t k = 0; k < path_constr.datalen; k++) {
uint32_t path_conv_10 = path_vals[k];
LDKRouteHop path_conv_10_conv;
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
+ FREE(path);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
path_constr.data = NULL;
- uint32_t* path_vals = path->elems /* XXX path leaks */;
+ uint32_t* path_vals = path->elems;
for (size_t k = 0; k < path_constr.datalen; k++) {
uint32_t path_conv_10 = path_vals[k];
LDKRouteHop path_conv_10_conv;
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
+ FREE(path);
void* short_channel_id_ptr = (void*)(((uintptr_t)short_channel_id) & ~1);
CHECK_ACCESS(short_channel_id_ptr);
LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
else
outputs_constr.data = NULL;
- uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */;
+ uint32_t* outputs_vals = outputs->elems;
for (size_t b = 0; b < outputs_constr.datalen; b++) {
uint32_t outputs_conv_27 = outputs_vals[b];
void* outputs_conv_27_ptr = (void*)(((uintptr_t)outputs_conv_27) & ~1);
outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)outputs_conv_27) & ~1));
outputs_constr.data[b] = outputs_conv_27_conv;
}
+ FREE(outputs);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_spendable_outputs(outputs_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
uint32_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
*ret_conv = Event_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) {
LDKu8slice msg_ref;
msg_ref.datalen = msg->arr_len;
- msg_ref.data = msg->elems /* XXX msg leaks */;
+ msg_ref.data = msg->elems;
unsigned char sk_arr[32];
CHECK(sk->arr_len == 32);
memcpy(sk_arr, sk->elems, 32); FREE(sk);
unsigned char (*sk_ref)[32] = &sk_arr;
LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
*ret_conv = sign(msg_ref, sk_ref);
+ FREE(msg);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) {
LDKu8slice msg_ref;
msg_ref.datalen = msg->arr_len;
- msg_ref.data = msg->elems /* XXX msg leaks */;
+ msg_ref.data = msg->elems;
LDKStr sig_conv = str_ref_to_owned_c(sig);
LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
*ret_conv = recover_pk(msg_ref, sig_conv);
+ FREE(msg);
return (uint32_t)ret_conv;
}
jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) {
LDKu8slice msg_ref;
msg_ref.datalen = msg->arr_len;
- msg_ref.data = msg->elems /* XXX msg leaks */;
+ msg_ref.data = msg->elems;
LDKStr sig_conv = str_ref_to_owned_c(sig);
LDKPublicKey pk_ref;
CHECK(pk->arr_len == 33);
memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk);
jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
+ FREE(msg);
return ret_conv;
}
int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) {
LDKu8slice hrp_bytes_ref;
hrp_bytes_ref.datalen = hrp_bytes->arr_len;
- hrp_bytes_ref.data = hrp_bytes->elems /* XXX hrp_bytes leaks */;
+ hrp_bytes_ref.data = hrp_bytes->elems;
LDKCVec_u5Z data_without_signature_constr;
data_without_signature_constr.datalen = data_without_signature->arr_len;
if (data_without_signature_constr.datalen > 0)
data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
else
data_without_signature_constr.data = NULL;
- int8_t* data_without_signature_vals = (void*) data_without_signature->elems /* XXX data_without_signature leaks */;
+ int8_t* data_without_signature_vals = (void*) data_without_signature->elems;
for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
}
+ FREE(data_without_signature);
LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
CVec_u8Z_free(ret_var);
+ FREE(hrp_bytes);
return ret_arr;
}
uint32_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
*ret_conv = ChannelConfig_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
ignored_channels_constr.data = NULL;
- uint32_t* ignored_channels_vals = ignored_channels->elems /* XXX ignored_channels leaks */;
+ uint32_t* ignored_channels_vals = ignored_channels->elems;
for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
uint32_t ignored_channels_conv_16 = ignored_channels_vals[q];
LDKChannelDetails ignored_channels_conv_16_conv;
ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
}
+ FREE(ignored_channels);
LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
uint32_tArray ret_arr = NULL;
ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__);
uint32_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
*ret_conv = ChannelMonitorUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
*ret_conv = MonitorEvent_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
*ret_conv = HTLCUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
txdata_constr.data = NULL;
- uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */;
+ uint32_t* txdata_vals = txdata->elems;
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
+ FREE(txdata);
void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1);
CHECK_ACCESS(broadcaster_ptr);
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
txdata_constr.data = NULL;
- uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */;
+ uint32_t* txdata_vals = txdata->elems;
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
+ FREE(txdata);
void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1);
CHECK_ACCESS(broadcaster_ptr);
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint32_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
void* arg_ptr = (void*)(((uintptr_t)arg) & ~1);
if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
*ret_conv = OutPoint_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = SpendableOutputDescriptor_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, int8_tArray arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKSecretKey arg_ref;
CHECK(arg->arr_len == 32);
memcpy(arg_ref.bytes, arg->elems, 32); FREE(arg);
LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
*ret_conv = InMemorySigner_read(ser_ref, arg_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
else
descriptors_constr.data = NULL;
- uint32_t* descriptors_vals = descriptors->elems /* XXX descriptors leaks */;
+ uint32_t* descriptors_vals = descriptors->elems;
for (size_t b = 0; b < descriptors_constr.datalen; b++) {
uint32_t descriptors_conv_27 = descriptors_vals[b];
void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1);
descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1));
descriptors_constr.data[b] = descriptors_conv_27_conv;
}
+ FREE(descriptors);
LDKCVec_TxOutZ outputs_constr;
outputs_constr.datalen = outputs->arr_len;
if (outputs_constr.datalen > 0)
outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
else
outputs_constr.data = NULL;
- uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */;
+ uint32_t* outputs_vals = outputs->elems;
for (size_t h = 0; h < outputs_constr.datalen; h++) {
uint32_t outputs_conv_7 = outputs_vals[h];
void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1);
outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1));
outputs_constr.data[h] = outputs_conv_7_conv;
}
+ FREE(outputs);
LDKCVec_u8Z change_destination_script_ref;
change_destination_script_ref.datalen = change_destination_script->arr_len;
change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
else
descriptors_constr.data = NULL;
- uint32_t* descriptors_vals = descriptors->elems /* XXX descriptors leaks */;
+ uint32_t* descriptors_vals = descriptors->elems;
for (size_t b = 0; b < descriptors_constr.datalen; b++) {
uint32_t descriptors_conv_27 = descriptors_vals[b];
void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1);
descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1));
descriptors_constr.data[b] = descriptors_conv_27_conv;
}
+ FREE(descriptors);
LDKCVec_TxOutZ outputs_constr;
outputs_constr.datalen = outputs->arr_len;
if (outputs_constr.datalen > 0)
outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
else
outputs_constr.data = NULL;
- uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */;
+ uint32_t* outputs_vals = outputs->elems;
for (size_t h = 0; h < outputs_constr.datalen; h++) {
uint32_t outputs_conv_7 = outputs_vals[h];
void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1);
outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1));
outputs_constr.data[h] = outputs_conv_7_conv;
}
+ FREE(outputs);
LDKCVec_u8Z change_destination_script_ref;
change_destination_script_ref.datalen = change_destination_script->arr_len;
change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
a_constr.data = NULL;
- uint32_t* a_vals = a->elems /* XXX a leaks */;
+ uint32_t* a_vals = a->elems;
for (size_t w = 0; w < a_constr.datalen; w++) {
uint32_t a_conv_22 = a_vals[w];
void* a_conv_22_ptr = (void*)(((uintptr_t)a_conv_22) & ~1);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uintptr_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
+ FREE(a);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
*ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
else
a_constr.data = NULL;
- uint32_t* a_vals = a->elems /* XXX a leaks */;
+ uint32_t* a_vals = a->elems;
for (size_t k = 0; k < a_constr.datalen; k++) {
uint32_t a_conv_10 = a_vals[k];
void* a_conv_10_ptr = (void*)(((uintptr_t)a_conv_10) & ~1);
a_conv_10_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a_conv_10) & ~1));
a_constr.data[k] = a_conv_10_conv;
}
+ FREE(a);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
*ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
results_constr.data = NULL;
- uint32_t* results_vals = results->elems /* XXX results leaks */;
+ uint32_t* results_vals = results->elems;
for (size_t w = 0; w < results_constr.datalen; w++) {
uint32_t results_conv_22 = results_vals[w];
void* results_conv_22_ptr = (void*)(((uintptr_t)results_conv_22) & ~1);
LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
results_constr.data[w] = results_conv_22_conv;
}
+ FREE(results);
LDKRouteParameters failed_paths_retry_conv;
failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1));
failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0);
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t q = 0; q < val_constr.datalen; q++) {
uint32_t val_conv_16 = val_vals[q];
LDKChannelDetails val_conv_16_conv;
val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
val_constr.data[q] = val_conv_16_conv;
}
+ FREE(val);
PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
}
channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
channels_arg_constr.data = NULL;
- uint32_t* channels_arg_vals = channels_arg->elems /* XXX channels_arg leaks */;
+ uint32_t* channels_arg_vals = channels_arg->elems;
for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
uint32_t channels_arg_conv_16 = channels_arg_vals[q];
LDKChannelDetails channels_arg_conv_16_conv;
channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
channels_arg_constr.data[q] = channels_arg_conv_16_conv;
}
+ FREE(channels_arg);
LDKPublicKey real_node_pubkey_arg_ref;
CHECK(real_node_pubkey_arg->arr_len == 33);
memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg);
addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
addresses_constr.data = NULL;
- uint32_t* addresses_vals = addresses->elems /* XXX addresses leaks */;
+ uint32_t* addresses_vals = addresses->elems;
for (size_t m = 0; m < addresses_constr.datalen; m++) {
uint32_t addresses_conv_12 = addresses_vals[m];
void* addresses_conv_12_ptr = (void*)(((uintptr_t)addresses_conv_12) & ~1);
LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
addresses_constr.data[m] = addresses_conv_12_conv;
}
+ FREE(addresses);
ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
}
uint32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
*ret_conv = CounterpartyForwardingInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
*ret_conv = ChannelCounterparty_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
*ret_conv = ChannelDetails_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
*ret_conv = PhantomRouteHints_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
else
channel_monitors_constr.data = NULL;
- uint32_t* channel_monitors_vals = channel_monitors->elems /* XXX channel_monitors leaks */;
+ uint32_t* channel_monitors_vals = channel_monitors->elems;
for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
uint32_t channel_monitors_conv_16 = channel_monitors_vals[q];
LDKChannelMonitor channel_monitors_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
}
+ FREE(channel_monitors);
LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint32_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKChannelManagerReadArgs arg_conv;
arg_conv.inner = (void*)(arg & (~1));
arg_conv.is_owned = (arg & 1) || (arg == 0);
// WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
val_constr.data = NULL;
- int8_tArray* val_vals = (void*) val->elems /* XXX val leaks */;
+ int8_tArray* val_vals = (void*) val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
int8_tArray val_conv_12 = val_vals[m];
LDKSignature val_conv_12_ref;
memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
val_constr.data[m] = val_conv_12_ref;
}
+ FREE(val);
CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
}
htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
htlc_signatures_arg_constr.data = NULL;
- int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems /* XXX htlc_signatures_arg leaks */;
+ int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems;
for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) {
int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m];
LDKSignature htlc_signatures_arg_conv_12_ref;
memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12);
htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
}
+ FREE(htlc_signatures_arg);
LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
uint32_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = NetAddress_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_t val_conv_12 = val_vals[m];
void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
+ FREE(val);
UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
val_constr.data = NULL;
- int64_t* val_vals = val->elems /* XXX val leaks */;
+ int64_t* val_vals = val->elems;
for (size_t i = 0; i < val_constr.datalen; i++) {
int64_t val_conv_8 = val_vals[i];
val_constr.data[i] = val_conv_8;
}
+ FREE(val);
ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
}
short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
short_channel_ids_arg_constr.data = NULL;
- int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems /* XXX short_channel_ids_arg leaks */;
+ int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
+ FREE(short_channel_ids_arg);
LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
val_constr.data = NULL;
- int64_t* val_vals = val->elems /* XXX val leaks */;
+ int64_t* val_vals = val->elems;
for (size_t i = 0; i < val_constr.datalen; i++) {
int64_t val_conv_8 = val_vals[i];
val_constr.data[i] = val_conv_8;
}
+ FREE(val);
QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
}
short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
short_channel_ids_arg_constr.data = NULL;
- int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems /* XXX short_channel_ids_arg leaks */;
+ int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
+ FREE(short_channel_ids_arg);
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t p = 0; p < val_constr.datalen; p++) {
uint32_t val_conv_15 = val_vals[p];
LDKUpdateAddHTLC val_conv_15_conv;
val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
val_constr.data[p] = val_conv_15_conv;
}
+ FREE(val);
CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t t = 0; t < val_constr.datalen; t++) {
uint32_t val_conv_19 = val_vals[t];
LDKUpdateFulfillHTLC val_conv_19_conv;
val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
val_constr.data[t] = val_conv_19_conv;
}
+ FREE(val);
CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t q = 0; q < val_constr.datalen; q++) {
uint32_t val_conv_16 = val_vals[q];
LDKUpdateFailHTLC val_conv_16_conv;
val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
val_constr.data[q] = val_conv_16_conv;
}
+ FREE(val);
CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t z = 0; z < val_constr.datalen; z++) {
uint32_t val_conv_25 = val_vals[z];
LDKUpdateFailMalformedHTLC val_conv_25_conv;
val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
val_constr.data[z] = val_conv_25_conv;
}
+ FREE(val);
CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
}
update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
else
update_add_htlcs_arg_constr.data = NULL;
- uint32_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems /* XXX update_add_htlcs_arg leaks */;
+ uint32_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems;
for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
uint32_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
}
+ FREE(update_add_htlcs_arg);
LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len;
if (update_fulfill_htlcs_arg_constr.datalen > 0)
update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
else
update_fulfill_htlcs_arg_constr.data = NULL;
- uint32_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems /* XXX update_fulfill_htlcs_arg leaks */;
+ uint32_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems;
for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
uint32_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
}
+ FREE(update_fulfill_htlcs_arg);
LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len;
if (update_fail_htlcs_arg_constr.datalen > 0)
update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
else
update_fail_htlcs_arg_constr.data = NULL;
- uint32_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems /* XXX update_fail_htlcs_arg leaks */;
+ uint32_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems;
for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
uint32_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
}
+ FREE(update_fail_htlcs_arg);
LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len;
if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
else
update_fail_malformed_htlcs_arg_constr.data = NULL;
- uint32_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems /* XXX update_fail_malformed_htlcs_arg leaks */;
+ uint32_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems;
for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
uint32_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
}
+ FREE(update_fail_malformed_htlcs_arg);
LDKUpdateFee update_fee_arg_conv;
update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1));
update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0);
uint32_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
*ret_conv = AcceptChannel_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
*ret_conv = AnnouncementSignatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
*ret_conv = ChannelReestablish_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
*ret_conv = ClosingSigned_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
*ret_conv = ClosingSignedFeeRange_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
*ret_conv = CommitmentSigned_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
*ret_conv = FundingCreated_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
*ret_conv = FundingSigned_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
*ret_conv = ChannelReady_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
*ret_conv = Init_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
*ret_conv = OpenChannel_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
*ret_conv = RevokeAndACK_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
*ret_conv = Shutdown_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
*ret_conv = UpdateFailHTLC_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
*ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
*ret_conv = UpdateFee_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
*ret_conv = UpdateFulfillHTLC_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
*ret_conv = UpdateAddHTLC_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
*ret_conv = Ping_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
*ret_conv = Pong_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
*ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
*ret_conv = ChannelAnnouncement_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
*ret_conv = UnsignedChannelUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
*ret_conv = ChannelUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
*ret_conv = ErrorMessage_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
*ret_conv = WarningMessage_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
*ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
*ret_conv = NodeAnnouncement_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
*ret_conv = QueryShortChannelIds_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
*ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
*ret_conv = QueryChannelRange_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
*ret_conv = ReplyChannelRange_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
*ret_conv = GossipTimestampFilter_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
LDKu8slice data_ref;
data_ref.datalen = data->arr_len;
- data_ref.data = data->elems /* XXX data leaks */;
+ data_ref.data = data->elems;
LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
*ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
+ FREE(data);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
*ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
*ret_conv = TxCreationKeys_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
*ret_conv = ChannelPublicKeys_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
*ret_conv = HTLCOutputInCommitment_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
*ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
*ret_conv = ChannelTransactionParameters_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
val_constr.data = NULL;
- int8_tArray* val_vals = (void*) val->elems /* XXX val leaks */;
+ int8_tArray* val_vals = (void*) val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
int8_tArray val_conv_12 = val_vals[m];
LDKSignature val_conv_12_ref;
memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
val_constr.data[m] = val_conv_12_ref;
}
+ FREE(val);
HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
}
uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
*ret_conv = HolderCommitmentTransaction_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
counterparty_htlc_sigs_constr.data = NULL;
- int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems /* XXX counterparty_htlc_sigs leaks */;
+ int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems;
for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) {
int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m];
LDKSignature counterparty_htlc_sigs_conv_12_ref;
memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12);
counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref;
}
+ FREE(counterparty_htlc_sigs);
LDKPublicKey holder_funding_key_ref;
CHECK(holder_funding_key->arr_len == 33);
memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key);
uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
*ret_conv = BuiltCommitmentTransaction_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
- funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */;
+ funding_redeemscript_ref.data = funding_redeemscript->elems;
int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
+ FREE(funding_redeemscript);
return ret_arr;
}
unsigned char (*funding_key_ref)[32] = &funding_key_arr;
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
- funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */;
+ funding_redeemscript_ref.data = funding_redeemscript->elems;
int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
+ FREE(funding_redeemscript);
return ret_arr;
}
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
- funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */;
+ funding_redeemscript_ref.data = funding_redeemscript->elems;
int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
+ FREE(funding_redeemscript);
return ret_arr;
}
unsigned char (*funding_key_ref)[32] = &funding_key_arr;
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
- funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */;
+ funding_redeemscript_ref.data = funding_redeemscript->elems;
int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
+ FREE(funding_redeemscript);
return ret_arr;
}
uint32_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
*ret_conv = CommitmentTransaction_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
*ret_conv = InitFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
*ret_conv = ChannelFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
*ret_conv = NodeFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
*ret_conv = InvoiceFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
*ret_conv = ChannelTypeFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
*ret_conv = ShutdownScript_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
LDKu8slice program_ref;
program_ref.datalen = program->arr_len;
- program_ref.data = program->elems /* XXX program leaks */;
+ program_ref.data = program->elems;
LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
*ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
+ FREE(program);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
*ret_conv = NodeId_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
*ret_conv = NetworkUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
*ret_conv = ChannelUpdateInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
*ret_conv = ChannelInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
*ret_conv = RoutingFees_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_t val_conv_12 = val_vals[m];
void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
+ FREE(val);
NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
}
addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
addresses_arg_constr.data = NULL;
- uint32_t* addresses_arg_vals = addresses_arg->elems /* XXX addresses_arg leaks */;
+ uint32_t* addresses_arg_vals = addresses_arg->elems;
for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
uint32_t addresses_arg_conv_12 = addresses_arg_vals[m];
void* addresses_arg_conv_12_ptr = (void*)(((uintptr_t)addresses_arg_conv_12) & ~1);
LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
}
+ FREE(addresses_arg);
LDKNodeAnnouncement announcement_message_arg_conv;
announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
*ret_conv = NodeAnnouncementInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
val_constr.data = NULL;
- int64_t* val_vals = val->elems /* XXX val leaks */;
+ int64_t* val_vals = val->elems;
for (size_t i = 0; i < val_constr.datalen; i++) {
int64_t val_conv_8 = val_vals[i];
val_constr.data[i] = val_conv_8;
}
+ FREE(val);
NodeInfo_set_channels(&this_ptr_conv, val_constr);
}
channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
channels_arg_constr.data = NULL;
- int64_t* channels_arg_vals = channels_arg->elems /* XXX channels_arg leaks */;
+ int64_t* channels_arg_vals = channels_arg->elems;
for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
int64_t channels_arg_conv_8 = channels_arg_vals[i];
channels_arg_constr.data[i] = channels_arg_conv_8;
}
+ FREE(channels_arg);
LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1));
lowest_inbound_channel_fees_arg_conv.is_owned = (lowest_inbound_channel_fees_arg & 1) || (lowest_inbound_channel_fees_arg == 0);
uint32_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
*ret_conv = NodeInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint32_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
void* arg_ptr = (void*)(((uintptr_t)arg) & ~1);
CHECK_ACCESS(arg_ptr);
LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
}
LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
*ret_conv = NetworkGraph_read(ser_ref, arg_conv);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
*ret_conv = RouteHop_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
else
val_constr.data = NULL;
- uint32_tArray* val_vals = (void*) val->elems /* XXX val leaks */;
+ uint32_tArray* val_vals = (void*) val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_tArray val_conv_12 = val_vals[m];
LDKCVec_RouteHopZ val_conv_12_constr;
val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
val_conv_12_constr.data = NULL;
- uint32_t* val_conv_12_vals = val_conv_12->elems /* XXX val_conv_12 leaks */;
+ uint32_t* val_conv_12_vals = val_conv_12->elems;
for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
uint32_t val_conv_12_conv_10 = val_conv_12_vals[k];
LDKRouteHop val_conv_12_conv_10_conv;
val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
}
+ FREE(val_conv_12);
val_constr.data[m] = val_conv_12_constr;
}
+ FREE(val);
Route_set_paths(&this_ptr_conv, val_constr);
}
paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
else
paths_arg_constr.data = NULL;
- uint32_tArray* paths_arg_vals = (void*) paths_arg->elems /* XXX paths_arg leaks */;
+ uint32_tArray* paths_arg_vals = (void*) paths_arg->elems;
for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
uint32_tArray paths_arg_conv_12 = paths_arg_vals[m];
LDKCVec_RouteHopZ paths_arg_conv_12_constr;
paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
paths_arg_conv_12_constr.data = NULL;
- uint32_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems /* XXX paths_arg_conv_12 leaks */;
+ uint32_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems;
for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
uint32_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
LDKRouteHop paths_arg_conv_12_conv_10_conv;
paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
}
+ FREE(paths_arg_conv_12);
paths_arg_constr.data[m] = paths_arg_conv_12_constr;
}
+ FREE(paths_arg);
LDKPaymentParameters payment_params_arg_conv;
payment_params_arg_conv.inner = (void*)(payment_params_arg & (~1));
payment_params_arg_conv.is_owned = (payment_params_arg & 1) || (payment_params_arg == 0);
uint32_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
*ret_conv = Route_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
*ret_conv = RouteParameters_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t l = 0; l < val_constr.datalen; l++) {
uint32_t val_conv_11 = val_vals[l];
LDKRouteHint val_conv_11_conv;
val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
val_constr.data[l] = val_conv_11_conv;
}
+ FREE(val);
PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
}
route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
else
route_hints_arg_constr.data = NULL;
- uint32_t* route_hints_arg_vals = route_hints_arg->elems /* XXX route_hints_arg leaks */;
+ uint32_t* route_hints_arg_vals = route_hints_arg->elems;
for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
uint32_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
LDKRouteHint route_hints_arg_conv_11_conv;
route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
}
+ FREE(route_hints_arg);
void* expiry_time_arg_ptr = (void*)(((uintptr_t)expiry_time_arg) & ~1);
CHECK_ACCESS(expiry_time_arg_ptr);
LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
uint32_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
*ret_conv = PaymentParameters_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t o = 0; o < val_constr.datalen; o++) {
uint32_t val_conv_14 = val_vals[o];
LDKRouteHintHop val_conv_14_conv;
val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
val_constr.data[o] = val_conv_14_conv;
}
+ FREE(val);
RouteHint_set_a(&this_ptr_conv, val_constr);
}
a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
else
a_arg_constr.data = NULL;
- uint32_t* a_arg_vals = a_arg->elems /* XXX a_arg leaks */;
+ uint32_t* a_arg_vals = a_arg->elems;
for (size_t o = 0; o < a_arg_constr.datalen; o++) {
uint32_t a_arg_conv_14 = a_arg_vals[o];
LDKRouteHintHop a_arg_conv_14_conv;
a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
a_arg_constr.data[o] = a_arg_conv_14_conv;
}
+ FREE(a_arg);
LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
uint32_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
*ret_conv = RouteHint_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
*ret_conv = RouteHintHop_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
first_hops_constr.data = NULL;
- uint32_t* first_hops_vals = first_hops->elems /* XXX first_hops leaks */;
+ uint32_t* first_hops_vals = first_hops->elems;
for (size_t q = 0; q < first_hops_constr.datalen; q++) {
uint32_t first_hops_conv_16 = first_hops_vals[q];
LDKChannelDetails first_hops_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
first_hops_constr.data[q] = first_hops_conv_16_conv;
}
+ FREE(first_hops);
first_hops_ptr = &first_hops_constr;
}
void* logger_ptr = (void*)(((uintptr_t)logger) & ~1);
hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
else
hops_constr.data = NULL;
- int8_tArray* hops_vals = (void*) hops->elems /* XXX hops leaks */;
+ int8_tArray* hops_vals = (void*) hops->elems;
for (size_t m = 0; m < hops_constr.datalen; m++) {
int8_tArray hops_conv_12 = hops_vals[m];
LDKPublicKey hops_conv_12_ref;
memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12);
hops_constr.data[m] = hops_conv_12_ref;
}
+ FREE(hops);
LDKRouteParameters route_params_conv;
route_params_conv.inner = (void*)(route_params & (~1));
route_params_conv.is_owned = false;
uint32_t __attribute__((export_name("TS_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
*ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ProbabilisticScorer_read"))) TS_ProbabilisticScorer_read(int8_tArray ser, uint32_t arg_a, uint32_t arg_b, uint32_t arg_c) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKProbabilisticScoringParameters arg_a_conv;
arg_a_conv.inner = (void*)(arg_a & (~1));
arg_a_conv.is_owned = (arg_a & 1) || (arg_a == 0);
}
LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
*ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
+ FREE(ser);
return (uint32_t)ret_conv;
}
if (record_var.is_owned) {
record_ref |= 1;
}
- js_invoke_function_1(j_calls->instance_ptr, 0, (uint32_t)record_ref);
+ js_invoke_function_u_u(j_calls->instance_ptr, 0, (uint32_t)record_ref);
}
static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__);
memcpy(genesis_hash_arr->elems, *genesis_hash, 32);
int64_t short_channel_id_conv = short_channel_id;
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 1, (uint32_t)genesis_hash_arr, (uint32_t)short_channel_id_conv);
+ uint32_t ret = js_invoke_function_u_bb(j_calls->instance_ptr, 1, (uint32_t)genesis_hash_arr, (uint32_t)short_channel_id_conv);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
int64_t idx_conv = idx;
- int8_tArray ret = (int8_tArray)js_invoke_function_1(j_calls->instance_ptr, 2, (uint32_t)idx_conv);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_b(j_calls->instance_ptr, 2, (uint32_t)idx_conv);
LDKPublicKey ret_ref;
CHECK(ret->arr_len == 33);
memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
int64_t idx_conv = idx;
- int8_tArray ret = (int8_tArray)js_invoke_function_1(j_calls->instance_ptr, 3, (uint32_t)idx_conv);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_b(j_calls->instance_ptr, 3, (uint32_t)idx_conv);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
}
FREE(preimages_var.data);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 4, (uint32_t)holder_tx_ref, (uint32_t)preimages_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 4, (uint32_t)holder_tx_ref, (uint32_t)preimages_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
}
LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 5);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 5);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
}
FREE(preimages_var.data);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 6, (uint32_t)commitment_tx_ref, (uint32_t)preimages_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 6, (uint32_t)commitment_tx_ref, (uint32_t)preimages_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
int64_t idx_conv = idx;
int8_tArray secret_arr = init_int8_tArray(32, __LINE__);
memcpy(secret_arr->elems, *secret, 32);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 7, (uint32_t)idx_conv, (uint32_t)secret_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 7, (uint32_t)idx_conv, (uint32_t)secret_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 8, (uint32_t)commitment_tx_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 8, (uint32_t)commitment_tx_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
int64_t amount_conv = amount;
int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
- uint32_t ret = js_invoke_function_4(j_calls->instance_ptr, 9, (uint32_t)justice_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_key_arr);
+ uint32_t ret = js_invoke_function_u_uuuu(j_calls->instance_ptr, 9, (uint32_t)justice_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_key_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
- uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_key_arr, (uint32_t)htlc_ref);
+ uint32_t ret = js_invoke_function_u_uuuuu(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_key_arr, (uint32_t)htlc_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
- uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 11, (uint32_t)htlc_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_point_arr, (uint32_t)htlc_ref);
+ uint32_t ret = js_invoke_function_u_uuuuu(j_calls->instance_ptr, 11, (uint32_t)htlc_tx_arr, (uint32_t)input_conv, (uint32_t)amount_conv, (uint32_t)per_commitment_point_arr, (uint32_t)htlc_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
if (closing_tx_var.is_owned) {
closing_tx_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 12, (uint32_t)closing_tx_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 12, (uint32_t)closing_tx_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 13, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 13, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
if (channel_parameters_var.is_owned) {
channel_parameters_ref |= 1;
}
- js_invoke_function_1(j_calls->instance_ptr, 14, (uint32_t)channel_parameters_ref);
+ js_invoke_function_u_u(j_calls->instance_ptr, 14, (uint32_t)channel_parameters_ref);
}
static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
else
preimages_constr.data = NULL;
- int8_tArray* preimages_vals = (void*) preimages->elems /* XXX preimages leaks */;
+ int8_tArray* preimages_vals = (void*) preimages->elems;
for (size_t m = 0; m < preimages_constr.datalen; m++) {
int8_tArray preimages_conv_12 = preimages_vals[m];
LDKThirtyTwoBytes preimages_conv_12_ref;
memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
preimages_constr.data[m] = preimages_conv_12_ref;
}
+ FREE(preimages);
LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
*ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
return (uint32_t)ret_conv;
preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
else
preimages_constr.data = NULL;
- int8_tArray* preimages_vals = (void*) preimages->elems /* XXX preimages leaks */;
+ int8_tArray* preimages_vals = (void*) preimages->elems;
for (size_t m = 0; m < preimages_constr.datalen; m++) {
int8_tArray preimages_conv_12 = preimages_vals[m];
LDKThirtyTwoBytes preimages_conv_12_ref;
memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
preimages_constr.data[m] = preimages_conv_12_ref;
}
+ FREE(preimages);
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, &commitment_tx_conv, preimages_constr);
return (uint32_t)ret_conv;
}
LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 15);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 15);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
if (monitor_var.is_owned) {
monitor_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 16, (uint32_t)funding_txo_ref, (uint32_t)monitor_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 16, (uint32_t)funding_txo_ref, (uint32_t)monitor_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
if (update_var.is_owned) {
update_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 17, (uint32_t)funding_txo_ref, (uint32_t)update_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 17, (uint32_t)funding_txo_ref, (uint32_t)update_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
}
LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_0(j_calls->instance_ptr, 18);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_(j_calls->instance_ptr, 18);
LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t m = 0; m < ret_constr.datalen; m++) {
uint32_t ret_conv_38 = ret_vals[m];
void* ret_conv_38_ptr = (void*)(((uintptr_t)ret_conv_38) & ~1);
FREE((void*)ret_conv_38);
ret_constr.data[m] = ret_conv_38_conv;
}
+ FREE(ret);
return ret_constr;
}
static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__);
memcpy(tx_arr->elems, tx_var.data, tx_var.datalen);
Transaction_free(tx_var);
- js_invoke_function_1(j_calls->instance_ptr, 19, (uint32_t)tx_arr);
+ js_invoke_function_u_u(j_calls->instance_ptr, 19, (uint32_t)tx_arr);
}
static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
uint32_t recipient_conv = LDKRecipient_to_js(recipient);
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 20, (uint32_t)recipient_conv);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 20, (uint32_t)recipient_conv);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
}
LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 21);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 21);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
}
LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- uint32_t ret = js_invoke_function_0(j_calls->instance_ptr, 22);
+ uint32_t ret = js_invoke_function_u_(j_calls->instance_ptr, 22);
LDKShutdownScript ret_conv;
ret_conv.inner = (void*)(ret & (~1));
ret_conv.is_owned = (ret & 1) || (ret == 0);
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
jboolean inbound_conv = inbound;
int64_t channel_value_satoshis_conv = channel_value_satoshis;
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 23, (uint32_t)inbound_conv, (uint32_t)channel_value_satoshis_conv);
+ uint32_t ret = js_invoke_function_u_bb(j_calls->instance_ptr, 23, (uint32_t)inbound_conv, (uint32_t)channel_value_satoshis_conv);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKSign ret_conv = *(LDKSign*)(ret_ptr);
}
LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 24);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 24);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
LDKu8slice reader_var = reader;
int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 25, (uint32_t)reader_arr);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 25, (uint32_t)reader_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
FREE(invoice_data_var.data);
uint32_t receipient_conv = LDKRecipient_to_js(receipient);
- uint32_t ret = js_invoke_function_3(j_calls->instance_ptr, 26, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, (uint32_t)receipient_conv);
+ uint32_t ret = js_invoke_function_u_uuu(j_calls->instance_ptr, 26, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, (uint32_t)receipient_conv);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
}
LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 27);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 27);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKu8slice reader_ref;
reader_ref.datalen = reader->arr_len;
- reader_ref.data = reader->elems /* XXX reader leaks */;
+ reader_ref.data = reader->elems;
LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
*ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
+ FREE(reader);
return (uint32_t)ret_conv;
}
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKu8slice hrp_bytes_ref;
hrp_bytes_ref.datalen = hrp_bytes->arr_len;
- hrp_bytes_ref.data = hrp_bytes->elems /* XXX hrp_bytes leaks */;
+ hrp_bytes_ref.data = hrp_bytes->elems;
LDKCVec_u5Z invoice_data_constr;
invoice_data_constr.datalen = invoice_data->arr_len;
if (invoice_data_constr.datalen > 0)
invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
else
invoice_data_constr.data = NULL;
- int8_t* invoice_data_vals = (void*) invoice_data->elems /* XXX invoice_data leaks */;
+ int8_t* invoice_data_vals = (void*) invoice_data->elems;
for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
int8_t invoice_data_conv_7 = invoice_data_vals[h];
invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
}
+ FREE(invoice_data);
LDKRecipient receipient_conv = LDKRecipient_from_js(receipient);
LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
*ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
+ FREE(hrp_bytes);
return (uint32_t)ret_conv;
}
uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
- return js_invoke_function_1(j_calls->instance_ptr, 28, (uint32_t)confirmation_target_conv);
+ return js_invoke_function_u_u(j_calls->instance_ptr, 28, (uint32_t)confirmation_target_conv);
}
static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
}
uint16_t type_id_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- return js_invoke_function_0(j_calls->instance_ptr, 29);
+ return js_invoke_function_u_(j_calls->instance_ptr, 29);
}
LDKStr debug_str_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- jstring ret = (jstring)js_invoke_function_0(j_calls->instance_ptr, 30);
+ jstring ret = (jstring)js_invoke_function_u_(j_calls->instance_ptr, 30);
LDKStr ret_conv = str_ref_to_owned_c(ret);
return ret_conv;
}
LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 31);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 31);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
LDKu8slice script_pubkey_var = script_pubkey;
int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__);
memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen);
- js_invoke_function_2(j_calls->instance_ptr, 32, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 32, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr);
}
LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
if (output_var.is_owned) {
output_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 33, (uint32_t)output_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 33, (uint32_t)output_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
unsigned char (*txid_ref)[32] = &txid_arr;
LDKu8slice script_pubkey_ref;
script_pubkey_ref.datalen = script_pubkey->arr_len;
- script_pubkey_ref.data = script_pubkey->elems /* XXX script_pubkey leaks */;
+ script_pubkey_ref.data = script_pubkey->elems;
(this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
+ FREE(script_pubkey);
}
uint32_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint32_t this_arg, uint32_t output) {
}
LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_0(j_calls->instance_ptr, 34);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_(j_calls->instance_ptr, 34);
LDKCVec_MessageSendEventZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t s = 0; s < ret_constr.datalen; s++) {
uint32_t ret_conv_18 = ret_vals[s];
void* ret_conv_18_ptr = (void*)(((uintptr_t)ret_conv_18) & ~1);
FREE((void*)ret_conv_18);
ret_constr.data[s] = ret_conv_18_conv;
}
+ FREE(ret);
return ret_constr;
}
static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
*ret_event = Event_clone(event);
- js_invoke_function_1(j_calls->instance_ptr, 35, (uint32_t)(uint32_t)ret_event);
+ js_invoke_function_u_u(j_calls->instance_ptr, 35, (uint32_t)(uint32_t)ret_event);
}
static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*handler_ret = handler;
- js_invoke_function_1(j_calls->instance_ptr, 36, (uint32_t)(uint32_t)handler_ret);
+ js_invoke_function_u_u(j_calls->instance_ptr, 36, (uint32_t)(uint32_t)handler_ret);
}
static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
if (usage_var.is_owned) {
usage_ref |= 1;
}
- return js_invoke_function_4(j_calls->instance_ptr, 37, (uint32_t)short_channel_id_conv, (uint32_t)source_ref, (uint32_t)target_ref, (uint32_t)usage_ref);
+ return js_invoke_function_b_uuuu(j_calls->instance_ptr, 37, (uint32_t)short_channel_id_conv, (uint32_t)source_ref, (uint32_t)target_ref, (uint32_t)usage_ref);
}
void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
FREE(path_var.data);
int64_t short_channel_id_conv = short_channel_id;
- js_invoke_function_2(j_calls->instance_ptr, 38, (uint32_t)path_arr, (uint32_t)short_channel_id_conv);
+ js_invoke_function_u_bb(j_calls->instance_ptr, 38, (uint32_t)path_arr, (uint32_t)short_channel_id_conv);
}
void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
}
FREE(path_var.data);
- js_invoke_function_1(j_calls->instance_ptr, 39, (uint32_t)path_arr);
+ js_invoke_function_u_u(j_calls->instance_ptr, 39, (uint32_t)path_arr);
}
LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 40);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 40);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
path_constr.data = NULL;
- uint32_t* path_vals = path->elems /* XXX path leaks */;
+ uint32_t* path_vals = path->elems;
for (size_t k = 0; k < path_constr.datalen; k++) {
uint32_t path_conv_10 = path_vals[k];
LDKRouteHop path_conv_10_conv;
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
+ FREE(path);
(this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
}
path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
path_constr.data = NULL;
- uint32_t* path_vals = path->elems /* XXX path leaks */;
+ uint32_t* path_vals = path->elems;
for (size_t k = 0; k < path_constr.datalen; k++) {
uint32_t path_conv_10 = path_vals[k];
LDKRouteHop path_conv_10_conv;
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
+ FREE(path);
(this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
}
if (channel_manager_var.is_owned) {
channel_manager_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 41, (uint32_t)channel_manager_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 41, (uint32_t)channel_manager_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
if (network_graph_var.is_owned) {
network_graph_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 42, (uint32_t)network_graph_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 42, (uint32_t)network_graph_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
if (scorer_var.is_owned) {
scorer_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 43, (uint32_t)scorer_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 43, (uint32_t)scorer_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
FREE(txdata_var.data);
int32_t height_conv = height;
- js_invoke_function_3(j_calls->instance_ptr, 44, (uint32_t)header_arr, (uint32_t)txdata_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 44, (uint32_t)header_arr, (uint32_t)txdata_arr, (uint32_t)height_conv);
}
void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__);
memcpy(block_arr->elems, block_var.data, block_var.datalen);
int32_t height_conv = height;
- js_invoke_function_2(j_calls->instance_ptr, 45, (uint32_t)block_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 45, (uint32_t)block_arr, (uint32_t)height_conv);
}
void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
int8_tArray header_arr = init_int8_tArray(80, __LINE__);
memcpy(header_arr->elems, *header, 80);
int32_t height_conv = height;
- js_invoke_function_2(j_calls->instance_ptr, 46, (uint32_t)header_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 46, (uint32_t)header_arr, (uint32_t)height_conv);
}
static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
txdata_constr.data = NULL;
- uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */;
+ uint32_t* txdata_vals = txdata->elems;
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
+ FREE(txdata);
(this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
}
LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
LDKu8slice block_ref;
block_ref.datalen = block->arr_len;
- block_ref.data = block->elems /* XXX block leaks */;
+ block_ref.data = block->elems;
(this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
+ FREE(block);
}
void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint32_t this_arg, int8_tArray header, int32_t height) {
FREE(txdata_var.data);
int32_t height_conv = height;
- js_invoke_function_3(j_calls->instance_ptr, 47, (uint32_t)header_arr, (uint32_t)txdata_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 47, (uint32_t)header_arr, (uint32_t)txdata_arr, (uint32_t)height_conv);
}
void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
memcpy(txid_arr->elems, *txid, 32);
- js_invoke_function_1(j_calls->instance_ptr, 48, (uint32_t)txid_arr);
+ js_invoke_function_u_u(j_calls->instance_ptr, 48, (uint32_t)txid_arr);
}
void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
int8_tArray header_arr = init_int8_tArray(80, __LINE__);
memcpy(header_arr->elems, *header, 80);
int32_t height_conv = height;
- js_invoke_function_2(j_calls->instance_ptr, 49, (uint32_t)header_arr, (uint32_t)height_conv);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 49, (uint32_t)header_arr, (uint32_t)height_conv);
}
LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
- ptrArray ret = (ptrArray)js_invoke_function_0(j_calls->instance_ptr, 50);
+ ptrArray ret = (ptrArray)js_invoke_function_u_(j_calls->instance_ptr, 50);
LDKCVec_TxidZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
else
ret_constr.data = NULL;
- int8_tArray* ret_vals = (void*) ret->elems /* XXX ret leaks */;
+ int8_tArray* ret_vals = (void*) ret->elems;
for (size_t m = 0; m < ret_constr.datalen; m++) {
int8_tArray ret_conv_12 = ret_vals[m];
LDKThirtyTwoBytes ret_conv_12_ref;
memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12);
ret_constr.data[m] = ret_conv_12_ref;
}
+ FREE(ret);
return ret_constr;
}
static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
txdata_constr.data = NULL;
- uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */;
+ uint32_t* txdata_vals = txdata->elems;
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
+ FREE(txdata);
(this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
}
if (update_id_var.is_owned) {
update_id_ref |= 1;
}
- uint32_t ret = js_invoke_function_3(j_calls->instance_ptr, 51, (uint32_t)channel_id_ref, (uint32_t)data_ref, (uint32_t)update_id_ref);
+ uint32_t ret = js_invoke_function_u_uuu(j_calls->instance_ptr, 51, (uint32_t)channel_id_ref, (uint32_t)data_ref, (uint32_t)update_id_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
if (update_id_var.is_owned) {
update_id_ref |= 1;
}
- uint32_t ret = js_invoke_function_4(j_calls->instance_ptr, 52, (uint32_t)channel_id_ref, (uint32_t)update_ref, (uint32_t)data_ref, (uint32_t)update_id_ref);
+ uint32_t ret = js_invoke_function_u_uuuu(j_calls->instance_ptr, 52, (uint32_t)channel_id_ref, (uint32_t)update_ref, (uint32_t)data_ref, (uint32_t)update_id_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_3(j_calls->instance_ptr, 53, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 53, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
}
void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_3(j_calls->instance_ptr, 54, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 54, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
}
void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 55, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 55, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 56, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 56, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 57, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 57, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_3(j_calls->instance_ptr, 58, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
+ js_invoke_function_u_uuu(j_calls->instance_ptr, 58, (uint32_t)their_node_id_arr, (uint32_t)their_features_ref, (uint32_t)msg_ref);
}
void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 59, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 59, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
jboolean no_connection_possible_conv = no_connection_possible;
- js_invoke_function_2(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, (uint32_t)no_connection_possible_conv);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, (uint32_t)no_connection_possible_conv);
}
void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
}
static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 73, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 73, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 74, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 74, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 75, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_u(j_calls->instance_ptr, 75, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int64_t starting_point_conv = starting_point;
int8_t batch_amount_conv = batch_amount;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_2(j_calls->instance_ptr, 76, (uint32_t)starting_point_conv, (uint32_t)batch_amount_conv);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_uu(j_calls->instance_ptr, 76, (uint32_t)starting_point_conv, (uint32_t)batch_amount_conv);
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t h = 0; h < ret_constr.datalen; h++) {
uint32_t ret_conv_59 = ret_vals[h];
void* ret_conv_59_ptr = (void*)(((uintptr_t)ret_conv_59) & ~1);
FREE((void*)ret_conv_59);
ret_constr.data[h] = ret_conv_59_conv;
}
+ FREE(ret);
return ret_constr;
}
LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__);
memcpy(starting_point_arr->elems, starting_point.compressed_form, 33);
int8_t batch_amount_conv = batch_amount;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_2(j_calls->instance_ptr, 77, (uint32_t)starting_point_arr, (uint32_t)batch_amount_conv);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_uu(j_calls->instance_ptr, 77, (uint32_t)starting_point_arr, (uint32_t)batch_amount_conv);
LDKCVec_NodeAnnouncementZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t s = 0; s < ret_constr.datalen; s++) {
uint32_t ret_conv_18 = ret_vals[s];
LDKNodeAnnouncement ret_conv_18_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv);
ret_constr.data[s] = ret_conv_18_conv;
}
+ FREE(ret);
return ret_constr;
}
void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
if (init_var.is_owned) {
init_ref |= 1;
}
- js_invoke_function_2(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, (uint32_t)init_ref);
+ js_invoke_function_u_uu(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, (uint32_t)init_ref);
}
LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
if (msg_var.is_owned) {
msg_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, (uint32_t)msg_ref);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
LDKu8slice buffer_var = buffer;
int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 83, (uint32_t)message_type_conv, (uint32_t)buffer_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 83, (uint32_t)message_type_conv, (uint32_t)buffer_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
LDKu8slice buffer_ref;
buffer_ref.datalen = buffer->arr_len;
- buffer_ref.data = buffer->elems /* XXX buffer leaks */;
+ buffer_ref.data = buffer->elems;
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
+ FREE(buffer);
return (uint32_t)ret_conv;
}
*msg_ret = msg;
int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 84, (uint32_t)(uint32_t)msg_ret, (uint32_t)sender_node_id_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 84, (uint32_t)(uint32_t)msg_ret, (uint32_t)sender_node_id_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
}
LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_0(j_calls->instance_ptr, 85);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_(j_calls->instance_ptr, 85);
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t z = 0; z < ret_constr.datalen; z++) {
uint32_t ret_conv_25 = ret_vals[z];
void* ret_conv_25_ptr = (void*)(((uintptr_t)ret_conv_25) & ~1);
FREE((void*)ret_conv_25);
ret_constr.data[z] = ret_conv_25_conv;
}
+ FREE(ret);
return ret_constr;
}
static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__);
memcpy(data_arr->elems, data_var.data, data_var.datalen);
jboolean resume_read_conv = resume_read;
- return js_invoke_function_2(j_calls->instance_ptr, 86, (uint32_t)data_arr, (uint32_t)resume_read_conv);
+ return js_invoke_function_u_uu(j_calls->instance_ptr, 86, (uint32_t)data_arr, (uint32_t)resume_read_conv);
}
void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- js_invoke_function_0(j_calls->instance_ptr, 87);
+ js_invoke_function_u_(j_calls->instance_ptr, 87);
}
bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*other_arg_clone = SocketDescriptor_clone(other_arg);
- return js_invoke_function_1(j_calls->instance_ptr, 88, (uint32_t)(uint32_t)other_arg_clone);
+ return js_invoke_function_u_u(j_calls->instance_ptr, 88, (uint32_t)(uint32_t)other_arg_clone);
}
uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- return js_invoke_function_0(j_calls->instance_ptr, 89);
+ return js_invoke_function_b_(j_calls->instance_ptr, 89);
}
static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
LDKu8slice data_ref;
data_ref.datalen = data->arr_len;
- data_ref.data = data->elems /* XXX data leaks */;
+ data_ref.data = data->elems;
uint32_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
+ FREE(data);
return ret_conv;
}
}
LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
- uint32_t ret = js_invoke_function_0(j_calls->instance_ptr, 90);
+ uint32_t ret = js_invoke_function_u_(j_calls->instance_ptr, 90);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKScore ret_conv = *(LDKScore*)(ret_ptr);
}
LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 91);
+ int8_tArray ret = (int8_tArray)js_invoke_function_u_(j_calls->instance_ptr, 91);
LDKPublicKey ret_ref;
CHECK(ret->arr_len == 33);
memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
}
LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- uint32_tArray ret = (uint32_tArray)js_invoke_function_0(j_calls->instance_ptr, 92);
+ uint32_tArray ret = (uint32_tArray)js_invoke_function_u_(j_calls->instance_ptr, 92);
LDKCVec_ChannelDetailsZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
ret_constr.data = NULL;
- uint32_t* ret_vals = ret->elems /* XXX ret leaks */;
+ uint32_t* ret_vals = ret->elems;
for (size_t q = 0; q < ret_constr.datalen; q++) {
uint32_t ret_conv_16 = ret_vals[q];
LDKChannelDetails ret_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
ret_constr.data[q] = ret_conv_16_conv;
}
+ FREE(ret);
return ret_constr;
}
LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
memcpy(payment_hash_arr->elems, payment_hash.data, 32);
int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
memcpy(payment_secret_arr->elems, payment_secret.data, 32);
- uint32_t ret = js_invoke_function_3(j_calls->instance_ptr, 93, (uint32_t)route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr);
+ uint32_t ret = js_invoke_function_u_uuu(j_calls->instance_ptr, 93, (uint32_t)route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
}
int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
memcpy(payment_preimage_arr->elems, payment_preimage.data, 32);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 94, (uint32_t)route_ref, (uint32_t)payment_preimage_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 94, (uint32_t)route_ref, (uint32_t)payment_preimage_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
}
int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
memcpy(payment_id_arr->elems, payment_id.data, 32);
- uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 95, (uint32_t)route_ref, (uint32_t)payment_id_arr);
+ uint32_t ret = js_invoke_function_u_uu(j_calls->instance_ptr, 95, (uint32_t)route_ref, (uint32_t)payment_id_arr);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
memcpy(payment_id_arr->elems, payment_id.data, 32);
- js_invoke_function_1(j_calls->instance_ptr, 96, (uint32_t)payment_id_arr);
+ js_invoke_function_u_u(j_calls->instance_ptr, 96, (uint32_t)payment_id_arr);
}
static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
}
// WARNING: This object doesn't live past this scope, needs clone!
uint32_t ret_scorer = ((uintptr_t)scorer) | 1;
- uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 97, (uint32_t)payer_arr, (uint32_t)route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, (uint32_t)ret_scorer);
+ uint32_t ret = js_invoke_function_u_uuuuu(j_calls->instance_ptr, 97, (uint32_t)payer_arr, (uint32_t)route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, (uint32_t)ret_scorer);
void* ret_ptr = (void*)(((uintptr_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
first_hops_constr.data = NULL;
- uint32_t* first_hops_vals = first_hops->elems /* XXX first_hops leaks */;
+ uint32_t* first_hops_vals = first_hops->elems;
for (size_t q = 0; q < first_hops_constr.datalen; q++) {
uint32_t first_hops_conv_16 = first_hops_vals[q];
LDKChannelDetails first_hops_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
first_hops_constr.data[q] = first_hops_conv_16_conv;
}
+ FREE(first_hops);
first_hops_ptr = &first_hops_constr;
}
void* scorer_ptr = (void*)(((uintptr_t)scorer) & ~1);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKSignature _res_conv_12_ref;
memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_SignatureZ_free(_res_constr);
}
o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
o_constr.data = NULL;
- int8_tArray* o_vals = (void*) o->elems /* XXX o leaks */;
+ int8_tArray* o_vals = (void*) o->elems;
for (size_t m = 0; m < o_constr.datalen; m++) {
int8_tArray o_conv_12 = o_vals[m];
LDKSignature o_conv_12_ref;
memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12);
o_constr.data[m] = o_conv_12_ref;
}
+ FREE(o);
LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
*ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
return (uint32_t)ret_conv;
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t k = 0; k < _res_constr.datalen; k++) {
uint32_t _res_conv_10 = _res_vals[k];
LDKRouteHop _res_conv_10_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
_res_constr.data[k] = _res_conv_10_conv;
}
+ FREE(_res);
CVec_RouteHopZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
else
_res_constr.data = NULL;
- uint32_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ uint32_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
uint32_tArray _res_conv_12 = _res_vals[m];
LDKCVec_RouteHopZ _res_conv_12_constr;
_res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
_res_conv_12_constr.data = NULL;
- uint32_t* _res_conv_12_vals = _res_conv_12->elems /* XXX _res_conv_12 leaks */;
+ uint32_t* _res_conv_12_vals = _res_conv_12->elems;
for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
uint32_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
LDKRouteHop _res_conv_12_conv_10_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
_res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
}
+ FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_constr;
}
+ FREE(_res);
CVec_CVec_RouteHopZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t l = 0; l < _res_constr.datalen; l++) {
uint32_t _res_conv_11 = _res_vals[l];
LDKRouteHint _res_conv_11_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
_res_constr.data[l] = _res_conv_11_conv;
}
+ FREE(_res);
CVec_RouteHintZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_14 = _res_vals[o];
LDKRouteHintHop _res_conv_14_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
_res_constr.data[o] = _res_conv_14_conv;
}
+ FREE(_res);
CVec_RouteHintHopZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t q = 0; q < _res_constr.datalen; q++) {
uint32_t _res_conv_16 = _res_vals[q];
LDKChannelDetails _res_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
_res_constr.data[q] = _res_conv_16_conv;
}
+ FREE(_res);
CVec_ChannelDetailsZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKPublicKey _res_conv_12_ref;
memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_PublicKeyZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t b = 0; b < _res_constr.datalen; b++) {
uint32_t _res_conv_27 = _res_vals[b];
void* _res_conv_27_ptr = (void*)(((uintptr_t)_res_conv_27) & ~1);
FREE((void*)_res_conv_27);
_res_constr.data[b] = _res_conv_27_conv;
}
+ FREE(_res);
CVec_SpendableOutputDescriptorZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t s = 0; s < _res_constr.datalen; s++) {
uint32_t _res_conv_18 = _res_vals[s];
void* _res_conv_18_ptr = (void*)(((uintptr_t)_res_conv_18) & ~1);
FREE((void*)_res_conv_18);
_res_constr.data[s] = _res_conv_18_conv;
}
+ FREE(_res);
CVec_MessageSendEventZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t c = 0; c < _res_constr.datalen; c++) {
uint32_t _res_conv_28 = _res_vals[c];
void* _res_conv_28_ptr = (void*)(((uintptr_t)_res_conv_28) & ~1);
FREE((void*)_res_conv_28);
_res_constr.data[c] = _res_conv_28_conv;
}
+ FREE(_res);
CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKThirtyTwoBytes _res_conv_12_ref;
memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_TxidZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_14 = _res_vals[o];
void* _res_conv_14_ptr = (void*)(((uintptr_t)_res_conv_14) & ~1);
FREE((void*)_res_conv_14);
_res_constr.data[o] = _res_conv_14_conv;
}
+ FREE(_res);
CVec_MonitorEventZ_free(_res_constr);
}
b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
else
b_constr.data = NULL;
- uint32_t* b_vals = b->elems /* XXX b leaks */;
+ uint32_t* b_vals = b->elems;
for (size_t o = 0; o < b_constr.datalen; o++) {
uint32_t b_conv_14 = b_vals[o];
void* b_conv_14_ptr = (void*)(((uintptr_t)b_conv_14) & ~1);
b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)b_conv_14) & ~1));
b_constr.data[o] = b_conv_14_conv;
}
+ FREE(b);
LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ");
*ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_new(a_conv, b_constr);
return ((uint32_t)ret_conv);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
uint32_t _res_conv_38 = _res_vals[m];
void* _res_conv_38_ptr = (void*)(((uintptr_t)_res_conv_38) & ~1);
FREE((void*)_res_conv_38);
_res_constr.data[m] = _res_conv_38_conv;
}
+ FREE(_res);
CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_59 = _res_vals[h];
void* _res_conv_59_ptr = (void*)(((uintptr_t)_res_conv_59) & ~1);
FREE((void*)_res_conv_59);
_res_constr.data[h] = _res_conv_59_conv;
}
+ FREE(_res);
CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t s = 0; s < _res_constr.datalen; s++) {
uint32_t _res_conv_18 = _res_vals[s];
LDKNodeAnnouncement _res_conv_18_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv);
_res_constr.data[s] = _res_conv_18_conv;
}
+ FREE(_res);
CVec_NodeAnnouncementZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
uint32_t _res_conv_12 = _res_vals[m];
void* _res_conv_12_ptr = (void*)(((uintptr_t)_res_conv_12) & ~1);
FREE((void*)_res_conv_12);
_res_constr.data[m] = _res_conv_12_conv;
}
+ FREE(_res);
CVec_NetAddressZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
_res_constr.data = NULL;
- int64_t* _res_vals = _res->elems /* XXX _res leaks */;
+ int64_t* _res_vals = _res->elems;
for (size_t i = 0; i < _res_constr.datalen; i++) {
int64_t _res_conv_8 = _res_vals[i];
_res_constr.data[i] = _res_conv_8;
}
+ FREE(_res);
CVec_u64Z_free(_res_constr);
}
o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
o_constr.data = NULL;
- uint32_t* o_vals = o->elems /* XXX o leaks */;
+ uint32_t* o_vals = o->elems;
for (size_t m = 0; m < o_constr.datalen; m++) {
uint32_t o_conv_12 = o_vals[m];
void* o_conv_12_ptr = (void*)(((uintptr_t)o_conv_12) & ~1);
o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o_conv_12) & ~1));
o_constr.data[m] = o_conv_12_conv;
}
+ FREE(o);
LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
*ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKThirtyTwoBytes _res_conv_12_ref;
memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_PaymentPreimageZ_free(_res_constr);
}
b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
b_constr.data = NULL;
- int8_tArray* b_vals = (void*) b->elems /* XXX b leaks */;
+ int8_tArray* b_vals = (void*) b->elems;
for (size_t m = 0; m < b_constr.datalen; m++) {
int8_tArray b_conv_12 = b_vals[m];
LDKSignature b_conv_12_ref;
memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12);
b_constr.data[m] = b_conv_12_ref;
}
+ FREE(b);
LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
*ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
return ((uint32_t)ret_conv);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
else
_res_constr.data = NULL;
- int8_t* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_t* _res_vals = (void*) _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
int8_t _res_conv_7 = _res_vals[h];
_res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
}
+ FREE(_res);
CVec_u5Z_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKCVec_u8Z _res_conv_12_ref;
memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_CVec_u8ZZ_free(_res_constr);
}
o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
else
o_constr.data = NULL;
- int8_tArray* o_vals = (void*) o->elems /* XXX o leaks */;
+ int8_tArray* o_vals = (void*) o->elems;
for (size_t m = 0; m < o_constr.datalen; m++) {
int8_tArray o_conv_12 = o_vals[m];
LDKCVec_u8Z o_conv_12_ref;
memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12);
o_constr.data[m] = o_conv_12_ref;
}
+ FREE(o);
LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
*ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
return (uint32_t)ret_conv;
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_7 = _res_vals[h];
void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
+ FREE(_res);
CVec_TxOutZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t w = 0; w < _res_constr.datalen; w++) {
uint32_t _res_conv_22 = _res_vals[w];
void* _res_conv_22_ptr = (void*)(((uintptr_t)_res_conv_22) & ~1);
FREE((void*)_res_conv_22);
_res_constr.data[w] = _res_conv_22_conv;
}
+ FREE(_res);
CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t k = 0; k < _res_constr.datalen; k++) {
uint32_t _res_conv_10 = _res_vals[k];
void* _res_conv_10_ptr = (void*)(((uintptr_t)_res_conv_10) & ~1);
FREE((void*)_res_conv_10);
_res_constr.data[k] = _res_conv_10_conv;
}
+ FREE(_res);
CVec_APIErrorZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t q = 0; q < _res_constr.datalen; q++) {
uint32_t _res_conv_16 = _res_vals[q];
LDKChannelMonitor _res_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
_res_constr.data[q] = _res_conv_16_conv;
}
+ FREE(_res);
CVec_ChannelMonitorZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_14 = _res_vals[o];
LDKPrivateRoute _res_conv_14_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
_res_constr.data[o] = _res_conv_14_conv;
}
+ FREE(_res);
CVec_PrivateRouteZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t v = 0; v < _res_constr.datalen; v++) {
uint32_t _res_conv_21 = _res_vals[v];
void* _res_conv_21_ptr = (void*)(((uintptr_t)_res_conv_21) & ~1);
FREE((void*)_res_conv_21);
_res_constr.data[v] = _res_conv_21_conv;
}
+ FREE(_res);
CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
}
b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
else
b_constr.data = NULL;
- uint32_t* b_vals = b->elems /* XXX b leaks */;
+ uint32_t* b_vals = b->elems;
for (size_t v = 0; v < b_constr.datalen; v++) {
uint32_t b_conv_21 = b_vals[v];
void* b_conv_21_ptr = (void*)(((uintptr_t)b_conv_21) & ~1);
b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uintptr_t)b_conv_21) & ~1));
b_constr.data[v] = b_conv_21_conv;
}
+ FREE(b);
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
*ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
return ((uint32_t)ret_conv);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_40 = _res_vals[o];
void* _res_conv_40_ptr = (void*)(((uintptr_t)_res_conv_40) & ~1);
FREE((void*)_res_conv_40);
_res_constr.data[o] = _res_conv_40_conv;
}
+ FREE(_res);
CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_7 = _res_vals[h];
void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
+ FREE(_res);
CVec_EventZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
else
_res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */;
+ int8_tArray* _res_vals = (void*) _res->elems;
for (size_t m = 0; m < _res_constr.datalen; m++) {
int8_tArray _res_conv_12 = _res_vals[m];
LDKTransaction _res_conv_12_ref;
_res_conv_12_ref.data_is_owned = true;
_res_constr.data[m] = _res_conv_12_ref;
}
+ FREE(_res);
CVec_TransactionZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t u = 0; u < _res_constr.datalen; u++) {
uint32_t _res_conv_20 = _res_vals[u];
void* _res_conv_20_ptr = (void*)(((uintptr_t)_res_conv_20) & ~1);
FREE((void*)_res_conv_20);
_res_constr.data[u] = _res_conv_20_conv;
}
+ FREE(_res);
CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
}
b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
else
b_constr.data = NULL;
- uint32_t* b_vals = b->elems /* XXX b leaks */;
+ uint32_t* b_vals = b->elems;
for (size_t u = 0; u < b_constr.datalen; u++) {
uint32_t b_conv_20 = b_vals[u];
void* b_conv_20_ptr = (void*)(((uintptr_t)b_conv_20) & ~1);
b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uintptr_t)b_conv_20) & ~1));
b_constr.data[u] = b_conv_20_conv;
}
+ FREE(b);
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
return ((uint32_t)ret_conv);
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t n = 0; n < _res_constr.datalen; n++) {
uint32_t _res_conv_39 = _res_vals[n];
void* _res_conv_39_ptr = (void*)(((uintptr_t)_res_conv_39) & ~1);
FREE((void*)_res_conv_39);
_res_constr.data[n] = _res_conv_39_conv;
}
+ FREE(_res);
CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t j = 0; j < _res_constr.datalen; j++) {
uint32_t _res_conv_9 = _res_vals[j];
void* _res_conv_9_ptr = (void*)(((uintptr_t)_res_conv_9) & ~1);
FREE((void*)_res_conv_9);
_res_constr.data[j] = _res_conv_9_conv;
}
+ FREE(_res);
CVec_BalanceZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t z = 0; z < _res_constr.datalen; z++) {
uint32_t _res_conv_25 = _res_vals[z];
void* _res_conv_25_ptr = (void*)(((uintptr_t)_res_conv_25) & ~1);
FREE((void*)_res_conv_25);
_res_constr.data[z] = _res_conv_25_conv;
}
+ FREE(_res);
CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t p = 0; p < _res_constr.datalen; p++) {
uint32_t _res_conv_15 = _res_vals[p];
LDKUpdateAddHTLC _res_conv_15_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
_res_constr.data[p] = _res_conv_15_conv;
}
+ FREE(_res);
CVec_UpdateAddHTLCZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t t = 0; t < _res_constr.datalen; t++) {
uint32_t _res_conv_19 = _res_vals[t];
LDKUpdateFulfillHTLC _res_conv_19_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
_res_constr.data[t] = _res_conv_19_conv;
}
+ FREE(_res);
CVec_UpdateFulfillHTLCZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t q = 0; q < _res_constr.datalen; q++) {
uint32_t _res_conv_16 = _res_vals[q];
LDKUpdateFailHTLC _res_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
_res_constr.data[q] = _res_conv_16_conv;
}
+ FREE(_res);
CVec_UpdateFailHTLCZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t z = 0; z < _res_constr.datalen; z++) {
uint32_t _res_conv_25 = _res_vals[z];
LDKUpdateFailMalformedHTLC _res_conv_25_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
_res_constr.data[z] = _res_conv_25_conv;
}
+ FREE(_res);
CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
}
_res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
else
_res_constr.data = NULL;
- uint32_t* _res_vals = _res->elems /* XXX _res leaks */;
+ uint32_t* _res_vals = _res->elems;
for (size_t k = 0; k < _res_constr.datalen; k++) {
uint32_t _res_conv_10 = _res_vals[k];
LDKOutPoint _res_conv_10_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
_res_constr.data[k] = _res_conv_10_conv;
}
+ FREE(_res);
CVec_OutPointZ_free(_res_constr);
}
uint32_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
*ret_conv = PaymentPurpose_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
*ret_conv = ClosureReason_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
path_constr.data = NULL;
- uint32_t* path_vals = path->elems /* XXX path leaks */;
+ uint32_t* path_vals = path->elems;
for (size_t k = 0; k < path_constr.datalen; k++) {
uint32_t path_conv_10 = path_vals[k];
LDKRouteHop path_conv_10_conv;
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
+ FREE(path);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
path_constr.data = NULL;
- uint32_t* path_vals = path->elems /* XXX path leaks */;
+ uint32_t* path_vals = path->elems;
for (size_t k = 0; k < path_constr.datalen; k++) {
uint32_t path_conv_10 = path_vals[k];
LDKRouteHop path_conv_10_conv;
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
+ FREE(path);
void* short_channel_id_ptr = (void*)(((uintptr_t)short_channel_id) & ~1);
CHECK_ACCESS(short_channel_id_ptr);
LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
else
outputs_constr.data = NULL;
- uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */;
+ uint32_t* outputs_vals = outputs->elems;
for (size_t b = 0; b < outputs_constr.datalen; b++) {
uint32_t outputs_conv_27 = outputs_vals[b];
void* outputs_conv_27_ptr = (void*)(((uintptr_t)outputs_conv_27) & ~1);
outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)outputs_conv_27) & ~1));
outputs_constr.data[b] = outputs_conv_27_conv;
}
+ FREE(outputs);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_spendable_outputs(outputs_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
uint32_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
*ret_conv = Event_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) {
LDKu8slice msg_ref;
msg_ref.datalen = msg->arr_len;
- msg_ref.data = msg->elems /* XXX msg leaks */;
+ msg_ref.data = msg->elems;
unsigned char sk_arr[32];
CHECK(sk->arr_len == 32);
memcpy(sk_arr, sk->elems, 32); FREE(sk);
unsigned char (*sk_ref)[32] = &sk_arr;
LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
*ret_conv = sign(msg_ref, sk_ref);
+ FREE(msg);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) {
LDKu8slice msg_ref;
msg_ref.datalen = msg->arr_len;
- msg_ref.data = msg->elems /* XXX msg leaks */;
+ msg_ref.data = msg->elems;
LDKStr sig_conv = str_ref_to_owned_c(sig);
LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
*ret_conv = recover_pk(msg_ref, sig_conv);
+ FREE(msg);
return (uint32_t)ret_conv;
}
jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) {
LDKu8slice msg_ref;
msg_ref.datalen = msg->arr_len;
- msg_ref.data = msg->elems /* XXX msg leaks */;
+ msg_ref.data = msg->elems;
LDKStr sig_conv = str_ref_to_owned_c(sig);
LDKPublicKey pk_ref;
CHECK(pk->arr_len == 33);
memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk);
jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
+ FREE(msg);
return ret_conv;
}
int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) {
LDKu8slice hrp_bytes_ref;
hrp_bytes_ref.datalen = hrp_bytes->arr_len;
- hrp_bytes_ref.data = hrp_bytes->elems /* XXX hrp_bytes leaks */;
+ hrp_bytes_ref.data = hrp_bytes->elems;
LDKCVec_u5Z data_without_signature_constr;
data_without_signature_constr.datalen = data_without_signature->arr_len;
if (data_without_signature_constr.datalen > 0)
data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
else
data_without_signature_constr.data = NULL;
- int8_t* data_without_signature_vals = (void*) data_without_signature->elems /* XXX data_without_signature leaks */;
+ int8_t* data_without_signature_vals = (void*) data_without_signature->elems;
for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
}
+ FREE(data_without_signature);
LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
CVec_u8Z_free(ret_var);
+ FREE(hrp_bytes);
return ret_arr;
}
uint32_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
*ret_conv = ChannelConfig_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
ignored_channels_constr.data = NULL;
- uint32_t* ignored_channels_vals = ignored_channels->elems /* XXX ignored_channels leaks */;
+ uint32_t* ignored_channels_vals = ignored_channels->elems;
for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
uint32_t ignored_channels_conv_16 = ignored_channels_vals[q];
LDKChannelDetails ignored_channels_conv_16_conv;
ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
}
+ FREE(ignored_channels);
LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
uint32_tArray ret_arr = NULL;
ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__);
uint32_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
*ret_conv = ChannelMonitorUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
*ret_conv = MonitorEvent_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
*ret_conv = HTLCUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
txdata_constr.data = NULL;
- uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */;
+ uint32_t* txdata_vals = txdata->elems;
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
+ FREE(txdata);
void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1);
CHECK_ACCESS(broadcaster_ptr);
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
else
txdata_constr.data = NULL;
- uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */;
+ uint32_t* txdata_vals = txdata->elems;
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
+ FREE(txdata);
void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1);
CHECK_ACCESS(broadcaster_ptr);
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint32_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
void* arg_ptr = (void*)(((uintptr_t)arg) & ~1);
if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
*ret_conv = OutPoint_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = SpendableOutputDescriptor_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, int8_tArray arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKSecretKey arg_ref;
CHECK(arg->arr_len == 32);
memcpy(arg_ref.bytes, arg->elems, 32); FREE(arg);
LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
*ret_conv = InMemorySigner_read(ser_ref, arg_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
else
descriptors_constr.data = NULL;
- uint32_t* descriptors_vals = descriptors->elems /* XXX descriptors leaks */;
+ uint32_t* descriptors_vals = descriptors->elems;
for (size_t b = 0; b < descriptors_constr.datalen; b++) {
uint32_t descriptors_conv_27 = descriptors_vals[b];
void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1);
descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1));
descriptors_constr.data[b] = descriptors_conv_27_conv;
}
+ FREE(descriptors);
LDKCVec_TxOutZ outputs_constr;
outputs_constr.datalen = outputs->arr_len;
if (outputs_constr.datalen > 0)
outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
else
outputs_constr.data = NULL;
- uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */;
+ uint32_t* outputs_vals = outputs->elems;
for (size_t h = 0; h < outputs_constr.datalen; h++) {
uint32_t outputs_conv_7 = outputs_vals[h];
void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1);
outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1));
outputs_constr.data[h] = outputs_conv_7_conv;
}
+ FREE(outputs);
LDKCVec_u8Z change_destination_script_ref;
change_destination_script_ref.datalen = change_destination_script->arr_len;
change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
else
descriptors_constr.data = NULL;
- uint32_t* descriptors_vals = descriptors->elems /* XXX descriptors leaks */;
+ uint32_t* descriptors_vals = descriptors->elems;
for (size_t b = 0; b < descriptors_constr.datalen; b++) {
uint32_t descriptors_conv_27 = descriptors_vals[b];
void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1);
descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1));
descriptors_constr.data[b] = descriptors_conv_27_conv;
}
+ FREE(descriptors);
LDKCVec_TxOutZ outputs_constr;
outputs_constr.datalen = outputs->arr_len;
if (outputs_constr.datalen > 0)
outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
else
outputs_constr.data = NULL;
- uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */;
+ uint32_t* outputs_vals = outputs->elems;
for (size_t h = 0; h < outputs_constr.datalen; h++) {
uint32_t outputs_conv_7 = outputs_vals[h];
void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1);
outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1));
outputs_constr.data[h] = outputs_conv_7_conv;
}
+ FREE(outputs);
LDKCVec_u8Z change_destination_script_ref;
change_destination_script_ref.datalen = change_destination_script->arr_len;
change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
a_constr.data = NULL;
- uint32_t* a_vals = a->elems /* XXX a leaks */;
+ uint32_t* a_vals = a->elems;
for (size_t w = 0; w < a_constr.datalen; w++) {
uint32_t a_conv_22 = a_vals[w];
void* a_conv_22_ptr = (void*)(((uintptr_t)a_conv_22) & ~1);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uintptr_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
+ FREE(a);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
*ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
else
a_constr.data = NULL;
- uint32_t* a_vals = a->elems /* XXX a leaks */;
+ uint32_t* a_vals = a->elems;
for (size_t k = 0; k < a_constr.datalen; k++) {
uint32_t a_conv_10 = a_vals[k];
void* a_conv_10_ptr = (void*)(((uintptr_t)a_conv_10) & ~1);
a_conv_10_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a_conv_10) & ~1));
a_constr.data[k] = a_conv_10_conv;
}
+ FREE(a);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
*ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
uint32_t ret_ref = (uintptr_t)ret_copy;
results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
results_constr.data = NULL;
- uint32_t* results_vals = results->elems /* XXX results leaks */;
+ uint32_t* results_vals = results->elems;
for (size_t w = 0; w < results_constr.datalen; w++) {
uint32_t results_conv_22 = results_vals[w];
void* results_conv_22_ptr = (void*)(((uintptr_t)results_conv_22) & ~1);
LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
results_constr.data[w] = results_conv_22_conv;
}
+ FREE(results);
LDKRouteParameters failed_paths_retry_conv;
failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1));
failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0);
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t q = 0; q < val_constr.datalen; q++) {
uint32_t val_conv_16 = val_vals[q];
LDKChannelDetails val_conv_16_conv;
val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
val_constr.data[q] = val_conv_16_conv;
}
+ FREE(val);
PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
}
channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
channels_arg_constr.data = NULL;
- uint32_t* channels_arg_vals = channels_arg->elems /* XXX channels_arg leaks */;
+ uint32_t* channels_arg_vals = channels_arg->elems;
for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
uint32_t channels_arg_conv_16 = channels_arg_vals[q];
LDKChannelDetails channels_arg_conv_16_conv;
channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
channels_arg_constr.data[q] = channels_arg_conv_16_conv;
}
+ FREE(channels_arg);
LDKPublicKey real_node_pubkey_arg_ref;
CHECK(real_node_pubkey_arg->arr_len == 33);
memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg);
addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
addresses_constr.data = NULL;
- uint32_t* addresses_vals = addresses->elems /* XXX addresses leaks */;
+ uint32_t* addresses_vals = addresses->elems;
for (size_t m = 0; m < addresses_constr.datalen; m++) {
uint32_t addresses_conv_12 = addresses_vals[m];
void* addresses_conv_12_ptr = (void*)(((uintptr_t)addresses_conv_12) & ~1);
LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
addresses_constr.data[m] = addresses_conv_12_conv;
}
+ FREE(addresses);
ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
}
uint32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
*ret_conv = CounterpartyForwardingInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
*ret_conv = ChannelCounterparty_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
*ret_conv = ChannelDetails_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
*ret_conv = PhantomRouteHints_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
else
channel_monitors_constr.data = NULL;
- uint32_t* channel_monitors_vals = channel_monitors->elems /* XXX channel_monitors leaks */;
+ uint32_t* channel_monitors_vals = channel_monitors->elems;
for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
uint32_t channel_monitors_conv_16 = channel_monitors_vals[q];
LDKChannelMonitor channel_monitors_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
}
+ FREE(channel_monitors);
LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint32_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKChannelManagerReadArgs arg_conv;
arg_conv.inner = (void*)(arg & (~1));
arg_conv.is_owned = (arg & 1) || (arg == 0);
// WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
val_constr.data = NULL;
- int8_tArray* val_vals = (void*) val->elems /* XXX val leaks */;
+ int8_tArray* val_vals = (void*) val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
int8_tArray val_conv_12 = val_vals[m];
LDKSignature val_conv_12_ref;
memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
val_constr.data[m] = val_conv_12_ref;
}
+ FREE(val);
CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
}
htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
htlc_signatures_arg_constr.data = NULL;
- int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems /* XXX htlc_signatures_arg leaks */;
+ int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems;
for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) {
int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m];
LDKSignature htlc_signatures_arg_conv_12_ref;
memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12);
htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
}
+ FREE(htlc_signatures_arg);
LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
uint32_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = NetAddress_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_t val_conv_12 = val_vals[m];
void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
+ FREE(val);
UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
val_constr.data = NULL;
- int64_t* val_vals = val->elems /* XXX val leaks */;
+ int64_t* val_vals = val->elems;
for (size_t i = 0; i < val_constr.datalen; i++) {
int64_t val_conv_8 = val_vals[i];
val_constr.data[i] = val_conv_8;
}
+ FREE(val);
ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
}
short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
short_channel_ids_arg_constr.data = NULL;
- int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems /* XXX short_channel_ids_arg leaks */;
+ int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
+ FREE(short_channel_ids_arg);
LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
val_constr.data = NULL;
- int64_t* val_vals = val->elems /* XXX val leaks */;
+ int64_t* val_vals = val->elems;
for (size_t i = 0; i < val_constr.datalen; i++) {
int64_t val_conv_8 = val_vals[i];
val_constr.data[i] = val_conv_8;
}
+ FREE(val);
QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
}
short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
short_channel_ids_arg_constr.data = NULL;
- int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems /* XXX short_channel_ids_arg leaks */;
+ int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
+ FREE(short_channel_ids_arg);
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t p = 0; p < val_constr.datalen; p++) {
uint32_t val_conv_15 = val_vals[p];
LDKUpdateAddHTLC val_conv_15_conv;
val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
val_constr.data[p] = val_conv_15_conv;
}
+ FREE(val);
CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t t = 0; t < val_constr.datalen; t++) {
uint32_t val_conv_19 = val_vals[t];
LDKUpdateFulfillHTLC val_conv_19_conv;
val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
val_constr.data[t] = val_conv_19_conv;
}
+ FREE(val);
CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t q = 0; q < val_constr.datalen; q++) {
uint32_t val_conv_16 = val_vals[q];
LDKUpdateFailHTLC val_conv_16_conv;
val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
val_constr.data[q] = val_conv_16_conv;
}
+ FREE(val);
CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t z = 0; z < val_constr.datalen; z++) {
uint32_t val_conv_25 = val_vals[z];
LDKUpdateFailMalformedHTLC val_conv_25_conv;
val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
val_constr.data[z] = val_conv_25_conv;
}
+ FREE(val);
CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
}
update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
else
update_add_htlcs_arg_constr.data = NULL;
- uint32_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems /* XXX update_add_htlcs_arg leaks */;
+ uint32_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems;
for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
uint32_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
}
+ FREE(update_add_htlcs_arg);
LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len;
if (update_fulfill_htlcs_arg_constr.datalen > 0)
update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
else
update_fulfill_htlcs_arg_constr.data = NULL;
- uint32_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems /* XXX update_fulfill_htlcs_arg leaks */;
+ uint32_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems;
for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
uint32_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
}
+ FREE(update_fulfill_htlcs_arg);
LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len;
if (update_fail_htlcs_arg_constr.datalen > 0)
update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
else
update_fail_htlcs_arg_constr.data = NULL;
- uint32_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems /* XXX update_fail_htlcs_arg leaks */;
+ uint32_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems;
for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
uint32_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
}
+ FREE(update_fail_htlcs_arg);
LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len;
if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
else
update_fail_malformed_htlcs_arg_constr.data = NULL;
- uint32_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems /* XXX update_fail_malformed_htlcs_arg leaks */;
+ uint32_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems;
for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
uint32_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
}
+ FREE(update_fail_malformed_htlcs_arg);
LDKUpdateFee update_fee_arg_conv;
update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1));
update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0);
uint32_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
*ret_conv = AcceptChannel_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
*ret_conv = AnnouncementSignatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
*ret_conv = ChannelReestablish_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
*ret_conv = ClosingSigned_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
*ret_conv = ClosingSignedFeeRange_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
*ret_conv = CommitmentSigned_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
*ret_conv = FundingCreated_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
*ret_conv = FundingSigned_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
*ret_conv = ChannelReady_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
*ret_conv = Init_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
*ret_conv = OpenChannel_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
*ret_conv = RevokeAndACK_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
*ret_conv = Shutdown_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
*ret_conv = UpdateFailHTLC_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
*ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
*ret_conv = UpdateFee_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
*ret_conv = UpdateFulfillHTLC_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
*ret_conv = UpdateAddHTLC_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
*ret_conv = Ping_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
*ret_conv = Pong_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
*ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
*ret_conv = ChannelAnnouncement_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
*ret_conv = UnsignedChannelUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
*ret_conv = ChannelUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
*ret_conv = ErrorMessage_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
*ret_conv = WarningMessage_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
*ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
*ret_conv = NodeAnnouncement_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
*ret_conv = QueryShortChannelIds_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
*ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
*ret_conv = QueryChannelRange_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
*ret_conv = ReplyChannelRange_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
*ret_conv = GossipTimestampFilter_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
LDKu8slice data_ref;
data_ref.datalen = data->arr_len;
- data_ref.data = data->elems /* XXX data leaks */;
+ data_ref.data = data->elems;
LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
*ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
+ FREE(data);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
*ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
*ret_conv = TxCreationKeys_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
*ret_conv = ChannelPublicKeys_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
*ret_conv = HTLCOutputInCommitment_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
*ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
*ret_conv = ChannelTransactionParameters_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
val_constr.data = NULL;
- int8_tArray* val_vals = (void*) val->elems /* XXX val leaks */;
+ int8_tArray* val_vals = (void*) val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
int8_tArray val_conv_12 = val_vals[m];
LDKSignature val_conv_12_ref;
memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
val_constr.data[m] = val_conv_12_ref;
}
+ FREE(val);
HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
}
uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
*ret_conv = HolderCommitmentTransaction_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
else
counterparty_htlc_sigs_constr.data = NULL;
- int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems /* XXX counterparty_htlc_sigs leaks */;
+ int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems;
for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) {
int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m];
LDKSignature counterparty_htlc_sigs_conv_12_ref;
memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12);
counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref;
}
+ FREE(counterparty_htlc_sigs);
LDKPublicKey holder_funding_key_ref;
CHECK(holder_funding_key->arr_len == 33);
memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key);
uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
*ret_conv = BuiltCommitmentTransaction_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
- funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */;
+ funding_redeemscript_ref.data = funding_redeemscript->elems;
int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
+ FREE(funding_redeemscript);
return ret_arr;
}
unsigned char (*funding_key_ref)[32] = &funding_key_arr;
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
- funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */;
+ funding_redeemscript_ref.data = funding_redeemscript->elems;
int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
+ FREE(funding_redeemscript);
return ret_arr;
}
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
- funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */;
+ funding_redeemscript_ref.data = funding_redeemscript->elems;
int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
+ FREE(funding_redeemscript);
return ret_arr;
}
unsigned char (*funding_key_ref)[32] = &funding_key_arr;
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
- funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */;
+ funding_redeemscript_ref.data = funding_redeemscript->elems;
int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
+ FREE(funding_redeemscript);
return ret_arr;
}
uint32_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
*ret_conv = CommitmentTransaction_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
*ret_conv = InitFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
*ret_conv = ChannelFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
*ret_conv = NodeFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
*ret_conv = InvoiceFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
*ret_conv = ChannelTypeFeatures_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
*ret_conv = ShutdownScript_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
LDKu8slice program_ref;
program_ref.datalen = program->arr_len;
- program_ref.data = program->elems /* XXX program leaks */;
+ program_ref.data = program->elems;
LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
*ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
+ FREE(program);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
*ret_conv = NodeId_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
*ret_conv = NetworkUpdate_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
*ret_conv = ChannelUpdateInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
*ret_conv = ChannelInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
*ret_conv = RoutingFees_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_t val_conv_12 = val_vals[m];
void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
+ FREE(val);
NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
}
addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
else
addresses_arg_constr.data = NULL;
- uint32_t* addresses_arg_vals = addresses_arg->elems /* XXX addresses_arg leaks */;
+ uint32_t* addresses_arg_vals = addresses_arg->elems;
for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
uint32_t addresses_arg_conv_12 = addresses_arg_vals[m];
void* addresses_arg_conv_12_ptr = (void*)(((uintptr_t)addresses_arg_conv_12) & ~1);
LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
}
+ FREE(addresses_arg);
LDKNodeAnnouncement announcement_message_arg_conv;
announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
*ret_conv = NodeAnnouncementInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
val_constr.data = NULL;
- int64_t* val_vals = val->elems /* XXX val leaks */;
+ int64_t* val_vals = val->elems;
for (size_t i = 0; i < val_constr.datalen; i++) {
int64_t val_conv_8 = val_vals[i];
val_constr.data[i] = val_conv_8;
}
+ FREE(val);
NodeInfo_set_channels(&this_ptr_conv, val_constr);
}
channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
else
channels_arg_constr.data = NULL;
- int64_t* channels_arg_vals = channels_arg->elems /* XXX channels_arg leaks */;
+ int64_t* channels_arg_vals = channels_arg->elems;
for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
int64_t channels_arg_conv_8 = channels_arg_vals[i];
channels_arg_constr.data[i] = channels_arg_conv_8;
}
+ FREE(channels_arg);
LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1));
lowest_inbound_channel_fees_arg_conv.is_owned = (lowest_inbound_channel_fees_arg & 1) || (lowest_inbound_channel_fees_arg == 0);
uint32_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
*ret_conv = NodeInfo_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint32_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
void* arg_ptr = (void*)(((uintptr_t)arg) & ~1);
CHECK_ACCESS(arg_ptr);
LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
}
LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
*ret_conv = NetworkGraph_read(ser_ref, arg_conv);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
*ret_conv = RouteHop_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
else
val_constr.data = NULL;
- uint32_tArray* val_vals = (void*) val->elems /* XXX val leaks */;
+ uint32_tArray* val_vals = (void*) val->elems;
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_tArray val_conv_12 = val_vals[m];
LDKCVec_RouteHopZ val_conv_12_constr;
val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
val_conv_12_constr.data = NULL;
- uint32_t* val_conv_12_vals = val_conv_12->elems /* XXX val_conv_12 leaks */;
+ uint32_t* val_conv_12_vals = val_conv_12->elems;
for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
uint32_t val_conv_12_conv_10 = val_conv_12_vals[k];
LDKRouteHop val_conv_12_conv_10_conv;
val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
}
+ FREE(val_conv_12);
val_constr.data[m] = val_conv_12_constr;
}
+ FREE(val);
Route_set_paths(&this_ptr_conv, val_constr);
}
paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
else
paths_arg_constr.data = NULL;
- uint32_tArray* paths_arg_vals = (void*) paths_arg->elems /* XXX paths_arg leaks */;
+ uint32_tArray* paths_arg_vals = (void*) paths_arg->elems;
for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
uint32_tArray paths_arg_conv_12 = paths_arg_vals[m];
LDKCVec_RouteHopZ paths_arg_conv_12_constr;
paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
paths_arg_conv_12_constr.data = NULL;
- uint32_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems /* XXX paths_arg_conv_12 leaks */;
+ uint32_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems;
for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
uint32_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
LDKRouteHop paths_arg_conv_12_conv_10_conv;
paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
}
+ FREE(paths_arg_conv_12);
paths_arg_constr.data[m] = paths_arg_conv_12_constr;
}
+ FREE(paths_arg);
LDKPaymentParameters payment_params_arg_conv;
payment_params_arg_conv.inner = (void*)(payment_params_arg & (~1));
payment_params_arg_conv.is_owned = (payment_params_arg & 1) || (payment_params_arg == 0);
uint32_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
*ret_conv = Route_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
*ret_conv = RouteParameters_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t l = 0; l < val_constr.datalen; l++) {
uint32_t val_conv_11 = val_vals[l];
LDKRouteHint val_conv_11_conv;
val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
val_constr.data[l] = val_conv_11_conv;
}
+ FREE(val);
PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
}
route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
else
route_hints_arg_constr.data = NULL;
- uint32_t* route_hints_arg_vals = route_hints_arg->elems /* XXX route_hints_arg leaks */;
+ uint32_t* route_hints_arg_vals = route_hints_arg->elems;
for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
uint32_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
LDKRouteHint route_hints_arg_conv_11_conv;
route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
}
+ FREE(route_hints_arg);
void* expiry_time_arg_ptr = (void*)(((uintptr_t)expiry_time_arg) & ~1);
CHECK_ACCESS(expiry_time_arg_ptr);
LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
uint32_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
*ret_conv = PaymentParameters_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
else
val_constr.data = NULL;
- uint32_t* val_vals = val->elems /* XXX val leaks */;
+ uint32_t* val_vals = val->elems;
for (size_t o = 0; o < val_constr.datalen; o++) {
uint32_t val_conv_14 = val_vals[o];
LDKRouteHintHop val_conv_14_conv;
val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
val_constr.data[o] = val_conv_14_conv;
}
+ FREE(val);
RouteHint_set_a(&this_ptr_conv, val_constr);
}
a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
else
a_arg_constr.data = NULL;
- uint32_t* a_arg_vals = a_arg->elems /* XXX a_arg leaks */;
+ uint32_t* a_arg_vals = a_arg->elems;
for (size_t o = 0; o < a_arg_constr.datalen; o++) {
uint32_t a_arg_conv_14 = a_arg_vals[o];
LDKRouteHintHop a_arg_conv_14_conv;
a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
a_arg_constr.data[o] = a_arg_conv_14_conv;
}
+ FREE(a_arg);
LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
uint32_t ret_ref = 0;
CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
uint32_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
*ret_conv = RouteHint_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
*ret_conv = RouteHintHop_read(ser_ref);
+ FREE(ser);
return (uint32_t)ret_conv;
}
first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
else
first_hops_constr.data = NULL;
- uint32_t* first_hops_vals = first_hops->elems /* XXX first_hops leaks */;
+ uint32_t* first_hops_vals = first_hops->elems;
for (size_t q = 0; q < first_hops_constr.datalen; q++) {
uint32_t first_hops_conv_16 = first_hops_vals[q];
LDKChannelDetails first_hops_conv_16_conv;
CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
first_hops_constr.data[q] = first_hops_conv_16_conv;
}
+ FREE(first_hops);
first_hops_ptr = &first_hops_constr;
}
void* logger_ptr = (void*)(((uintptr_t)logger) & ~1);
hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
else
hops_constr.data = NULL;
- int8_tArray* hops_vals = (void*) hops->elems /* XXX hops leaks */;
+ int8_tArray* hops_vals = (void*) hops->elems;
for (size_t m = 0; m < hops_constr.datalen; m++) {
int8_tArray hops_conv_12 = hops_vals[m];
LDKPublicKey hops_conv_12_ref;
memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12);
hops_constr.data[m] = hops_conv_12_ref;
}
+ FREE(hops);
LDKRouteParameters route_params_conv;
route_params_conv.inner = (void*)(route_params & (~1));
route_params_conv.is_owned = false;
uint32_t __attribute__((export_name("TS_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
*ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
+ FREE(ser);
return (uint32_t)ret_conv;
}
uint32_t __attribute__((export_name("TS_ProbabilisticScorer_read"))) TS_ProbabilisticScorer_read(int8_tArray ser, uint32_t arg_a, uint32_t arg_b, uint32_t arg_c) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
- ser_ref.data = ser->elems /* XXX ser leaks */;
+ ser_ref.data = ser->elems;
LDKProbabilisticScoringParameters arg_a_conv;
arg_a_conv.inner = (void*)(arg_a & (~1));
arg_a_conv.is_owned = (arg_a & 1) || (arg_a == 0);
}
LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
*ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
+ FREE(ser);
return (uint32_t)ret_conv;
}
}
if (decodeString(wasm.TS_get_lib_version_string()) !== version.get_ldk_java_bindings_version())
- throw new Error("Compiled LDK library and LDK class failes do not match");
+ throw new Error("Compiled LDK library and LDK class files do not match");
// Fetching the LDK versions from C also checks that the header and binaries match
const c_bindings_ver: number = wasm.TS_get_ldk_c_bindings_version();
const ldk_ver: number = wasm.TS_get_ldk_version();
/* @internal */
export async function initializeWasmFromUint8Array(wasmBinary: Uint8Array) {
- imports.env["js_invoke_function"] = js_invoke;
+ imports.env["js_invoke_function_u"] = js_invoke;
+ imports.env["js_invoke_function_b"] = js_invoke;
const { instance: wasmInstance } = await WebAssembly.instantiate(wasmBinary, imports);
await finishInitializeWasm(wasmInstance);
}
/* @internal */
export async function initializeWasmFetch(uri: string) {
const stream = fetch(uri);
- imports.env["js_invoke_function"] = js_invoke;
+ imports.env["js_invoke_function_u"] = js_invoke;
+ imports.env["js_invoke_function_b"] = js_invoke;
const { instance: wasmInstance } = await WebAssembly.instantiateStreaming(stream, imports);
await finishInitializeWasm(wasmInstance);
}
}
-js_invoke = function(obj_ptr: number, fn_id: number, arg1: number, arg2: number, arg3: number, arg4: number, arg5: number, arg6: number, arg7: number, arg8: number, arg9: number, arg10: number) {
+js_invoke = function(obj_ptr: number, fn_id: number, arg1: bigint|number, arg2: bigint|number, arg3: bigint|number, arg4: bigint|number, arg5: bigint|number, arg6: bigint|number, arg7: bigint|number, arg8: bigint|number, arg9: bigint|number, arg10: bigint|number) {
const weak: WeakRef<object> = js_objs[obj_ptr];
if (weak == null || weak == undefined) {
console.error("Got function call on unknown/free'd JS object!");
console.error("Got function call on incorrect JS object!");
throw new Error("Got function call on incorrect JS object!");
}
- return fn.value.bind(obj)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+ const ret = fn.value.bind(obj)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+ if (ret === undefined || ret === null) return BigInt(0);
+ return BigInt(ret);
}
\ No newline at end of file