X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FTxAckRbf.cs;h=52362a53b75710d48a4ac49b4dd8af3b4907bb03;hb=152d721883552dd92925833d15687d7d64d01c35;hp=970a533432e150f4291e0a34e2d079c776dfbec6;hpb=8de7213fbf663ff60322896282dad51e8ab2f001;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/TxAckRbf.cs b/c_sharp/src/org/ldk/structs/TxAckRbf.cs index 970a5334..52362a53 100644 --- a/c_sharp/src/org/ldk/structs/TxAckRbf.cs +++ b/c_sharp/src/org/ldk/structs/TxAckRbf.cs @@ -19,21 +19,23 @@ public class TxAckRbf : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxAckRbf_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxAckRbf_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxAckRbf_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -63,13 +65,14 @@ public class TxAckRbf : CommonBase { /** * Constructs a new TxAckRbf given each field */ - public static TxAckRbf of(byte[] channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) { - long ret = bindings.TxAckRbf_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), funding_output_contribution_arg.ptr); + public static TxAckRbf of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) { + long ret = bindings.TxAckRbf_new(channel_id_arg.ptr, funding_output_contribution_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(funding_output_contribution_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); }; return ret_hu_conv; } @@ -92,13 +95,25 @@ public class TxAckRbf : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the TxAckRbf. + */ + public long hash() { + long ret = bindings.TxAckRbf_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } /** * Checks if two TxAckRbfs contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxAckRbf b) { - bool ret = bindings.TxAckRbf_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxAckRbf_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); };