Update to support None
[ldk-java] / src / main / java / org / ldk / structs / ChannelMessageHandler.java
index c1de1fb53ba78a61b8cc4b7a64fcdc1b6615233b..a981ecab48e354f70a0b6d11e574fbafe53a7253 100644 (file)
@@ -16,79 +16,79 @@ public class ChannelMessageHandler extends CommonBase {
        }
 
        public void call_handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) {
-               bindings.ChannelMessageHandler_call_handle_open_channel(this.ptr, their_node_id, their_features.ptr & ~1, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_open_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(their_features);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) {
-               bindings.ChannelMessageHandler_call_handle_accept_channel(this.ptr, their_node_id, their_features.ptr & ~1, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_accept_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(their_features);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_funding_created(byte[] their_node_id, FundingCreated msg) {
-               bindings.ChannelMessageHandler_call_handle_funding_created(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_funding_created(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_funding_signed(byte[] their_node_id, FundingSigned msg) {
-               bindings.ChannelMessageHandler_call_handle_funding_signed(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_funding_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_funding_locked(byte[] their_node_id, FundingLocked msg) {
-               bindings.ChannelMessageHandler_call_handle_funding_locked(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_funding_locked(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_shutdown(byte[] their_node_id, Shutdown msg) {
-               bindings.ChannelMessageHandler_call_handle_shutdown(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_shutdown(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_closing_signed(byte[] their_node_id, ClosingSigned msg) {
-               bindings.ChannelMessageHandler_call_handle_closing_signed(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_closing_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) {
-               bindings.ChannelMessageHandler_call_handle_update_add_htlc(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_update_add_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) {
-               bindings.ChannelMessageHandler_call_handle_update_fulfill_htlc(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_update_fulfill_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) {
-               bindings.ChannelMessageHandler_call_handle_update_fail_htlc(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_update_fail_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) {
-               bindings.ChannelMessageHandler_call_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) {
-               bindings.ChannelMessageHandler_call_handle_commitment_signed(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_commitment_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) {
-               bindings.ChannelMessageHandler_call_handle_revoke_and_ack(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_revoke_and_ack(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_update_fee(byte[] their_node_id, UpdateFee msg) {
-               bindings.ChannelMessageHandler_call_handle_update_fee(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_update_fee(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) {
-               bindings.ChannelMessageHandler_call_handle_announcement_signatures(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_announcement_signatures(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
@@ -97,17 +97,17 @@ public class ChannelMessageHandler extends CommonBase {
        }
 
        public void call_peer_connected(byte[] their_node_id, Init msg) {
-               bindings.ChannelMessageHandler_call_peer_connected(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_peer_connected(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) {
-               bindings.ChannelMessageHandler_call_handle_channel_reestablish(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_channel_reestablish(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }
 
        public void call_handle_error(byte[] their_node_id, ErrorMessage msg) {
-               bindings.ChannelMessageHandler_call_handle_error(this.ptr, their_node_id, msg.ptr & ~1);
+               bindings.ChannelMessageHandler_call_handle_error(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
        }