X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelMessageHandler.java;h=c815ecdb316b9c78bfa9b79eb011bbd72d91d26c;hb=2bb592fb946e316dba9f4d1123f8ac72ff4e9bf8;hp=d7b6b2cc900d4460305ebb3e52cfe6287a357f70;hpb=07d5d868dfe064aadb28a7f7ca6002c16be9723d;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index d7b6b2cc..c815ecdb 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -77,6 +77,22 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming `closing_signed` message from the given peer. */ void handle_closing_signed(byte[] their_node_id, ClosingSigned msg); + /** + * Handle an incoming `stfu` message from the given peer. + */ + void handle_stfu(byte[] their_node_id, Stfu msg); + /** + * Handle an incoming `splice` message from the given peer. + */ + void handle_splice(byte[] their_node_id, Splice msg); + /** + * Handle an incoming `splice_ack` message from the given peer. + */ + void handle_splice_ack(byte[] their_node_id, SpliceAck msg); + /** + * Handle an incoming `splice_locked` message from the given peer. + */ + void handle_splice_locked(byte[] their_node_id, SpliceLocked msg); /** * Handle an incoming `tx_add_input message` from the given peer. */ @@ -184,12 +200,12 @@ public class ChannelMessageHandler extends CommonBase { */ InitFeatures provided_init_features(byte[] their_node_id); /** - * Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports. + * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports. * * If it's `None`, then no particular network chain hash compatibility will be enforced when * connecting to peers. */ - Option_CVec_ThirtyTwoBytesZZ get_genesis_hashes(); + Option_CVec_ThirtyTwoBytesZZ get_chain_hashes(); } private static class LDKChannelMessageHandlerHolder { ChannelMessageHandler held; } public static ChannelMessageHandler new_impl(ChannelMessageHandlerInterface arg, MessageSendEventsProvider.MessageSendEventsProviderInterface MessageSendEventsProvider_impl) { @@ -240,6 +256,26 @@ public class ChannelMessageHandler extends CommonBase { arg.handle_closing_signed(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } + @Override public void handle_stfu(byte[] their_node_id, long msg) { + org.ldk.structs.Stfu msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Stfu(null, msg); } + arg.handle_stfu(their_node_id, msg_hu_conv); + Reference.reachabilityFence(arg); + } + @Override public void handle_splice(byte[] their_node_id, long msg) { + org.ldk.structs.Splice msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Splice(null, msg); } + arg.handle_splice(their_node_id, msg_hu_conv); + Reference.reachabilityFence(arg); + } + @Override public void handle_splice_ack(byte[] their_node_id, long msg) { + org.ldk.structs.SpliceAck msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceAck(null, msg); } + arg.handle_splice_ack(their_node_id, msg_hu_conv); + Reference.reachabilityFence(arg); + } + @Override public void handle_splice_locked(byte[] their_node_id, long msg) { + org.ldk.structs.SpliceLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceLocked(null, msg); } + arg.handle_splice_locked(their_node_id, msg_hu_conv); + Reference.reachabilityFence(arg); + } @Override public void handle_tx_add_input(byte[] their_node_id, long msg) { org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); } arg.handle_tx_add_input(their_node_id, msg_hu_conv); @@ -363,8 +399,8 @@ public class ChannelMessageHandler extends CommonBase { long result = ret == null ? 0 : ret.clone_ptr(); return result; } - @Override public long get_genesis_hashes() { - Option_CVec_ThirtyTwoBytesZZ ret = arg.get_genesis_hashes(); + @Override public long get_chain_hashes() { + Option_CVec_ThirtyTwoBytesZZ ret = arg.get_chain_hashes(); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); }; @@ -482,6 +518,50 @@ public class ChannelMessageHandler extends CommonBase { if (this != null) { this.ptrs_to.add(msg); }; } + /** + * Handle an incoming `stfu` message from the given peer. + */ + public void handle_stfu(byte[] their_node_id, org.ldk.structs.Stfu msg) { + bindings.ChannelMessageHandler_handle_stfu(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); + Reference.reachabilityFence(msg); + if (this != null) { this.ptrs_to.add(msg); }; + } + + /** + * Handle an incoming `splice` message from the given peer. + */ + public void handle_splice(byte[] their_node_id, org.ldk.structs.Splice msg) { + bindings.ChannelMessageHandler_handle_splice(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); + Reference.reachabilityFence(msg); + if (this != null) { this.ptrs_to.add(msg); }; + } + + /** + * Handle an incoming `splice_ack` message from the given peer. + */ + public void handle_splice_ack(byte[] their_node_id, org.ldk.structs.SpliceAck msg) { + bindings.ChannelMessageHandler_handle_splice_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); + Reference.reachabilityFence(msg); + if (this != null) { this.ptrs_to.add(msg); }; + } + + /** + * Handle an incoming `splice_locked` message from the given peer. + */ + public void handle_splice_locked(byte[] their_node_id, org.ldk.structs.SpliceLocked msg) { + bindings.ChannelMessageHandler_handle_splice_locked(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); + Reference.reachabilityFence(msg); + if (this != null) { this.ptrs_to.add(msg); }; + } + /** * Handle an incoming `tx_add_input message` from the given peer. */ @@ -762,13 +842,13 @@ public class ChannelMessageHandler extends CommonBase { } /** - * Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports. + * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports. * * If it's `None`, then no particular network chain hash compatibility will be enforced when * connecting to peers. */ - public Option_CVec_ThirtyTwoBytesZZ get_genesis_hashes() { - long ret = bindings.ChannelMessageHandler_get_genesis_hashes(this.ptr); + public Option_CVec_ThirtyTwoBytesZZ get_chain_hashes() { + long ret = bindings.ChannelMessageHandler_get_chain_hashes(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ ret_hu_conv = org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ.constr_from_ptr(ret);