6 namespace org { namespace ldk { namespace structs {
10 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
13 * Multiple `reply_channel_range` messages can be sent in reply
14 * to a single [`QueryChannelRange`] message. The query recipient makes a
15 * best effort to respond based on their local network view which may
16 * not be a perfect view of the network. The `short_channel_id`s in the
17 * reply are encoded. We only support `encoding_type=0` uncompressed
18 * serialization and do not support `encoding_type=1` zlib serialization.
20 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
22 public class ReplyChannelRange : CommonBase {
23 internal ReplyChannelRange(object _dummy, long ptr) : base(ptr) { }
24 ~ReplyChannelRange() {
25 if (ptr != 0) { bindings.ReplyChannelRange_free(ptr); }
29 * The genesis hash of the blockchain being queried
31 public byte[] get_chain_hash() {
32 byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr);
38 * The genesis hash of the blockchain being queried
40 public void set_chain_hash(byte[] val) {
41 bindings.ReplyChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
47 * The height of the first block in the range of the reply
49 public int get_first_blocknum() {
50 int ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr);
56 * The height of the first block in the range of the reply
58 public void set_first_blocknum(int val) {
59 bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val);
65 * The number of blocks included in the range of the reply
67 public int get_number_of_blocks() {
68 int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr);
74 * The number of blocks included in the range of the reply
76 public void set_number_of_blocks(int val) {
77 bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val);
83 * True when this is the final reply for a query
85 public bool get_sync_complete() {
86 bool ret = bindings.ReplyChannelRange_get_sync_complete(this.ptr);
92 * True when this is the final reply for a query
94 public void set_sync_complete(bool val) {
95 bindings.ReplyChannelRange_set_sync_complete(this.ptr, val);
101 * The `short_channel_id`s in the channel range
103 * Returns a copy of the field.
105 public long[] get_short_channel_ids() {
106 long[] ret = bindings.ReplyChannelRange_get_short_channel_ids(this.ptr);
112 * The `short_channel_id`s in the channel range
114 public void set_short_channel_ids(long[] val) {
115 bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val);
121 * Constructs a new ReplyChannelRange given each field
123 public static ReplyChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, bool sync_complete_arg, long[] short_channel_ids_arg) {
124 long ret = bindings.ReplyChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg);
125 GC.KeepAlive(chain_hash_arg);
126 GC.KeepAlive(first_blocknum_arg);
127 GC.KeepAlive(number_of_blocks_arg);
128 GC.KeepAlive(sync_complete_arg);
129 GC.KeepAlive(short_channel_ids_arg);
130 if (ret >= 0 && ret <= 4096) { return null; }
131 org.ldk.structs.ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyChannelRange(null, ret); }
132 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
136 internal long clone_ptr() {
137 long ret = bindings.ReplyChannelRange_clone_ptr(this.ptr);
143 * Creates a copy of the ReplyChannelRange
145 public ReplyChannelRange clone() {
146 long ret = bindings.ReplyChannelRange_clone(this.ptr);
148 if (ret >= 0 && ret <= 4096) { return null; }
149 org.ldk.structs.ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyChannelRange(null, ret); }
150 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
155 * Checks if two ReplyChannelRanges contain equal inner contents.
156 * This ignores pointers and is_owned flags and looks at the values in fields.
157 * Two objects with NULL inner values will be considered "equal" here.
159 public bool eq(org.ldk.structs.ReplyChannelRange b) {
160 bool ret = bindings.ReplyChannelRange_eq(this.ptr, b == null ? 0 : b.ptr);
163 if (this != null) { this.ptrs_to.AddLast(b); };
167 public override bool Equals(object o) {
168 if (!(o is ReplyChannelRange)) return false;
169 return this.eq((ReplyChannelRange)o);
172 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
174 public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) {
175 long ret = bindings.ReplyChannelRange_read(ser);
177 if (ret >= 0 && ret <= 4096) { return null; }
178 Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
183 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
185 public byte[] write() {
186 byte[] ret = bindings.ReplyChannelRange_write(this.ptr);