const ret_a_hu_conv: OutPoint = new OutPoint(null, ret_a);
ret_a_hu_conv.ptrs_to.add(this);;
Uint8Array ret_b = bindings.LDKC2Tuple_OutPointScriptZ_get_b(ret);
- TwoTuple<OutPoint, Uint8Array> ret_conv = new TwoTuple<OutPoint, Uint8Array>(ret_a_hu_conv, ret_b);
+ TwoTuple<OutPoint, Uint8Array> ret_conv = new TwoTuple<OutPoint, Uint8Array>(ret_a_hu_conv, ret_b, () -> {
+ bindings.C2Tuple_OutPointScriptZ_free(ret);
+ });
+ ret_a_hu_conv.ptrs_to.add(ret_conv);
return ret_conv;
}
}
public TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] block_connected(Uint8Array header, TwoTuple<Number, Uint8Array>[] txdata, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
- number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, (number[])Arrays.stream(txdata).map(arr_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_30.a, arr_conv_30.b)).toArray(), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).map(arr_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_30.a, arr_conv_30.b)).toArray(number[]::new), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] arr_conv_49_arr = new TwoTuple[ret.length];
for (int x = 0; x < ret.length; x++) {
number arr_conv_49 = ret[x];
number arr_conv_25_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(arr_conv_25);
number arr_conv_25_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(arr_conv_25));
TxOut arr_conv_25_b_conv = new TxOut(null, arr_conv_25_b);;
- TwoTuple<Number, TxOut> arr_conv_25_conv = new TwoTuple<Number, TxOut>(arr_conv_25_a, arr_conv_25_b_conv);
+ TwoTuple<Number, TxOut> arr_conv_25_conv = new TwoTuple<Number, TxOut>(arr_conv_25_a, arr_conv_25_b_conv, () -> {
+ bindings.C2Tuple_u32TxOutZ_free(arr_conv_25);
+ });
+ arr_conv_25_b_conv.ptrs_to.add(arr_conv_25_conv);
arr_conv_25_arr[z] = arr_conv_25_conv;
};
TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]> arr_conv_49_conv = new TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>(arr_conv_49_a, arr_conv_25_arr);
+ // Warning: We may not free the C tuple object!
arr_conv_49_arr[x] = arr_conv_49_conv;
}
/* TODO 2 TwoTuple<Number, Uint8Array> */;