Skip to content

Commit f6c75b1

Browse files
committed
Update auto-generated bindings
Memory leaks during tests are now: 193 allocations remained for 1136846 bytes.
1 parent 9da1fb8 commit f6c75b1

File tree

174 files changed

+4747
-2508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+4747
-2508
lines changed

src/main/java/org/ldk/impl/bindings.java

Lines changed: 69 additions & 33 deletions
Large diffs are not rendered by default.
313 Bytes
Binary file not shown.

src/main/java/org/ldk/structs/ChannelManager.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,12 @@ public void channel_monitor_updated(OutPoint funding_txo, long highest_applied_u
473473
* [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
474474
* [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
475475
*/
476-
public TwoTuple<byte[], byte[]> create_inbound_payment(Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) {
476+
public TwoTuple_PaymentHashPaymentSecretZ create_inbound_payment(Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) {
477477
long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
478478
if (ret < 1024) { return null; }
479-
byte[] ret_a = bindings.LDKC2Tuple_PaymentHashPaymentSecretZ_get_a(ret);
480-
byte[] ret_b = bindings.LDKC2Tuple_PaymentHashPaymentSecretZ_get_b(ret);
481-
TwoTuple<byte[], byte[]> ret_conv = new TwoTuple<byte[], byte[]>(ret_a, ret_b, () -> {
482-
bindings.C2Tuple_PaymentHashPaymentSecretZ_free(ret);
483-
});
484-
return ret_conv;
479+
TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
480+
ret_hu_conv.ptrs_to.add(this);
481+
return ret_hu_conv;
485482
}
486483

487484
/**

src/main/java/org/ldk/structs/ChannelMonitor.java

Lines changed: 38 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -82,46 +82,28 @@ public long get_latest_update_id() {
8282
/**
8383
* Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
8484
*/
85-
public TwoTuple<OutPoint, byte[]> get_funding_txo() {
85+
public TwoTuple_OutPointScriptZ get_funding_txo() {
8686
long ret = bindings.ChannelMonitor_get_funding_txo(this.ptr);
8787
if (ret < 1024) { return null; }
88-
long ret_a = bindings.LDKC2Tuple_OutPointScriptZ_get_a(ret);
89-
OutPoint ret_a_hu_conv = new OutPoint(null, ret_a);
90-
ret_a_hu_conv.ptrs_to.add(this);;
91-
byte[] ret_b = bindings.LDKC2Tuple_OutPointScriptZ_get_b(ret);
92-
TwoTuple<OutPoint, byte[]> ret_conv = new TwoTuple<OutPoint, byte[]>(ret_a_hu_conv, ret_b, () -> {
93-
bindings.C2Tuple_OutPointScriptZ_free(ret);
94-
});
95-
ret_a_hu_conv.ptrs_to.add(ret_conv);
96-
return ret_conv;
88+
TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret);
89+
ret_hu_conv.ptrs_to.add(this);
90+
return ret_hu_conv;
9791
}
9892

9993
/**
10094
* Gets a list of txids, with their output scripts (in the order they appear in the
10195
* transaction), which we must learn about spends of via block_connected().
10296
*/
103-
public TwoTuple<byte[], TwoTuple<Integer, byte[]>[]>[] get_outputs_to_watch() {
97+
public TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ[] get_outputs_to_watch() {
10498
long[] ret = bindings.ChannelMonitor_get_outputs_to_watch(this.ptr);
105-
TwoTuple<byte[], TwoTuple<Integer, byte[]>[]>[] ret_conv_47_arr = new TwoTuple[ret.length];
106-
for (int v = 0; v < ret.length; v++) {
107-
long ret_conv_47 = ret[v];
108-
byte[] ret_conv_47_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(ret_conv_47);
109-
long[] ret_conv_47_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(ret_conv_47);
110-
TwoTuple<Integer, byte[]>[] ret_conv_47_b_conv_27_arr = new TwoTuple[ret_conv_47_b.length];
111-
for (int b = 0; b < ret_conv_47_b.length; b++) {
112-
long ret_conv_47_b_conv_27 = ret_conv_47_b[b];
113-
int ret_conv_47_b_conv_27_a = bindings.LDKC2Tuple_u32ScriptZ_get_a(ret_conv_47_b_conv_27);
114-
byte[] ret_conv_47_b_conv_27_b = bindings.LDKC2Tuple_u32ScriptZ_get_b(ret_conv_47_b_conv_27);
115-
TwoTuple<Integer, byte[]> ret_conv_47_b_conv_27_conv = new TwoTuple<Integer, byte[]>(ret_conv_47_b_conv_27_a, ret_conv_47_b_conv_27_b, () -> {
116-
bindings.C2Tuple_u32ScriptZ_free(ret_conv_47_b_conv_27);
117-
});
118-
ret_conv_47_b_conv_27_arr[b] = ret_conv_47_b_conv_27_conv;
119-
};
120-
TwoTuple<byte[], TwoTuple<Integer, byte[]>[]> ret_conv_47_conv = new TwoTuple<byte[], TwoTuple<Integer, byte[]>[]>(ret_conv_47_a, ret_conv_47_b_conv_27_arr);
121-
// Warning: We may not free the C tuple object!
122-
ret_conv_47_arr[v] = ret_conv_47_conv;
99+
TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ[] ret_conv_40_arr = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ[ret.length];
100+
for (int o = 0; o < ret.length; o++) {
101+
long ret_conv_40 = ret[o];
102+
TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ ret_conv_40_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ(null, ret_conv_40);
103+
ret_conv_40_hu_conv.ptrs_to.add(this);
104+
ret_conv_40_arr[o] = ret_conv_40_hu_conv;
123105
}
124-
return ret_conv_47_arr;
106+
return ret_conv_40_arr;
125107
}
126108

127109
/**
@@ -200,33 +182,19 @@ public byte[][] get_latest_holder_commitment_txn(Logger logger) {
200182
*
201183
* [`get_outputs_to_watch`]: #method.get_outputs_to_watch
202184
*/
203-
public TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
204-
long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
205-
TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] ret_conv_46_arr = new TwoTuple[ret.length];
206-
for (int u = 0; u < ret.length; u++) {
207-
long ret_conv_46 = ret[u];
208-
byte[] ret_conv_46_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(ret_conv_46);
209-
long[] ret_conv_46_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(ret_conv_46);
210-
TwoTuple<Integer, TxOut>[] ret_conv_46_b_conv_26_arr = new TwoTuple[ret_conv_46_b.length];
211-
for (int a = 0; a < ret_conv_46_b.length; a++) {
212-
long ret_conv_46_b_conv_26 = ret_conv_46_b[a];
213-
int ret_conv_46_b_conv_26_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(ret_conv_46_b_conv_26);
214-
long ret_conv_46_b_conv_26_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(ret_conv_46_b_conv_26));
215-
TxOut ret_conv_46_b_conv_26_b_conv = new TxOut(null, ret_conv_46_b_conv_26_b);;
216-
TwoTuple<Integer, TxOut> ret_conv_46_b_conv_26_conv = new TwoTuple<Integer, TxOut>(ret_conv_46_b_conv_26_a, ret_conv_46_b_conv_26_b_conv, () -> {
217-
bindings.C2Tuple_u32TxOutZ_free(ret_conv_46_b_conv_26);
218-
});
219-
ret_conv_46_b_conv_26_b_conv.ptrs_to.add(ret_conv_46_b_conv_26_conv);
220-
ret_conv_46_b_conv_26_arr[a] = ret_conv_46_b_conv_26_conv;
221-
};
222-
TwoTuple<byte[], TwoTuple<Integer, TxOut>[]> ret_conv_46_conv = new TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>(ret_conv_46_a, ret_conv_46_b_conv_26_arr);
223-
// Warning: We may not free the C tuple object!
224-
ret_conv_46_arr[u] = ret_conv_46_conv;
185+
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
186+
long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
187+
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length];
188+
for (int n = 0; n < ret.length; n++) {
189+
long ret_conv_39 = ret[n];
190+
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ ret_conv_39_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret_conv_39);
191+
ret_conv_39_hu_conv.ptrs_to.add(this);
192+
ret_conv_39_arr[n] = ret_conv_39_hu_conv;
225193
}
226194
this.ptrs_to.add(broadcaster);
227195
this.ptrs_to.add(fee_estimator);
228196
this.ptrs_to.add(logger);
229-
return ret_conv_46_arr;
197+
return ret_conv_39_arr;
230198
}
231199

232200
/**
@@ -249,33 +217,19 @@ public void block_disconnected(byte[] header, int height, BroadcasterInterface b
249217
*
250218
* [`block_connected`]: Self::block_connected
251219
*/
252-
public TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] transactions_confirmed(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
253-
long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
254-
TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] ret_conv_46_arr = new TwoTuple[ret.length];
255-
for (int u = 0; u < ret.length; u++) {
256-
long ret_conv_46 = ret[u];
257-
byte[] ret_conv_46_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(ret_conv_46);
258-
long[] ret_conv_46_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(ret_conv_46);
259-
TwoTuple<Integer, TxOut>[] ret_conv_46_b_conv_26_arr = new TwoTuple[ret_conv_46_b.length];
260-
for (int a = 0; a < ret_conv_46_b.length; a++) {
261-
long ret_conv_46_b_conv_26 = ret_conv_46_b[a];
262-
int ret_conv_46_b_conv_26_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(ret_conv_46_b_conv_26);
263-
long ret_conv_46_b_conv_26_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(ret_conv_46_b_conv_26));
264-
TxOut ret_conv_46_b_conv_26_b_conv = new TxOut(null, ret_conv_46_b_conv_26_b);;
265-
TwoTuple<Integer, TxOut> ret_conv_46_b_conv_26_conv = new TwoTuple<Integer, TxOut>(ret_conv_46_b_conv_26_a, ret_conv_46_b_conv_26_b_conv, () -> {
266-
bindings.C2Tuple_u32TxOutZ_free(ret_conv_46_b_conv_26);
267-
});
268-
ret_conv_46_b_conv_26_b_conv.ptrs_to.add(ret_conv_46_b_conv_26_conv);
269-
ret_conv_46_b_conv_26_arr[a] = ret_conv_46_b_conv_26_conv;
270-
};
271-
TwoTuple<byte[], TwoTuple<Integer, TxOut>[]> ret_conv_46_conv = new TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>(ret_conv_46_a, ret_conv_46_b_conv_26_arr);
272-
// Warning: We may not free the C tuple object!
273-
ret_conv_46_arr[u] = ret_conv_46_conv;
220+
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
221+
long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
222+
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length];
223+
for (int n = 0; n < ret.length; n++) {
224+
long ret_conv_39 = ret[n];
225+
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ ret_conv_39_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret_conv_39);
226+
ret_conv_39_hu_conv.ptrs_to.add(this);
227+
ret_conv_39_arr[n] = ret_conv_39_hu_conv;
274228
}
275229
this.ptrs_to.add(broadcaster);
276230
this.ptrs_to.add(fee_estimator);
277231
this.ptrs_to.add(logger);
278-
return ret_conv_46_arr;
232+
return ret_conv_39_arr;
279233
}
280234

