X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FUnsignedGossipMessage.cs;h=ff59a12d10a2c0da130002c589c9e673c449e7de;hp=1b6990bd07961e0c3b5fe40ecfb29098ef531148;hb=8de7213fbf663ff60322896282dad51e8ab2f001;hpb=afc50e5d491a11364849383b75a8f939df703bac diff --git a/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs b/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs index 1b6990bd..ff59a12d 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs @@ -116,9 +116,11 @@ public class UnsignedGossipMessage : CommonBase { * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read */ public byte[] write() { - byte[] ret = bindings.UnsignedGossipMessage_write(this.ptr); + long ret = bindings.UnsignedGossipMessage_write(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } }