X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FNodeAnnouncement.java;h=6f1799e4fc77af8ab7c5c031da7d165278a4dca3;hb=300b54d26fe5ed89f472ef821ebf67d56c917e49;hp=e93443e8c0418bb730d99bdb48768fc6ad18525d;hpb=f385eff0dd0aa61fbf21ae946c424f4a6a26de04;p=ldk-java diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index e93443e8..6f1799e4 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -92,6 +92,23 @@ public class NodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Checks if two NodeAnnouncements 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 boolean eq(NodeAnnouncement b) { + boolean ret = bindings.NodeAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof NodeAnnouncement)) return false; + return this.eq((NodeAnnouncement)o); + } /** * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read */