281235
/**
@@ -302,33 +256,19 @@ public void transaction_unconfirmed(byte[] txid, BroadcasterInterface broadcaste
302256
*
303257
* [`block_connected`]: Self::block_connected
304258
*/
305-
public TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] best_block_updated(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
259+
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
306260
long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
307-
TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] ret_conv_46_arr = new TwoTuple[ret.length];
308-
for (int u = 0; u < ret.length; u++) {
309-
long ret_conv_46 = ret[u];
310-
byte[] ret_conv_46_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(ret_conv_46);
311-
long[] ret_conv_46_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(ret_conv_46);
312-
TwoTuple<Integer, TxOut>[] ret_conv_46_b_conv_26_arr = new TwoTuple[ret_conv_46_b.length];
313-
for (int a = 0; a < ret_conv_46_b.length; a++) {
314-
long ret_conv_46_b_conv_26 = ret_conv_46_b[a];
315-
int ret_conv_46_b_conv_26_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(ret_conv_46_b_conv_26);
316-
long ret_conv_46_b_conv_26_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(ret_conv_46_b_conv_26));
317-
TxOut ret_conv_46_b_conv_26_b_conv = new TxOut(null, ret_conv_46_b_conv_26_b);;
318-
TwoTuple<Integer, TxOut> ret_conv_46_b_conv_26_conv = new TwoTuple<Integer, TxOut>(ret_conv_46_b_conv_26_a, ret_conv_46_b_conv_26_b_conv, () -> {
319-
bindings.C2Tuple_u32TxOutZ_free(ret_conv_46_b_conv_26);
320-
});
321-
ret_conv_46_b_conv_26_b_conv.ptrs_to.add(ret_conv_46_b_conv_26_conv);
322-
ret_conv_46_b_conv_26_arr[a] = ret_conv_46_b_conv_26_conv;
323-
};
324-
TwoTuple<byte[], TwoTuple<Integer, TxOut>[]> ret_conv_46_conv = new TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>(ret_conv_46_a, ret_conv_46_b_conv_26_arr);
325-
// Warning: We may not free the C tuple object!
326-
ret_conv_46_arr[u] = ret_conv_46_conv;
261+
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length];
262+
for (int n = 0; n < ret.length; n++) {
263+
long ret_conv_39 = ret[n];
264+
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ ret_conv_39_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret_conv_39);
265+
ret_conv_39_hu_conv.ptrs_to.add(this);
266+
ret_conv_39_arr[n] = ret_conv_39_hu_conv;
327267
}
328268
this.ptrs_to.add(broadcaster);
329269
this.ptrs_to.add(fee_estimator);
330270
this.ptrs_to.add(logger);
331-
return ret_conv_46_arr;
271+
return ret_conv_39_arr;
332272
}
333273

