X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FRapidGossipSync.java;fp=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FRapidGossipSync.java;h=f8964ffafacc1488bcd64a26c7dfd64b991d1c1d;hb=eab9331afd014558a982441138e222999a9955d1;hp=f9b22d3151fe3b9362ba4a71367a2220174bc0a5;hpb=397201c278ded558e45d406967f153770784ff88;p=ldk-java diff --git a/src/main/java/org/ldk/structs/RapidGossipSync.java b/src/main/java/org/ldk/structs/RapidGossipSync.java index f9b22d31..f8964ffa 100644 --- a/src/main/java/org/ldk/structs/RapidGossipSync.java +++ b/src/main/java/org/ldk/structs/RapidGossipSync.java @@ -27,13 +27,15 @@ public class RapidGossipSync extends CommonBase { /** * Instantiate a new [`RapidGossipSync`] instance. */ - public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph) { - long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr); + public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) { + long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(network_graph); + Reference.reachabilityFence(logger); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RapidGossipSync ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RapidGossipSync(null, ret); } 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(logger); }; return ret_hu_conv; } @@ -41,8 +43,6 @@ public class RapidGossipSync extends CommonBase { * Update network graph from binary data. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * - * `network_graph`: network graph to be updated - * * `update_data`: `&[u8]` binary stream that comprises the update data */ public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) { @@ -54,6 +54,24 @@ public class RapidGossipSync extends CommonBase { return ret_hu_conv; } + /** + * Update network graph from binary data. + * Returns the last sync timestamp to be used the next time rapid sync data is queried. + * + * `update_data`: `&[u8]` binary stream that comprises the update data + * `current_time_unix`: `Option` optional current timestamp to verify data age + */ + public Result_u32GraphSyncErrorZ update_network_graph_no_std(byte[] update_data, org.ldk.structs.Option_u64Z current_time_unix) { + long ret = bindings.RapidGossipSync_update_network_graph_no_std(this.ptr, update_data, current_time_unix.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(update_data); + Reference.reachabilityFence(current_time_unix); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(current_time_unix); }; + return ret_hu_conv; + } + /** * Returns whether a rapid gossip sync has completed at least once. */