X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FP2PGossipSync.java;h=0e068a4148b79f551fa19d36ea37c3791e110852;hb=5e9de82b3a7712a41189756d9d16d946142b2ac5;hp=93f1c69d2568b963f05540558c2610fb4cbe1ea4;hpb=47341beaeecf907f422f126500baf586d54a0d41;p=ldk-java diff --git a/src/main/java/org/ldk/structs/P2PGossipSync.java b/src/main/java/org/ldk/structs/P2PGossipSync.java index 93f1c69d..0e068a41 100644 --- a/src/main/java/org/ldk/structs/P2PGossipSync.java +++ b/src/main/java/org/ldk/structs/P2PGossipSync.java @@ -35,16 +35,16 @@ public class P2PGossipSync extends CommonBase { * channel owners' keys. */ public static P2PGossipSync of(NetworkGraph network_graph, Option_AccessZ chain_access, Logger logger) { - long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr & ~1, chain_access.ptr, logger == null ? 0 : logger.ptr); + long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, chain_access.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(network_graph); Reference.reachabilityFence(chain_access); Reference.reachabilityFence(logger); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.P2PGossipSync ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.P2PGossipSync(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(network_graph); - ret_hu_conv.ptrs_to.add(chain_access); - ret_hu_conv.ptrs_to.add(logger); + 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(network_graph); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(chain_access); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; return ret_hu_conv; } @@ -57,7 +57,7 @@ public class P2PGossipSync extends CommonBase { bindings.P2PGossipSync_add_chain_access(this.ptr, chain_access.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(chain_access); - this.ptrs_to.add(chain_access); + if (this != null) { this.ptrs_to.add(chain_access); }; } /** @@ -69,7 +69,7 @@ public class P2PGossipSync extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(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; } @@ -82,7 +82,7 @@ public class P2PGossipSync extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(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; }