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