X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FNodeAnnouncement.java;h=019017c338722170a7d483b453e019d4b916ccbd;hb=ad15b3a4dbf3fbc7f08ef22d656bae79e8182008;hp=46123a79c933bce227d6e5deb69e80403f1c5b9f;hpb=3d559f3266fde7c6a21248c10d9a7145125b5e69;p=ldk-java diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index 46123a79..019017c3 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -7,29 +7,46 @@ public class NodeAnnouncement extends CommonBase { NodeAnnouncement(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { - bindings.NodeAnnouncement_free(ptr); super.finalize(); + super.finalize(); + bindings.NodeAnnouncement_free(ptr); } public NodeAnnouncement(NodeAnnouncement orig) { - super(bindings.NodeAnnouncement_clone(orig.ptr & ~1)); + super(bindings.NodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } - // Skipped NodeAnnouncement_get_signature - // Skipped NodeAnnouncement_set_signature + public byte[] get_signature(NodeAnnouncement this_ptr) { + byte[] ret = bindings.NodeAnnouncement_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); + this.ptrs_to.add(this_ptr); + return ret; + } + + public void set_signature(NodeAnnouncement this_ptr, byte[] val) { + bindings.NodeAnnouncement_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); + this.ptrs_to.add(this_ptr); + } + public UnsignedNodeAnnouncement get_contents(NodeAnnouncement this_ptr) { - UnsignedNodeAnnouncement ret = new UnsignedNodeAnnouncement(null, bindings.NodeAnnouncement_get_contents(this_ptr.ptr & ~1)); + UnsignedNodeAnnouncement ret = new UnsignedNodeAnnouncement(null, bindings.NodeAnnouncement_get_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_contents(NodeAnnouncement this_ptr, UnsignedNodeAnnouncement val) { - bindings.NodeAnnouncement_set_contents(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.NodeAnnouncement_set_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } - // Skipped NodeAnnouncement_new + public NodeAnnouncement(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) { + super(bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1)); + this.ptrs_to.add(contents_arg); + } + // Skipped NodeAnnouncement_write - // Skipped NodeAnnouncement_read + public NodeAnnouncement(byte[] ser) { + super(bindings.NodeAnnouncement_read(ser)); + } + }