6 namespace org { namespace ldk { namespace structs {
10 * A channel_reestablish message to be sent or received from a peer
12 public class ChannelReestablish : CommonBase {
13 internal ChannelReestablish(object _dummy, long ptr) : base(ptr) { }
14 ~ChannelReestablish() {
15 if (ptr != 0) { bindings.ChannelReestablish_free(ptr); }
21 public byte[] get_channel_id() {
22 byte[] ret = bindings.ChannelReestablish_get_channel_id(this.ptr);
30 public void set_channel_id(byte[] val) {
31 bindings.ChannelReestablish_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
37 * The next commitment number for the sender
39 public long get_next_local_commitment_number() {
40 long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr);
46 * The next commitment number for the sender
48 public void set_next_local_commitment_number(long val) {
49 bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val);
55 * The next commitment number for the recipient
57 public long get_next_remote_commitment_number() {
58 long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr);
64 * The next commitment number for the recipient
66 public void set_next_remote_commitment_number(long val) {
67 bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val);
72 internal long clone_ptr() {
73 long ret = bindings.ChannelReestablish_clone_ptr(this.ptr);
79 * Creates a copy of the ChannelReestablish
81 public ChannelReestablish clone() {
82 long ret = bindings.ChannelReestablish_clone(this.ptr);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReestablish(null, ret); }
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
91 * Checks if two ChannelReestablishs contain equal inner contents.
92 * This ignores pointers and is_owned flags and looks at the values in fields.
93 * Two objects with NULL inner values will be considered "equal" here.
95 public bool eq(org.ldk.structs.ChannelReestablish b) {
96 bool ret = bindings.ChannelReestablish_eq(this.ptr, b == null ? 0 : b.ptr);
99 if (this != null) { this.ptrs_to.AddLast(b); };
103 public override bool Equals(object o) {
104 if (!(o is ChannelReestablish)) return false;
105 return this.eq((ChannelReestablish)o);
108 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
110 public byte[] write() {
111 byte[] ret = bindings.ChannelReestablish_write(this.ptr);
117 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
119 public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {
120 long ret = bindings.ChannelReestablish_read(ser);
122 if (ret >= 0 && ret <= 4096) { return null; }
123 Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);