X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FInit.cs;h=407b3436c21d3c3012920fade33e9d2a45debe26;hb=8de7213fbf663ff60322896282dad51e8ab2f001;hp=eece3cbeb36e55faf8614c48b046e65ee3883c66;hpb=afc50e5d491a11364849383b75a8f939df703bac;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/Init.cs b/c_sharp/src/org/ldk/structs/Init.cs index eece3cbe..407b3436 100644 --- a/c_sharp/src/org/ldk/structs/Init.cs +++ b/c_sharp/src/org/ldk/structs/Init.cs @@ -46,11 +46,11 @@ public class Init : CommonBase { * * Returns a copy of the field. */ - public Option_CVec_ChainHashZZ get_networks() { + public Option_CVec_ThirtyTwoBytesZZ get_networks() { long ret = bindings.Init_get_networks(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_CVec_ChainHashZZ ret_hu_conv = org.ldk.structs.Option_CVec_ChainHashZZ.constr_from_ptr(ret); + org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ ret_hu_conv = org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -60,7 +60,7 @@ public class Init : CommonBase { * * If there are no common chains, the connection will be closed. */ - public void set_networks(org.ldk.structs.Option_CVec_ChainHashZZ val) { + public void set_networks(org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ val) { bindings.Init_set_networks(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); @@ -75,11 +75,11 @@ public class Init : CommonBase { * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing * the new address. */ - public Option_NetAddressZ get_remote_network_address() { + public Option_SocketAddressZ get_remote_network_address() { long ret = bindings.Init_get_remote_network_address(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_NetAddressZ ret_hu_conv = org.ldk.structs.Option_NetAddressZ.constr_from_ptr(ret); + org.ldk.structs.Option_SocketAddressZ ret_hu_conv = org.ldk.structs.Option_SocketAddressZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -92,7 +92,7 @@ public class Init : CommonBase { * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing * the new address. */ - public void set_remote_network_address(org.ldk.structs.Option_NetAddressZ val) { + public void set_remote_network_address(org.ldk.structs.Option_SocketAddressZ val) { bindings.Init_set_remote_network_address(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); @@ -102,7 +102,7 @@ public class Init : CommonBase { /** * Constructs a new Init given each field */ - public static Init of(org.ldk.structs.InitFeatures features_arg, org.ldk.structs.Option_CVec_ChainHashZZ networks_arg, org.ldk.structs.Option_NetAddressZ remote_network_address_arg) { + public static Init of(org.ldk.structs.InitFeatures features_arg, org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ networks_arg, org.ldk.structs.Option_SocketAddressZ remote_network_address_arg) { long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr, networks_arg.ptr, remote_network_address_arg.ptr); GC.KeepAlive(features_arg); GC.KeepAlive(networks_arg); @@ -155,16 +155,18 @@ public class Init : CommonBase { * Serialize the Init object into a byte array which can be read by Init_read */ public byte[] write() { - byte[] ret = bindings.Init_write(this.ptr); + long ret = bindings.Init_write(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } /** * Read a Init from a byte array, created by Init_write */ public static Result_InitDecodeErrorZ read(byte[] ser) { - long ret = bindings.Init_read(ser); + long ret = bindings.Init_read(InternalUtils.encodeUint8Array(ser)); GC.KeepAlive(ser); if (ret >= 0 && ret <= 4096) { return null; } Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);