6 namespace org { namespace ldk { namespace structs {
10 * Information used to forward or fail this HTLC that is being forwarded within a blinded path.
12 public class BlindedForward : CommonBase {
13 internal BlindedForward(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.BlindedForward_free(ptr); }
19 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
20 * onion payload if we're the introduction node. Useful for calculating the next hop's
21 * [`msgs::UpdateAddHTLC::blinding_point`].
23 public byte[] get_inbound_blinding_point() {
24 long ret = bindings.BlindedForward_get_inbound_blinding_point(this.ptr);
26 if (ret >= 0 && ret <= 4096) { return null; }
27 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
32 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
33 * onion payload if we're the introduction node. Useful for calculating the next hop's
34 * [`msgs::UpdateAddHTLC::blinding_point`].
36 public void set_inbound_blinding_point(byte[] val) {
37 bindings.BlindedForward_set_inbound_blinding_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
43 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
44 * the introduction node.
46 public BlindedFailure get_failure() {
47 BlindedFailure ret = bindings.BlindedForward_get_failure(this.ptr);
53 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
54 * the introduction node.
56 public void set_failure(BlindedFailure val) {
57 bindings.BlindedForward_set_failure(this.ptr, val);
63 * Constructs a new BlindedForward given each field
65 public static BlindedForward of(byte[] inbound_blinding_point_arg, BlindedFailure failure_arg) {
66 long ret = bindings.BlindedForward_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(inbound_blinding_point_arg, 33)), failure_arg);
67 GC.KeepAlive(inbound_blinding_point_arg);
68 GC.KeepAlive(failure_arg);
69 if (ret >= 0 && ret <= 4096) { return null; }
70 org.ldk.structs.BlindedForward ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedForward(null, ret); }
71 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
75 internal long clone_ptr() {
76 long ret = bindings.BlindedForward_clone_ptr(this.ptr);
82 * Creates a copy of the BlindedForward
84 public BlindedForward clone() {
85 long ret = bindings.BlindedForward_clone(this.ptr);
87 if (ret >= 0 && ret <= 4096) { return null; }
88 org.ldk.structs.BlindedForward ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedForward(null, ret); }
89 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
94 * Generates a non-cryptographic 64-bit hash of the BlindedForward.
97 long ret = bindings.BlindedForward_hash(this.ptr);
102 public override int GetHashCode() {
103 return (int)this.hash();
106 * Checks if two BlindedForwards contain equal inner contents.
107 * This ignores pointers and is_owned flags and looks at the values in fields.
108 * Two objects with NULL inner values will be considered "equal" here.
110 public bool eq(org.ldk.structs.BlindedForward b) {
111 bool ret = bindings.BlindedForward_eq(this.ptr, b == null ? 0 : b.ptr);
114 if (this != null) { this.ptrs_to.AddLast(b); };
118 public override bool Equals(object o) {
119 if (!(o is BlindedForward)) return false;
120 return this.eq((BlindedForward)o);
123 * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
125 public byte[] write() {
126 long ret = bindings.BlindedForward_write(this.ptr);
128 if (ret >= 0 && ret <= 4096) { return null; }
129 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
134 * Read a BlindedForward from a byte array, created by BlindedForward_write
136 public static Result_BlindedForwardDecodeErrorZ read(byte[] ser) {
137 long ret = bindings.BlindedForward_read(InternalUtils.encodeUint8Array(ser));
139 if (ret >= 0 && ret <= 4096) { return null; }
140 Result_BlindedForwardDecodeErrorZ ret_hu_conv = Result_BlindedForwardDecodeErrorZ.constr_from_ptr(ret);