334274
/**

src/main/java/org/ldk/structs/Confirm.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static interface ConfirmInterface {
7070
* [chain order]: Confirm#Order
7171
* [`best_block_updated`]: Self::best_block_updated
7272
*/
73-
void transactions_confirmed(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height);
73+
void transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height);
7474
/**
7575
* Processes a transaction that is no longer confirmed as result of a chain reorganization.
7676
*
@@ -111,17 +111,14 @@ public static Confirm new_impl(ConfirmInterface arg) {
111111
final LDKConfirmHolder impl_holder = new LDKConfirmHolder();
112112
impl_holder.held = new Confirm(new bindings.LDKConfirm() {
113113
@Override public void transactions_confirmed(byte[] header, long[] txdata, int height) {
114-
TwoTuple<Long, byte[]>[] txdata_conv_24_arr = new TwoTuple[txdata.length];
115-
for (int y = 0; y < txdata.length; y++) {
116-
long txdata_conv_24 = txdata[y];
117-
long txdata_conv_24_a = bindings.LDKC2Tuple_usizeTransactionZ_get_a(txdata_conv_24);
118-
byte[] txdata_conv_24_b = bindings.LDKC2Tuple_usizeTransactionZ_get_b(txdata_conv_24);
119-
TwoTuple<Long, byte[]> txdata_conv_24_conv = new TwoTuple<Long, byte[]>(txdata_conv_24_a, txdata_conv_24_b, () -> {
120-
bindings.C2Tuple_usizeTransactionZ_free(txdata_conv_24);
121-
});
122-
txdata_conv_24_arr[y] = txdata_conv_24_conv;
114+
TwoTuple_usizeTransactionZ[] txdata_conv_28_arr = new TwoTuple_usizeTransactionZ[txdata.length];
115+
for (int c = 0; c < txdata.length; c++) {
116+
long txdata_conv_28 = txdata[c];
117+
TwoTuple_usizeTransactionZ txdata_conv_28_hu_conv = new TwoTuple_usizeTransactionZ(null, txdata_conv_28);
118+
txdata_conv_28_hu_conv.ptrs_to.add(this);
119+
txdata_conv_28_arr[c] = txdata_conv_28_hu_conv;
123120
}
124-
arg.transactions_confirmed(header, txdata_conv_24_arr, height);
121+
arg.transactions_confirmed(header, txdata_conv_28_arr, height);
125122
}
126123
@Override public void transaction_unconfirmed(byte[] txid) {
127124
arg.transaction_unconfirmed(txid);
@@ -151,8 +148,8 @@ public static Confirm new_impl(ConfirmInterface arg) {
151148
* [chain order]: Confirm#Order
152149
* [`best_block_updated`]: Self::best_block_updated
153150
*/
154-
public void transactions_confirmed(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height) {
155-
bindings.Confirm_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray() : null, height);
151+
public void transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height) {
152+
bindings.Confirm_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height);
156153
}
157154

