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=46cd9b5b781865f9a420c0a1279db107564c2623;hb=8fa2bcb208a51fa352d04981f1387d8bceced107;hp=9af3bb6456b52e61e2bd8816d8750ef72797a5d7;hpb=7da1092518e5ea1518255a4473c178f52549fd81;p=ldk-java diff --git a/src/main/java/org/ldk/structs/RapidGossipSync.java b/src/main/java/org/ldk/structs/RapidGossipSync.java index 9af3bb64..46cd9b5b 100644 --- a/src/main/java/org/ldk/structs/RapidGossipSync.java +++ b/src/main/java/org/ldk/structs/RapidGossipSync.java @@ -39,6 +39,38 @@ public class RapidGossipSync extends CommonBase { return ret_hu_conv; } + /** + * Sync gossip data from a file. + * Returns the last sync timestamp to be used the next time rapid sync data is queried. + * + * `network_graph`: The network graph to apply the updates to + * + * `sync_path`: Path to the file where the gossip update data is located + */ + public Result_u32GraphSyncErrorZ sync_network_graph_with_file_path(java.lang.String sync_path) { + long ret = bindings.RapidGossipSync_sync_network_graph_with_file_path(this.ptr, sync_path); + Reference.reachabilityFence(this); + Reference.reachabilityFence(sync_path); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + 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 + */ + public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) { + long ret = bindings.RapidGossipSync_update_network_graph(this.ptr, update_data); + Reference.reachabilityFence(this); + Reference.reachabilityFence(update_data); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + 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.