[Java] Update auto-generated bindings to 0.0.105.0
[ldk-java] / src / main / java / org / ldk / structs / ChannelMessageHandler.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 java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10 /**
11  * A trait to describe an object which can receive channel messages.
12  * 
13  * Messages MAY be called in parallel when they originate from different their_node_ids, however
14  * they MUST NOT be called in parallel when the two calls have the same their_node_id.
15  */
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class ChannelMessageHandler extends CommonBase {
18         final bindings.LDKChannelMessageHandler bindings_instance;
19         ChannelMessageHandler(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
20         private ChannelMessageHandler(bindings.LDKChannelMessageHandler arg, bindings.LDKMessageSendEventsProvider MessageSendEventsProvider) {
21                 super(bindings.LDKChannelMessageHandler_new(arg, MessageSendEventsProvider));
22                 this.ptrs_to.add(arg);
23                 this.ptrs_to.add(MessageSendEventsProvider);
24                 this.bindings_instance = arg;
25         }
26         @Override @SuppressWarnings("deprecation")
27         protected void finalize() throws Throwable {
28                 if (ptr != 0) { bindings.ChannelMessageHandler_free(ptr); } super.finalize();
29         }
30
31         public static interface ChannelMessageHandlerInterface {
32                 /**
33                  * Handle an incoming open_channel message from the given peer.
34                  */
35                 void handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg);
36                 /**
37                  * Handle an incoming accept_channel message from the given peer.
38                  */
39                 void handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg);
40                 /**
41                  * Handle an incoming funding_created message from the given peer.
42                  */
43                 void handle_funding_created(byte[] their_node_id, FundingCreated msg);
44                 /**
45                  * Handle an incoming funding_signed message from the given peer.
46                  */
47                 void handle_funding_signed(byte[] their_node_id, FundingSigned msg);
48                 /**
49                  * Handle an incoming funding_locked message from the given peer.
50                  */
51                 void handle_funding_locked(byte[] their_node_id, FundingLocked msg);
52                 /**
53                  * Handle an incoming shutdown message from the given peer.
54                  */
55                 void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg);
56                 /**
57                  * Handle an incoming closing_signed message from the given peer.
58                  */
59                 void handle_closing_signed(byte[] their_node_id, ClosingSigned msg);
60                 /**
61                  * Handle an incoming update_add_htlc message from the given peer.
62                  */
63                 void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg);
64                 /**
65                  * Handle an incoming update_fulfill_htlc message from the given peer.
66                  */
67                 void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg);
68                 /**
69                  * Handle an incoming update_fail_htlc message from the given peer.
70                  */
71                 void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg);
72                 /**
73                  * Handle an incoming update_fail_malformed_htlc message from the given peer.
74                  */
75                 void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg);
76                 /**
77                  * Handle an incoming commitment_signed message from the given peer.
78                  */
79                 void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg);
80                 /**
81                  * Handle an incoming revoke_and_ack message from the given peer.
82                  */
83                 void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg);
84                 /**
85                  * Handle an incoming update_fee message from the given peer.
86                  */
87                 void handle_update_fee(byte[] their_node_id, UpdateFee msg);
88                 /**
89                  * Handle an incoming announcement_signatures message from the given peer.
90                  */
91                 void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg);
92                 /**
93                  * Indicates a connection to the peer failed/an existing connection was lost. If no connection
94                  * is believed to be possible in the future (eg they're sending us messages we don't
95                  * understand or indicate they require unknown feature bits), no_connection_possible is set
96                  * and any outstanding channels should be failed.
97                  */
98                 void peer_disconnected(byte[] their_node_id, boolean no_connection_possible);
99                 /**
100                  * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
101                  */
102                 void peer_connected(byte[] their_node_id, Init msg);
103                 /**
104                  * Handle an incoming channel_reestablish message from the given peer.
105                  */
106                 void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg);
107                 /**
108                  * Handle an incoming channel update from the given peer.
109                  */
110                 void handle_channel_update(byte[] their_node_id, ChannelUpdate msg);
111                 /**
112                  * Handle an incoming error message from the given peer.
113                  */
114                 void handle_error(byte[] their_node_id, ErrorMessage msg);
115         }
116         private static class LDKChannelMessageHandlerHolder { ChannelMessageHandler held; }
117         public static ChannelMessageHandler new_impl(ChannelMessageHandlerInterface arg, MessageSendEventsProvider.MessageSendEventsProviderInterface MessageSendEventsProvider_impl) {
118                 final LDKChannelMessageHandlerHolder impl_holder = new LDKChannelMessageHandlerHolder();
119                 impl_holder.held = new ChannelMessageHandler(new bindings.LDKChannelMessageHandler() {
120                         @Override public void handle_open_channel(byte[] their_node_id, long their_features, long msg) {
121                                 InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); }
122                                 their_features_hu_conv.ptrs_to.add(this);
123                                 OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new OpenChannel(null, msg); }
124                                 arg.handle_open_channel(their_node_id, their_features_hu_conv, msg_hu_conv);
125                                 Reference.reachabilityFence(arg);
126                         }
127                         @Override public void handle_accept_channel(byte[] their_node_id, long their_features, long msg) {
128                                 InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); }
129                                 their_features_hu_conv.ptrs_to.add(this);
130                                 AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AcceptChannel(null, msg); }
131                                 arg.handle_accept_channel(their_node_id, their_features_hu_conv, msg_hu_conv);
132                                 Reference.reachabilityFence(arg);
133                         }
134                         @Override public void handle_funding_created(byte[] their_node_id, long msg) {
135                                 FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingCreated(null, msg); }
136                                 arg.handle_funding_created(their_node_id, msg_hu_conv);
137                                 Reference.reachabilityFence(arg);
138                         }
139                         @Override public void handle_funding_signed(byte[] their_node_id, long msg) {
140                                 FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingSigned(null, msg); }
141                                 arg.handle_funding_signed(their_node_id, msg_hu_conv);
142                                 Reference.reachabilityFence(arg);
143                         }
144                         @Override public void handle_funding_locked(byte[] their_node_id, long msg) {
145                                 FundingLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingLocked(null, msg); }
146                                 arg.handle_funding_locked(their_node_id, msg_hu_conv);
147                                 Reference.reachabilityFence(arg);
148                         }
149                         @Override public void handle_shutdown(byte[] their_node_id, long their_features, long msg) {
150                                 InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); }
151                                 Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Shutdown(null, msg); }
152                                 arg.handle_shutdown(their_node_id, their_features_hu_conv, msg_hu_conv);
153                                 Reference.reachabilityFence(arg);
154                         }
155                         @Override public void handle_closing_signed(byte[] their_node_id, long msg) {
156                                 ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ClosingSigned(null, msg); }
157                                 arg.handle_closing_signed(their_node_id, msg_hu_conv);
158                                 Reference.reachabilityFence(arg);
159                         }
160                         @Override public void handle_update_add_htlc(byte[] their_node_id, long msg) {
161                                 UpdateAddHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateAddHTLC(null, msg); }
162                                 arg.handle_update_add_htlc(their_node_id, msg_hu_conv);
163                                 Reference.reachabilityFence(arg);
164                         }
165                         @Override public void handle_update_fulfill_htlc(byte[] their_node_id, long msg) {
166                                 UpdateFulfillHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFulfillHTLC(null, msg); }
167                                 arg.handle_update_fulfill_htlc(their_node_id, msg_hu_conv);
168                                 Reference.reachabilityFence(arg);
169                         }
170                         @Override public void handle_update_fail_htlc(byte[] their_node_id, long msg) {
171                                 UpdateFailHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFailHTLC(null, msg); }
172                                 arg.handle_update_fail_htlc(their_node_id, msg_hu_conv);
173                                 Reference.reachabilityFence(arg);
174                         }
175                         @Override public void handle_update_fail_malformed_htlc(byte[] their_node_id, long msg) {
176                                 UpdateFailMalformedHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFailMalformedHTLC(null, msg); }
177                                 arg.handle_update_fail_malformed_htlc(their_node_id, msg_hu_conv);
178                                 Reference.reachabilityFence(arg);
179                         }
180                         @Override public void handle_commitment_signed(byte[] their_node_id, long msg) {
181                                 CommitmentSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new CommitmentSigned(null, msg); }
182                                 arg.handle_commitment_signed(their_node_id, msg_hu_conv);
183                                 Reference.reachabilityFence(arg);
184                         }
185                         @Override public void handle_revoke_and_ack(byte[] their_node_id, long msg) {
186                                 RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new RevokeAndACK(null, msg); }
187                                 arg.handle_revoke_and_ack(their_node_id, msg_hu_conv);
188                                 Reference.reachabilityFence(arg);
189                         }
190                         @Override public void handle_update_fee(byte[] their_node_id, long msg) {
191                                 UpdateFee msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFee(null, msg); }
192                                 arg.handle_update_fee(their_node_id, msg_hu_conv);
193                                 Reference.reachabilityFence(arg);
194                         }
195                         @Override public void handle_announcement_signatures(byte[] their_node_id, long msg) {
196                                 AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AnnouncementSignatures(null, msg); }
197                                 arg.handle_announcement_signatures(their_node_id, msg_hu_conv);
198                                 Reference.reachabilityFence(arg);
199                         }
200                         @Override public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) {
201                                 arg.peer_disconnected(their_node_id, no_connection_possible);
202                                 Reference.reachabilityFence(arg);
203                         }
204                         @Override public void peer_connected(byte[] their_node_id, long msg) {
205                                 Init msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Init(null, msg); }
206                                 arg.peer_connected(their_node_id, msg_hu_conv);
207                                 Reference.reachabilityFence(arg);
208                         }
209                         @Override public void handle_channel_reestablish(byte[] their_node_id, long msg) {
210                                 ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelReestablish(null, msg); }
211                                 arg.handle_channel_reestablish(their_node_id, msg_hu_conv);
212                                 Reference.reachabilityFence(arg);
213                         }
214                         @Override public void handle_channel_update(byte[] their_node_id, long msg) {
215                                 ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
216                                 arg.handle_channel_update(their_node_id, msg_hu_conv);
217                                 Reference.reachabilityFence(arg);
218                         }
219                         @Override public void handle_error(byte[] their_node_id, long msg) {
220                                 ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); }
221                                 arg.handle_error(their_node_id, msg_hu_conv);
222                                 Reference.reachabilityFence(arg);
223                         }
224                 }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance);
225                 return impl_holder.held;
226         }
227
228         /**
229          * Gets the underlying MessageSendEventsProvider.
230          */
231         public MessageSendEventsProvider get_message_send_events_provider() {
232                 MessageSendEventsProvider res = new MessageSendEventsProvider(null, bindings.LDKChannelMessageHandler_get_MessageSendEventsProvider(this.ptr));
233                 this.ptrs_to.add(res);
234                 return res;
235         }
236
237         /**
238          * Handle an incoming open_channel message from the given peer.
239          */
240         public void handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) {
241                 bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
242                 Reference.reachabilityFence(this);
243                 Reference.reachabilityFence(their_node_id);
244                 Reference.reachabilityFence(their_features);
245                 Reference.reachabilityFence(msg);
246                 this.ptrs_to.add(msg);
247         }
248
249         /**
250          * Handle an incoming accept_channel message from the given peer.
251          */
252         public void handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) {
253                 bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
254                 Reference.reachabilityFence(this);
255                 Reference.reachabilityFence(their_node_id);
256                 Reference.reachabilityFence(their_features);
257                 Reference.reachabilityFence(msg);
258                 this.ptrs_to.add(msg);
259         }
260
261         /**
262          * Handle an incoming funding_created message from the given peer.
263          */
264         public void handle_funding_created(byte[] their_node_id, FundingCreated msg) {
265                 bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
266                 Reference.reachabilityFence(this);
267                 Reference.reachabilityFence(their_node_id);
268                 Reference.reachabilityFence(msg);
269                 this.ptrs_to.add(msg);
270         }
271
272         /**
273          * Handle an incoming funding_signed message from the given peer.
274          */
275         public void handle_funding_signed(byte[] their_node_id, FundingSigned msg) {
276                 bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
277                 Reference.reachabilityFence(this);
278                 Reference.reachabilityFence(their_node_id);
279                 Reference.reachabilityFence(msg);
280                 this.ptrs_to.add(msg);
281         }
282
283         /**
284          * Handle an incoming funding_locked message from the given peer.
285          */
286         public void handle_funding_locked(byte[] their_node_id, FundingLocked msg) {
287                 bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
288                 Reference.reachabilityFence(this);
289                 Reference.reachabilityFence(their_node_id);
290                 Reference.reachabilityFence(msg);
291                 this.ptrs_to.add(msg);
292         }
293
294         /**
295          * Handle an incoming shutdown message from the given peer.
296          */
297         public void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg) {
298                 bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
299                 Reference.reachabilityFence(this);
300                 Reference.reachabilityFence(their_node_id);
301                 Reference.reachabilityFence(their_features);
302                 Reference.reachabilityFence(msg);
303                 this.ptrs_to.add(their_features);
304                 this.ptrs_to.add(msg);
305         }
306
307         /**
308          * Handle an incoming closing_signed message from the given peer.
309          */
310         public void handle_closing_signed(byte[] their_node_id, ClosingSigned msg) {
311                 bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
312                 Reference.reachabilityFence(this);
313                 Reference.reachabilityFence(their_node_id);
314                 Reference.reachabilityFence(msg);
315                 this.ptrs_to.add(msg);
316         }
317
318         /**
319          * Handle an incoming update_add_htlc message from the given peer.
320          */
321         public void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) {
322                 bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
323                 Reference.reachabilityFence(this);
324                 Reference.reachabilityFence(their_node_id);
325                 Reference.reachabilityFence(msg);
326                 this.ptrs_to.add(msg);
327         }
328
329         /**
330          * Handle an incoming update_fulfill_htlc message from the given peer.
331          */
332         public void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) {
333                 bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
334                 Reference.reachabilityFence(this);
335                 Reference.reachabilityFence(their_node_id);
336                 Reference.reachabilityFence(msg);
337                 this.ptrs_to.add(msg);
338         }
339
340         /**
341          * Handle an incoming update_fail_htlc message from the given peer.
342          */
343         public void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) {
344                 bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
345                 Reference.reachabilityFence(this);
346                 Reference.reachabilityFence(their_node_id);
347                 Reference.reachabilityFence(msg);
348                 this.ptrs_to.add(msg);
349         }
350
351         /**
352          * Handle an incoming update_fail_malformed_htlc message from the given peer.
353          */
354         public void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) {
355                 bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
356                 Reference.reachabilityFence(this);
357                 Reference.reachabilityFence(their_node_id);
358                 Reference.reachabilityFence(msg);
359                 this.ptrs_to.add(msg);
360         }
361
362         /**
363          * Handle an incoming commitment_signed message from the given peer.
364          */
365         public void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) {
366                 bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
367                 Reference.reachabilityFence(this);
368                 Reference.reachabilityFence(their_node_id);
369                 Reference.reachabilityFence(msg);
370                 this.ptrs_to.add(msg);
371         }
372
373         /**
374          * Handle an incoming revoke_and_ack message from the given peer.
375          */
376         public void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) {
377                 bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
378                 Reference.reachabilityFence(this);
379                 Reference.reachabilityFence(their_node_id);
380                 Reference.reachabilityFence(msg);
381                 this.ptrs_to.add(msg);
382         }
383
384         /**
385          * Handle an incoming update_fee message from the given peer.
386          */
387         public void handle_update_fee(byte[] their_node_id, UpdateFee msg) {
388                 bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
389                 Reference.reachabilityFence(this);
390                 Reference.reachabilityFence(their_node_id);
391                 Reference.reachabilityFence(msg);
392                 this.ptrs_to.add(msg);
393         }
394
395         /**
396          * Handle an incoming announcement_signatures message from the given peer.
397          */
398         public void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) {
399                 bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
400                 Reference.reachabilityFence(this);
401                 Reference.reachabilityFence(their_node_id);
402                 Reference.reachabilityFence(msg);
403                 this.ptrs_to.add(msg);
404         }
405
406         /**
407          * Indicates a connection to the peer failed/an existing connection was lost. If no connection
408          * is believed to be possible in the future (eg they're sending us messages we don't
409          * understand or indicate they require unknown feature bits), no_connection_possible is set
410          * and any outstanding channels should be failed.
411          */
412         public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) {
413                 bindings.ChannelMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), no_connection_possible);
414                 Reference.reachabilityFence(this);
415                 Reference.reachabilityFence(their_node_id);
416                 Reference.reachabilityFence(no_connection_possible);
417         }
418
419         /**
420          * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
421          */
422         public void peer_connected(byte[] their_node_id, Init msg) {
423                 bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
424                 Reference.reachabilityFence(this);
425                 Reference.reachabilityFence(their_node_id);
426                 Reference.reachabilityFence(msg);
427                 this.ptrs_to.add(msg);
428         }
429
430         /**
431          * Handle an incoming channel_reestablish message from the given peer.
432          */
433         public void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) {
434                 bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
435                 Reference.reachabilityFence(this);
436                 Reference.reachabilityFence(their_node_id);
437                 Reference.reachabilityFence(msg);
438                 this.ptrs_to.add(msg);
439         }
440
441         /**
442          * Handle an incoming channel update from the given peer.
443          */
444         public void handle_channel_update(byte[] their_node_id, ChannelUpdate msg) {
445                 bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
446                 Reference.reachabilityFence(this);
447                 Reference.reachabilityFence(their_node_id);
448                 Reference.reachabilityFence(msg);
449                 this.ptrs_to.add(msg);
450         }
451
452         /**
453          * Handle an incoming error message from the given peer.
454          */
455         public void handle_error(byte[] their_node_id, ErrorMessage msg) {
456                 bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
457                 Reference.reachabilityFence(this);
458                 Reference.reachabilityFence(their_node_id);
459                 Reference.reachabilityFence(msg);
460                 this.ptrs_to.add(msg);
461         }
462
463 }