X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelUpdateInfo.java;h=b485f3c006198e3ab447127ab7971b2d2e917b39;hb=5e9de82b3a7712a41189756d9d16d946142b2ac5;hp=15c593fe3bd50ac738ff3b3cedef77e11c205505;hpb=13cdf8bde340072288b39a5e29f0946d3e095ad4;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelUpdateInfo.java b/src/main/java/org/ldk/structs/ChannelUpdateInfo.java index 15c593fe..b485f3c0 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdateInfo.java +++ b/src/main/java/org/ldk/structs/ChannelUpdateInfo.java @@ -120,7 +120,7 @@ public class ChannelUpdateInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } - ret_hu_conv.ptrs_to.add(this); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -131,7 +131,7 @@ public class ChannelUpdateInfo extends CommonBase { bindings.ChannelUpdateInfo_set_fees(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - this.ptrs_to.add(val); + if (this != null) { this.ptrs_to.add(val); }; } /** @@ -148,7 +148,7 @@ public class ChannelUpdateInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdate(null, ret); } - ret_hu_conv.ptrs_to.add(this); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -164,7 +164,7 @@ public class ChannelUpdateInfo extends CommonBase { bindings.ChannelUpdateInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - this.ptrs_to.add(val); + if (this != null) { this.ptrs_to.add(val); }; } /** @@ -181,9 +181,9 @@ public class ChannelUpdateInfo extends CommonBase { Reference.reachabilityFence(last_update_message_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(fees_arg); - ret_hu_conv.ptrs_to.add(last_update_message_arg); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fees_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(last_update_message_arg); }; return ret_hu_conv; } @@ -201,10 +201,27 @@ public class ChannelUpdateInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } - ret_hu_conv.ptrs_to.add(this); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } + /** + * Checks if two ChannelUpdateInfos 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(ChannelUpdateInfo b) { + boolean ret = bindings.ChannelUpdateInfo_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 ChannelUpdateInfo)) return false; + return this.eq((ChannelUpdateInfo)o); + } /** * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read */