6 namespace org { namespace ldk { namespace structs {
10 * The main Rapid Gossip Sync object.
12 * See [crate-level documentation] for usage.
14 * [crate-level documentation]: crate
16 public class RapidGossipSync : CommonBase {
17 internal RapidGossipSync(object _dummy, long ptr) : base(ptr) { }
19 if (ptr != 0) { bindings.RapidGossipSync_free(ptr); }
23 * Instantiate a new [`RapidGossipSync`] instance.
25 public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph) {
26 long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr);
27 GC.KeepAlive(network_graph);
28 if (ret >= 0 && ret <= 4096) { return null; }
29 org.ldk.structs.RapidGossipSync ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RapidGossipSync(null, ret); }
30 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
31 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); };
36 * Update network graph from binary data.
37 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
39 * `network_graph`: network graph to be updated
41 * `update_data`: `&[u8]` binary stream that comprises the update data
43 public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) {
44 long ret = bindings.RapidGossipSync_update_network_graph(this.ptr, update_data);
46 GC.KeepAlive(update_data);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret);
53 * Returns whether a rapid gossip sync has completed at least once.
55 public bool is_initial_sync_complete() {
56 bool ret = bindings.RapidGossipSync_is_initial_sync_complete(this.ptr);