158155
/**

src/main/java/org/ldk/structs/CustomMessageHandler.java

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static interface CustomMessageHandlerInterface {
3636
* correspond to the intended recipients node ids. If no connection to one of the
3737
* specified node does not exist, the message is simply not sent to it.
3838
*/
39-
TwoTuple<byte[], Type>[] get_and_clear_pending_msg();
39+
TwoTuple_PublicKeyTypeZ[] get_and_clear_pending_msg();
4040
}
4141
private static class LDKCustomMessageHandlerHolder { CustomMessageHandler held; }
4242
public static CustomMessageHandler new_impl(CustomMessageHandlerInterface arg, CustomMessageReader.CustomMessageReaderInterface CustomMessageReader_impl) {
@@ -50,9 +50,8 @@ public static CustomMessageHandler new_impl(CustomMessageHandlerInterface arg, C
5050
return result;
5151
}
5252
@Override public long[] get_and_clear_pending_msg() {
53-
TwoTuple<byte[], Type>[] ret = arg.get_and_clear_pending_msg();
54-
long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_24 -> bindings.C2Tuple_PublicKeyTypeZ_new(ret_conv_24.a, ret_conv_24.b == null ? 0 : ret_conv_24.b.ptr)).toArray() : null;
55-
for (TwoTuple<byte[], Type> ret_conv_24: ret) { impl_holder.held.ptrs_to.add(ret_conv_24.b); };
53+
TwoTuple_PublicKeyTypeZ[] ret = arg.get_and_clear_pending_msg();
54+
long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_25 -> ret_conv_25 != null ? ret_conv_25.ptr : 0).toArray() : null;
5655
return result;
5756
}
5857
}, CustomMessageReader.new_impl(CustomMessageReader_impl).bindings_instance);
@@ -86,22 +85,16 @@ public Result_NoneLightningErrorZ handle_custom_message(Type msg, byte[] sender_
8685
* correspond to the intended recipients node ids. If no connection to one of the
8786
* specified node does not exist, the message is simply not sent to it.
8887
*/
89-
public TwoTuple<byte[], Type>[] get_and_clear_pending_msg() {
88+
public TwoTuple_PublicKeyTypeZ[] get_and_clear_pending_msg() {
9089
long[] ret = bindings.CustomMessageHandler_get_and_clear_pending_msg(this.ptr);
91-
TwoTuple<byte[], Type>[] ret_conv_24_arr = new TwoTuple[ret.length];
92-
for (int y = 0; y < ret.length; y++) {
93-
long ret_conv_24 = ret[y];
94-
byte[] ret_conv_24_a = bindings.LDKC2Tuple_PublicKeyTypeZ_get_a(ret_conv_24);
95-
long ret_conv_24_b = bindings.LDKC2Tuple_PublicKeyTypeZ_get_b(ret_conv_24);
96-
Type ret_hu_conv = new Type(null, ret_conv_24_b);
97-
ret_hu_conv.ptrs_to.add(this);;
98-
TwoTuple<byte[], Type> ret_conv_24_conv = new TwoTuple<byte[], Type>(ret_conv_24_a, ret_hu_conv, () -> {
99-
bindings.C2Tuple_PublicKeyTypeZ_free(ret_conv_24);
100-
});
101-
ret_hu_conv.ptrs_to.add(ret_conv_24_conv);
102-
ret_conv_24_arr[y] = ret_conv_24_conv;
90+
TwoTuple_PublicKeyTypeZ[] ret_conv_25_arr = new TwoTuple_PublicKeyTypeZ[ret.length];
91+
for (int z = 0; z < ret.length; z++) {
92+
long ret_conv_25 = ret[z];
93+
TwoTuple_PublicKeyTypeZ ret_conv_25_hu_conv = new TwoTuple_PublicKeyTypeZ(null, ret_conv_25);
94+
ret_conv_25_hu_conv.ptrs_to.add(this);
95+
ret_conv_25_arr[z] = ret_conv_25_hu_conv;
10396
}
104-
return ret_conv_24_arr;
97+
return ret_conv_25_arr;
10598
}
10699

107100
}

0 commit comments

Comments
 (0)