1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
13 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class PeerHandleError extends CommonBase {
18 PeerHandleError(Object _dummy, long ptr) { super(ptr); }
19 @Override @SuppressWarnings("deprecation")
20 protected void finalize() throws Throwable {
22 if (ptr != 0) { bindings.PeerHandleError_free(ptr); }
26 * Used to indicate that we probably can't make any future connections to this peer (e.g.
27 * because we required features that our peer was missing, or vice versa).
29 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
30 * any channels with this peer or check for new versions of LDK.
32 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34 public boolean get_no_connection_possible() {
35 boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr);
36 Reference.reachabilityFence(this);
41 * Used to indicate that we probably can't make any future connections to this peer (e.g.
42 * because we required features that our peer was missing, or vice versa).
44 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
45 * any channels with this peer or check for new versions of LDK.
47 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
49 public void set_no_connection_possible(boolean val) {
50 bindings.PeerHandleError_set_no_connection_possible(this.ptr, val);
51 Reference.reachabilityFence(this);
52 Reference.reachabilityFence(val);
56 * Constructs a new PeerHandleError given each field
58 public static PeerHandleError of(boolean no_connection_possible_arg) {
59 long ret = bindings.PeerHandleError_new(no_connection_possible_arg);
60 Reference.reachabilityFence(no_connection_possible_arg);
61 if (ret >= 0 && ret <= 4096) { return null; }
62 org.ldk.structs.PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerHandleError(null, ret); }
63 ret_hu_conv.ptrs_to.add(ret_hu_conv);
68 long ret = bindings.PeerHandleError_clone_ptr(this.ptr);
69 Reference.reachabilityFence(this);
74 * Creates a copy of the PeerHandleError
76 public PeerHandleError clone() {
77 long ret = bindings.PeerHandleError_clone(this.ptr);
78 Reference.reachabilityFence(this);
79 if (ret >= 0 && ret <= 4096) { return null; }
80 org.ldk.structs.PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerHandleError(null, ret); }
81 ret_hu_conv.ptrs_to.add(this);