6 namespace org { namespace ldk { namespace structs {
10 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
12 * [`update_fail_malformed_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
14 public class UpdateFailMalformedHTLC : CommonBase {
15 internal UpdateFailMalformedHTLC(object _dummy, long ptr) : base(ptr) { }
16 ~UpdateFailMalformedHTLC() {
17 if (ptr != 0) { bindings.UpdateFailMalformedHTLC_free(ptr); }
23 public ChannelId get_channel_id() {
24 long ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr);
26 if (ret >= 0 && ret <= 4096) { return null; }
27 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
28 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
35 public void set_channel_id(org.ldk.structs.ChannelId val) {
36 bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val.ptr);
44 public long get_htlc_id() {
45 long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr);
53 public void set_htlc_id(long val) {
54 bindings.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val);
62 public short get_failure_code() {
63 short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr);
71 public void set_failure_code(short val) {
72 bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val);
77 internal long clone_ptr() {
78 long ret = bindings.UpdateFailMalformedHTLC_clone_ptr(this.ptr);
84 * Creates a copy of the UpdateFailMalformedHTLC
86 public UpdateFailMalformedHTLC clone() {
87 long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 org.ldk.structs.UpdateFailMalformedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFailMalformedHTLC(null, ret); }
91 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
96 * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
99 long ret = bindings.UpdateFailMalformedHTLC_hash(this.ptr);
104 public override int GetHashCode() {
105 return (int)this.hash();
108 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
109 * This ignores pointers and is_owned flags and looks at the values in fields.
110 * Two objects with NULL inner values will be considered "equal" here.
112 public bool eq(org.ldk.structs.UpdateFailMalformedHTLC b) {
113 bool ret = bindings.UpdateFailMalformedHTLC_eq(this.ptr, b.ptr);
116 if (this != null) { this.ptrs_to.AddLast(b); };
120 public override bool Equals(object o) {
121 if (!(o is UpdateFailMalformedHTLC)) return false;
122 return this.eq((UpdateFailMalformedHTLC)o);
125 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
127 public byte[] write() {
128 long ret = bindings.UpdateFailMalformedHTLC_write(this.ptr);
130 if (ret >= 0 && ret <= 4096) { return null; }
131 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
136 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
138 public static Result_UpdateFailMalformedHTLCDecodeErrorZ read(byte[] ser) {
139 long ret = bindings.UpdateFailMalformedHTLC_read(InternalUtils.encodeUint8Array(ser));
141 if (ret >= 0 && ret <= 4096) { return null; }
142 Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);