X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FTransactionU16LenLimited.cs;h=9e0974ca7007a3baa4744165451d828b65c3f39a;hb=152d721883552dd92925833d15687d7d64d01c35;hp=afba6556ff15acdd6be1723e36be5dae1872f043;hpb=afb5ef3730c7175ccdd22a20ea4e071c663cb709;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs b/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs index afba6556..9e0974ca 100644 --- a/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs +++ b/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs @@ -36,13 +36,25 @@ public class TransactionU16LenLimited : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited. + */ + public long hash() { + long ret = bindings.TransactionU16LenLimited_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } /** * Checks if two TransactionU16LenLimiteds 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.TransactionU16LenLimited b) { - bool ret = bindings.TransactionU16LenLimited_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TransactionU16LenLimited_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,6 +89,17 @@ public class TransactionU16LenLimited : CommonBase { return ret_conv; } + /** + * Returns a reference to the contained `Transaction` + */ + public byte[] as_transaction() { + long ret = bindings.TransactionU16LenLimited_as_transaction(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read */