Merge pull request #45 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / ChannelMonitor.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
8
9
10 /**
11  * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
12  * on-chain transactions to ensure no loss of funds occurs.
13  * 
14  * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
15  * information and are actively monitoring the chain.
16  * 
17  * Pending Events or updated HTLCs which have not yet been read out by
18  * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
19  * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
20  * gotten are fully handled before re-serializing the new state.
21  * 
22  * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
23  * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
24  * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
25  * returned block hash and the the current chain and then reconnecting blocks to get to the
26  * best chain) upon deserializing the object!
27  */
28 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
29 public class ChannelMonitor extends CommonBase {
30         ChannelMonitor(Object _dummy, long ptr) { super(ptr); }
31         @Override @SuppressWarnings("deprecation")
32         protected void finalize() throws Throwable {
33                 super.finalize();
34                 if (ptr != 0) { bindings.ChannelMonitor_free(ptr); }
35         }
36
37         /**
38          * Creates a copy of the ChannelMonitor
39          */
40         public ChannelMonitor clone() {
41                 long ret = bindings.ChannelMonitor_clone(this.ptr);
42                 if (ret < 1024) { return null; }
43                 ChannelMonitor ret_hu_conv = new ChannelMonitor(null, ret);
44                 ret_hu_conv.ptrs_to.add(this);
45                 return ret_hu_conv;
46         }
47
48         /**
49          * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
50          */
51         public byte[] write() {
52                 byte[] ret = bindings.ChannelMonitor_write(this.ptr);
53                 return ret;
54         }
55
56         /**
57          * Updates a ChannelMonitor on the basis of some new information provided by the Channel
58          * itself.
59          * 
60          * panics if the given update is not the next update by update_id.
61          */
62         public Result_NoneMonitorUpdateErrorZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
63                 long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr & ~1, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
64                 if (ret < 1024) { return null; }
65                 Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
66                 this.ptrs_to.add(updates);
67                 this.ptrs_to.add(broadcaster);
68                 this.ptrs_to.add(fee_estimator);
69                 this.ptrs_to.add(logger);
70                 return ret_hu_conv;
71         }
72
73         /**
74          * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
75          * ChannelMonitor.
76          */
77         public long get_latest_update_id() {
78                 long ret = bindings.ChannelMonitor_get_latest_update_id(this.ptr);
79                 return ret;
80         }
81
82         /**
83          * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
84          */
85         public TwoTuple<OutPoint, byte[]> get_funding_txo() {
86                 long ret = bindings.ChannelMonitor_get_funding_txo(this.ptr);
87                 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;
97         }
98
99         /**
100          * Gets a list of txids, with their output scripts (in the order they appear in the
101          * transaction), which we must learn about spends of via block_connected().
102          */
103         public TwoTuple<byte[], TwoTuple<Integer, byte[]>[]>[] get_outputs_to_watch() {
104                 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;
123                 }
124                 return ret_conv_47_arr;
125         }
126
127         /**
128          * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
129          * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
130          * have been registered.
131          */
132         public void load_outputs_to_watch(Filter filter) {
133                 bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : filter.ptr);
134                 this.ptrs_to.add(filter);
135         }
136
137         /**
138          * Get the list of HTLCs who's status has been updated on chain. This should be called by
139          * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
140          */
141         public MonitorEvent[] get_and_clear_pending_monitor_events() {
142                 long[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr);
143                 MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length];
144                 for (int o = 0; o < ret.length; o++) {
145                         long ret_conv_14 = ret[o];
146                         MonitorEvent ret_conv_14_hu_conv = MonitorEvent.constr_from_ptr(ret_conv_14);
147                         ret_conv_14_hu_conv.ptrs_to.add(this);
148                         ret_conv_14_arr[o] = ret_conv_14_hu_conv;
149                 }
150                 return ret_conv_14_arr;
151         }
152
153         /**
154          * Gets the list of pending events which were generated by previous actions, clearing the list
155          * in the process.
156          * 
157          * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
158          * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
159          * no internal locking in ChannelMonitors.
160          */
161         public Event[] get_and_clear_pending_events() {
162                 long[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr);
163                 Event[] ret_conv_7_arr = new Event[ret.length];
164                 for (int h = 0; h < ret.length; h++) {
165                         long ret_conv_7 = ret[h];
166                         Event ret_conv_7_hu_conv = Event.constr_from_ptr(ret_conv_7);
167                         ret_conv_7_hu_conv.ptrs_to.add(this);
168                         ret_conv_7_arr[h] = ret_conv_7_hu_conv;
169                 }
170                 return ret_conv_7_arr;
171         }
172
173         /**
174          * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
175          * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
176          * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
177          * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
178          * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
179          * broadcast them if counterparty don't close channel with his higher commitment transaction after a
180          * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
181          * out-of-band the other node operator to coordinate with him if option is available to you.
182          * In any-case, choice is up to the user.
183          */
184         public byte[][] get_latest_holder_commitment_txn(Logger logger) {
185                 byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr);
186                 this.ptrs_to.add(logger);
187                 return ret;
188         }
189
190         /**
191          * Processes transactions in a newly connected block, which may result in any of the following:
192          * - update the monitor's state against resolved HTLCs
193          * - punish the counterparty in the case of seeing a revoked commitment transaction
194          * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
195          * - detect settled outputs for later spending
196          * - schedule and bump any in-flight claims
197          * 
198          * Returns any new outputs to watch from `txdata`; after called, these are also included in
199          * [`get_outputs_to_watch`].
200          * 
201          * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
202          */
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;
225                 }
226                 this.ptrs_to.add(broadcaster);
227                 this.ptrs_to.add(fee_estimator);
228                 this.ptrs_to.add(logger);
229                 return ret_conv_46_arr;
230         }
231
232         /**
233          * Determines if the disconnected block contained any transactions of interest and updates
234          * appropriately.
235          */
236         public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
237                 bindings.ChannelMonitor_block_disconnected(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
238                 this.ptrs_to.add(broadcaster);
239                 this.ptrs_to.add(fee_estimator);
240                 this.ptrs_to.add(logger);
241         }
242
243         /**
244          * Processes transactions confirmed in a block with the given header and height, returning new
245          * outputs to watch. See [`block_connected`] for details.
246          * 
247          * Used instead of [`block_connected`] by clients that are notified of transactions rather than
248          * blocks. See [`chain::Confirm`] for calling expectations.
249          * 
250          * [`block_connected`]: Self::block_connected
251          */
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;
274                 }
275                 this.ptrs_to.add(broadcaster);
276                 this.ptrs_to.add(fee_estimator);
277                 this.ptrs_to.add(logger);
278                 return ret_conv_46_arr;
279         }
280
281         /**
282          * Processes a transaction that was reorganized out of the chain.
283          * 
284          * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
285          * than blocks. See [`chain::Confirm`] for calling expectations.
286          * 
287          * [`block_disconnected`]: Self::block_disconnected
288          */
289         public void transaction_unconfirmed(byte[] txid, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
290                 bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, txid, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
291                 this.ptrs_to.add(broadcaster);
292                 this.ptrs_to.add(fee_estimator);
293                 this.ptrs_to.add(logger);
294         }
295
296         /**
297          * Updates the monitor with the current best chain tip, returning new outputs to watch. See
298          * [`block_connected`] for details.
299          * 
300          * Used instead of [`block_connected`] by clients that are notified of transactions rather than
301          * blocks. See [`chain::Confirm`] for calling expectations.
302          * 
303          * [`block_connected`]: Self::block_connected
304          */
305         public TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] best_block_updated(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
306                 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;
327                 }
328                 this.ptrs_to.add(broadcaster);
329                 this.ptrs_to.add(fee_estimator);
330                 this.ptrs_to.add(logger);
331                 return ret_conv_46_arr;
332         }
333
334         /**
335          * Returns the set of txids that should be monitored for re-organization out of the chain.
336          */
337         public byte[][] get_relevant_txids() {
338                 byte[][] ret = bindings.ChannelMonitor_get_relevant_txids(this.ptr);
339                 return ret;
340         }
341
342         /**
343          * Gets the latest best block which was connected either via the [`chain::Listen`] or
344          * [`chain::Confirm`] interfaces.
345          */
346         public BestBlock current_best_block() {
347                 long ret = bindings.ChannelMonitor_current_best_block(this.ptr);
348                 if (ret < 1024) { return null; }
349                 BestBlock ret_hu_conv = new BestBlock(null, ret);
350                 ret_hu_conv.ptrs_to.add(this);
351                 return ret_hu_conv;
352         }
353
354         /**
355          * Gets the balances in this channel which are either claimable by us if we were to
356          * force-close the channel now or which are claimable on-chain (possibly awaiting
357          * confirmation).
358          * 
359          * Any balances in the channel which are available on-chain (excluding on-chain fees) are
360          * included here until an [`Event::SpendableOutputs`] event has been generated for the
361          * balance, or until our counterparty has claimed the balance and accrued several
362          * confirmations on the claim transaction.
363          * 
364          * Note that the balances available when you or your counterparty have broadcasted revoked
365          * state(s) may not be fully captured here.
366          * 
367          * See [`Balance`] for additional details on the types of claimable balances which
368          * may be returned here and their meanings.
369          */
370         public Balance[] get_claimable_balances() {
371                 long[] ret = bindings.ChannelMonitor_get_claimable_balances(this.ptr);
372                 Balance[] ret_conv_9_arr = new Balance[ret.length];
373                 for (int j = 0; j < ret.length; j++) {
374                         long ret_conv_9 = ret[j];
375                         Balance ret_conv_9_hu_conv = Balance.constr_from_ptr(ret_conv_9);
376                         ret_conv_9_hu_conv.ptrs_to.add(this);
377                         ret_conv_9_arr[j] = ret_conv_9_hu_conv;
378                 }
379                 return ret_conv_9_arr;
380         }
381
382 }