[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / RoutingMessageHandler.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8 /**
9  * A trait to describe an object which can receive routing messages.
10  * 
11  * # Implementor DoS Warnings
12  * 
13  * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
14  * handling inbound queries. Implementors using an on-disk network graph should be aware of
15  * repeated disk I/O for queries accessing different parts of the network graph.
16  */
17 public class RoutingMessageHandler : CommonBase {
18         internal readonly bindings.LDKRoutingMessageHandler bindings_instance;
19         internal RoutingMessageHandler(object _dummy, long ptr) : base(ptr) { bindings_instance = null; }
20         private RoutingMessageHandler(bindings.LDKRoutingMessageHandler arg, bindings.LDKMessageSendEventsProvider MessageSendEventsProvider) : base(bindings.LDKRoutingMessageHandler_new(arg, MessageSendEventsProvider)) {
21                 this.ptrs_to.AddLast(arg);
22                 this.ptrs_to.AddLast(MessageSendEventsProvider);
23                 this.bindings_instance = arg;
24         }
25         ~RoutingMessageHandler() {
26                 if (ptr != 0) { bindings.RoutingMessageHandler_free(ptr); }
27         }
28
29         public interface RoutingMessageHandlerInterface {
30                 /**
31                  * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
32                  * `false` or returning an `Err` otherwise.
33                  */
34                 Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement _msg);
35                 /**
36                  * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
37                  * or returning an `Err` otherwise.
38                  */
39                 Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement _msg);
40                 /**
41                  * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
42                  * `false` or returning an `Err` otherwise.
43                  */
44                 Result_boolLightningErrorZ handle_channel_update(ChannelUpdate _msg);
45                 /**
46                  * Gets channel announcements and updates required to dump our routing table to a remote node,
47                  * starting at the `short_channel_id` indicated by `starting_point` and including announcements
48                  * for a single channel.
49                  */
50                 Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement(long _starting_point);
51                 /**
52                  * Gets a node announcement required to dump our routing table to a remote node, starting at
53                  * the node *after* the provided pubkey and including up to one announcement immediately
54                  * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
55                  * If `None` is provided for `starting_point`, we start at the first node.
56                  * 
57                  * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
58                  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
59                  */
60                 NodeAnnouncement get_next_node_announcement(NodeId _starting_point);
61                 /**
62                  * Called when a connection is established with a peer. This can be used to
63                  * perform routing table synchronization using a strategy defined by the
64                  * implementor.
65                  * 
66                  * May return an `Err(())` if the features the peer supports are not sufficient to communicate
67                  * with us. Implementors should be somewhat conservative about doing so, however, as other
68                  * message handlers may still wish to communicate with this peer.
69                  */
70                 Result_NoneNoneZ peer_connected(byte[] _their_node_id, Init _init, bool _inbound);
71                 /**
72                  * Handles the reply of a query we initiated to learn about channels
73                  * for a given range of blocks. We can expect to receive one or more
74                  * replies to a single query.
75                  */
76                 Result_NoneLightningErrorZ handle_reply_channel_range(byte[] _their_node_id, ReplyChannelRange _msg);
77                 /**
78                  * Handles the reply of a query we initiated asking for routing gossip
79                  * messages for a list of channels. We should receive this message when
80                  * a node has completed its best effort to send us the pertaining routing
81                  * gossip messages.
82                  */
83                 Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] _their_node_id, ReplyShortChannelIdsEnd _msg);
84                 /**
85                  * Handles when a peer asks us to send a list of `short_channel_id`s
86                  * for the requested range of blocks.
87                  */
88                 Result_NoneLightningErrorZ handle_query_channel_range(byte[] _their_node_id, QueryChannelRange _msg);
89                 /**
90                  * Handles when a peer asks us to send routing gossip messages for a
91                  * list of `short_channel_id`s.
92                  */
93                 Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] _their_node_id, QueryShortChannelIds _msg);
94                 /**
95                  * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
96                  * pending some async action. While there is no guarantee of the rate of future messages, the
97                  * caller should seek to reduce the rate of new gossip messages handled, especially
98                  * [`ChannelAnnouncement`]s.
99                  */
100                 bool processing_queue_high();
101                 /**
102                  * Gets the node feature flags which this handler itself supports. All available handlers are
103                  * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
104                  * which are broadcasted in our [`NodeAnnouncement`] message.
105                  */
106                 NodeFeatures provided_node_features();
107                 /**
108                  * Gets the init feature flags which should be sent to the given peer. All available handlers
109                  * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
110                  * which are sent in our [`Init`] message.
111                  * 
112                  * Note that this method is called before [`Self::peer_connected`].
113                  */
114                 InitFeatures provided_init_features(byte[] _their_node_id);
115         }
116         private class LDKRoutingMessageHandlerHolder { internal RoutingMessageHandler held; }
117         private class LDKRoutingMessageHandlerImpl : bindings.LDKRoutingMessageHandler {
118                 internal LDKRoutingMessageHandlerImpl(RoutingMessageHandlerInterface arg, LDKRoutingMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; }
119                 private RoutingMessageHandlerInterface arg;
120                 private LDKRoutingMessageHandlerHolder impl_holder;
121                 public long handle_node_announcement(long _msg) {
122                         org.ldk.structs.NodeAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, _msg); }
123                         Result_boolLightningErrorZ ret = arg.handle_node_announcement(_msg_hu_conv);
124                                 GC.KeepAlive(arg);
125                         long result = ret == null ? 0 : ret.clone_ptr();
126                         return result;
127                 }
128                 public long handle_channel_announcement(long _msg) {
129                         org.ldk.structs.ChannelAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, _msg); }
130                         Result_boolLightningErrorZ ret = arg.handle_channel_announcement(_msg_hu_conv);
131                                 GC.KeepAlive(arg);
132                         long result = ret == null ? 0 : ret.clone_ptr();
133                         return result;
134                 }
135                 public long handle_channel_update(long _msg) {
136                         org.ldk.structs.ChannelUpdate _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, _msg); }
137                         Result_boolLightningErrorZ ret = arg.handle_channel_update(_msg_hu_conv);
138                                 GC.KeepAlive(arg);
139                         long result = ret == null ? 0 : ret.clone_ptr();
140                         return result;
141                 }
142                 public long get_next_channel_announcement(long _starting_point) {
143                         Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = arg.get_next_channel_announcement(_starting_point);
144                                 GC.KeepAlive(arg);
145                         long result = ret == null ? 0 : ret.clone_ptr();
146                         if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); };
147                         return result;
148                 }
149                 public long get_next_node_announcement(long _starting_point) {
150                         org.ldk.structs.NodeId _starting_point_hu_conv = null; if (_starting_point < 0 || _starting_point > 4096) { _starting_point_hu_conv = new org.ldk.structs.NodeId(null, _starting_point); }
151                         if (_starting_point_hu_conv != null) { _starting_point_hu_conv.ptrs_to.AddLast(this); };
152                         NodeAnnouncement ret = arg.get_next_node_announcement(_starting_point_hu_conv);
153                                 GC.KeepAlive(arg);
154                         long result = ret == null ? 0 : ret.clone_ptr();
155                         return result;
156                 }
157                 public long peer_connected(byte[] _their_node_id, long _init, bool _inbound) {
158                         org.ldk.structs.Init _init_hu_conv = null; if (_init < 0 || _init > 4096) { _init_hu_conv = new org.ldk.structs.Init(null, _init); }
159                         Result_NoneNoneZ ret = arg.peer_connected(_their_node_id, _init_hu_conv, _inbound);
160                                 GC.KeepAlive(arg);
161                         long result = ret == null ? 0 : ret.clone_ptr();
162                         return result;
163                 }
164                 public long handle_reply_channel_range(byte[] _their_node_id, long _msg) {
165                         org.ldk.structs.ReplyChannelRange _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, _msg); }
166                         if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); };
167                         Result_NoneLightningErrorZ ret = arg.handle_reply_channel_range(_their_node_id, _msg_hu_conv);
168                                 GC.KeepAlive(arg);
169                         long result = ret == null ? 0 : ret.clone_ptr();
170                         return result;
171                 }
172                 public long handle_reply_short_channel_ids_end(byte[] _their_node_id, long _msg) {
173                         org.ldk.structs.ReplyShortChannelIdsEnd _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, _msg); }
174                         if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); };
175                         Result_NoneLightningErrorZ ret = arg.handle_reply_short_channel_ids_end(_their_node_id, _msg_hu_conv);
176                                 GC.KeepAlive(arg);
177                         long result = ret == null ? 0 : ret.clone_ptr();
178                         return result;
179                 }
180                 public long handle_query_channel_range(byte[] _their_node_id, long _msg) {
181                         org.ldk.structs.QueryChannelRange _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, _msg); }
182                         if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); };
183                         Result_NoneLightningErrorZ ret = arg.handle_query_channel_range(_their_node_id, _msg_hu_conv);
184                                 GC.KeepAlive(arg);
185                         long result = ret == null ? 0 : ret.clone_ptr();
186                         return result;
187                 }
188                 public long handle_query_short_channel_ids(byte[] _their_node_id, long _msg) {
189                         org.ldk.structs.QueryShortChannelIds _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, _msg); }
190                         if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); };
191                         Result_NoneLightningErrorZ ret = arg.handle_query_short_channel_ids(_their_node_id, _msg_hu_conv);
192                                 GC.KeepAlive(arg);
193                         long result = ret == null ? 0 : ret.clone_ptr();
194                         return result;
195                 }
196                 public bool processing_queue_high() {
197                         bool ret = arg.processing_queue_high();
198                                 GC.KeepAlive(arg);
199                         return ret;
200                 }
201                 public long provided_node_features() {
202                         NodeFeatures ret = arg.provided_node_features();
203                                 GC.KeepAlive(arg);
204                         long result = ret == null ? 0 : ret.clone_ptr();
205                         return result;
206                 }
207                 public long provided_init_features(byte[] _their_node_id) {
208                         InitFeatures ret = arg.provided_init_features(_their_node_id);
209                                 GC.KeepAlive(arg);
210                         long result = ret == null ? 0 : ret.clone_ptr();
211                         return result;
212                 }
213         }
214         public static RoutingMessageHandler new_impl(RoutingMessageHandlerInterface arg, MessageSendEventsProvider.MessageSendEventsProviderInterface MessageSendEventsProvider_impl) {
215                 LDKRoutingMessageHandlerHolder impl_holder = new LDKRoutingMessageHandlerHolder();
216                 impl_holder.held = new RoutingMessageHandler(new LDKRoutingMessageHandlerImpl(arg, impl_holder), MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance);
217                 return impl_holder.held;
218         }
219
220         /**
221          * Gets the underlying MessageSendEventsProvider.
222          */
223         public MessageSendEventsProvider get_message_send_events_provider() {
224                 MessageSendEventsProvider res = new MessageSendEventsProvider(null, bindings.LDKRoutingMessageHandler_get_MessageSendEventsProvider(this.ptr));
225                 this.ptrs_to.AddLast(res);
226                 return res;
227         }
228
229         /**
230          * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
231          * `false` or returning an `Err` otherwise.
232          */
233         public Result_boolLightningErrorZ handle_node_announcement(org.ldk.structs.NodeAnnouncement msg) {
234                 long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr);
235                 GC.KeepAlive(this);
236                 GC.KeepAlive(msg);
237                 if (ret >= 0 && ret <= 4096) { return null; }
238                 Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
239                 if (this != null) { this.ptrs_to.AddLast(msg); };
240                 return ret_hu_conv;
241         }
242
243         /**
244          * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
245          * or returning an `Err` otherwise.
246          */
247         public Result_boolLightningErrorZ handle_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) {
248                 long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr);
249                 GC.KeepAlive(this);
250                 GC.KeepAlive(msg);
251                 if (ret >= 0 && ret <= 4096) { return null; }
252                 Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
253                 if (this != null) { this.ptrs_to.AddLast(msg); };
254                 return ret_hu_conv;
255         }
256
257         /**
258          * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
259          * `false` or returning an `Err` otherwise.
260          */
261         public Result_boolLightningErrorZ handle_channel_update(org.ldk.structs.ChannelUpdate msg) {
262                 long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr);
263                 GC.KeepAlive(this);
264                 GC.KeepAlive(msg);
265                 if (ret >= 0 && ret <= 4096) { return null; }
266                 Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
267                 if (this != null) { this.ptrs_to.AddLast(msg); };
268                 return ret_hu_conv;
269         }
270
271         /**
272          * Gets channel announcements and updates required to dump our routing table to a remote node,
273          * starting at the `short_channel_id` indicated by `starting_point` and including announcements
274          * for a single channel.
275          */
276         public Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement(long starting_point) {
277                 long ret = bindings.RoutingMessageHandler_get_next_channel_announcement(this.ptr, starting_point);
278                 GC.KeepAlive(this);
279                 GC.KeepAlive(starting_point);
280                 if (ret >= 0 && ret <= 4096) { return null; }
281                 org.ldk.structs.Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_hu_conv = org.ldk.structs.Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.constr_from_ptr(ret);
282                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
283                 return ret_hu_conv;
284         }
285
286         /**
287          * Gets a node announcement required to dump our routing table to a remote node, starting at
288          * the node *after* the provided pubkey and including up to one announcement immediately
289          * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
290          * If `None` is provided for `starting_point`, we start at the first node.
291          * 
292          * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
293          * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
294          */
295         public NodeAnnouncement get_next_node_announcement(org.ldk.structs.NodeId starting_point) {
296                 long ret = bindings.RoutingMessageHandler_get_next_node_announcement(this.ptr, starting_point == null ? 0 : starting_point.ptr);
297                 GC.KeepAlive(this);
298                 GC.KeepAlive(starting_point);
299                 if (ret >= 0 && ret <= 4096) { return null; }
300                 org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); }
301                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
302                 if (this != null) { this.ptrs_to.AddLast(starting_point); };
303                 return ret_hu_conv;
304         }
305
306         /**
307          * Called when a connection is established with a peer. This can be used to
308          * perform routing table synchronization using a strategy defined by the
309          * implementor.
310          * 
311          * May return an `Err(())` if the features the peer supports are not sufficient to communicate
312          * with us. Implementors should be somewhat conservative about doing so, however, as other
313          * message handlers may still wish to communicate with this peer.
314          */
315         public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init, bool inbound) {
316                 long ret = bindings.RoutingMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr, inbound);
317                 GC.KeepAlive(this);
318                 GC.KeepAlive(their_node_id);
319                 GC.KeepAlive(init);
320                 GC.KeepAlive(inbound);
321                 if (ret >= 0 && ret <= 4096) { return null; }
322                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
323                 if (this != null) { this.ptrs_to.AddLast(init); };
324                 return ret_hu_conv;
325         }
326
327         /**
328          * Handles the reply of a query we initiated to learn about channels
329          * for a given range of blocks. We can expect to receive one or more
330          * replies to a single query.
331          */
332         public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, org.ldk.structs.ReplyChannelRange msg) {
333                 long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
334                 GC.KeepAlive(this);
335                 GC.KeepAlive(their_node_id);
336                 GC.KeepAlive(msg);
337                 if (ret >= 0 && ret <= 4096) { return null; }
338                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
339                 if (this != null) { this.ptrs_to.AddLast(msg); };
340                 return ret_hu_conv;
341         }
342
343         /**
344          * Handles the reply of a query we initiated asking for routing gossip
345          * messages for a list of channels. We should receive this message when
346          * a node has completed its best effort to send us the pertaining routing
347          * gossip messages.
348          */
349         public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, org.ldk.structs.ReplyShortChannelIdsEnd msg) {
350                 long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
351                 GC.KeepAlive(this);
352                 GC.KeepAlive(their_node_id);
353                 GC.KeepAlive(msg);
354                 if (ret >= 0 && ret <= 4096) { return null; }
355                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
356                 if (this != null) { this.ptrs_to.AddLast(msg); };
357                 return ret_hu_conv;
358         }
359
360         /**
361          * Handles when a peer asks us to send a list of `short_channel_id`s
362          * for the requested range of blocks.
363          */
364         public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, org.ldk.structs.QueryChannelRange msg) {
365                 long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
366                 GC.KeepAlive(this);
367                 GC.KeepAlive(their_node_id);
368                 GC.KeepAlive(msg);
369                 if (ret >= 0 && ret <= 4096) { return null; }
370                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
371                 if (this != null) { this.ptrs_to.AddLast(msg); };
372                 return ret_hu_conv;
373         }
374
375         /**
376          * Handles when a peer asks us to send routing gossip messages for a
377          * list of `short_channel_id`s.
378          */
379         public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, org.ldk.structs.QueryShortChannelIds msg) {
380                 long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
381                 GC.KeepAlive(this);
382                 GC.KeepAlive(their_node_id);
383                 GC.KeepAlive(msg);
384                 if (ret >= 0 && ret <= 4096) { return null; }
385                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
386                 if (this != null) { this.ptrs_to.AddLast(msg); };
387                 return ret_hu_conv;
388         }
389
390         /**
391          * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
392          * pending some async action. While there is no guarantee of the rate of future messages, the
393          * caller should seek to reduce the rate of new gossip messages handled, especially
394          * [`ChannelAnnouncement`]s.
395          */
396         public bool processing_queue_high() {
397                 bool ret = bindings.RoutingMessageHandler_processing_queue_high(this.ptr);
398                 GC.KeepAlive(this);
399                 return ret;
400         }
401
402         /**
403          * Gets the node feature flags which this handler itself supports. All available handlers are
404          * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
405          * which are broadcasted in our [`NodeAnnouncement`] message.
406          */
407         public NodeFeatures provided_node_features() {
408                 long ret = bindings.RoutingMessageHandler_provided_node_features(this.ptr);
409                 GC.KeepAlive(this);
410                 if (ret >= 0 && ret <= 4096) { return null; }
411                 org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); }
412                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
413                 return ret_hu_conv;
414         }
415
416         /**
417          * Gets the init feature flags which should be sent to the given peer. All available handlers
418          * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
419          * which are sent in our [`Init`] message.
420          * 
421          * Note that this method is called before [`Self::peer_connected`].
422          */
423         public InitFeatures provided_init_features(byte[] their_node_id) {
424                 long ret = bindings.RoutingMessageHandler_provided_init_features(this.ptr, InternalUtils.check_arr_len(their_node_id, 33));
425                 GC.KeepAlive(this);
426                 GC.KeepAlive(their_node_id);
427                 if (ret >= 0 && ret <= 4096) { return null; }
428                 org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
429                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
430                 return ret_hu_conv;
431         }
432
433 }
434 } } }