6 namespace org { namespace ldk { namespace structs {
10 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
12 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
14 public class UtxoFuture : CommonBase {
15 internal UtxoFuture(object _dummy, long ptr) : base(ptr) { }
17 if (ptr != 0) { bindings.UtxoFuture_free(ptr); }
20 internal long clone_ptr() {
21 long ret = bindings.UtxoFuture_clone_ptr(this.ptr);
27 * Creates a copy of the UtxoFuture
29 public UtxoFuture clone() {
30 long ret = bindings.UtxoFuture_clone(this.ptr);
32 if (ret >= 0 && ret <= 4096) { return null; }
33 org.ldk.structs.UtxoFuture ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UtxoFuture(null, ret); }
34 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
39 * Builds a new future for later resolution.
41 public static UtxoFuture of() {
42 long ret = bindings.UtxoFuture_new();
43 if (ret >= 0 && ret <= 4096) { return null; }
44 org.ldk.structs.UtxoFuture ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UtxoFuture(null, ret); }
45 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
50 * Resolves this future against the given `graph` and with the given `result`.
52 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
53 * forwarding the validated gossip message onwards to peers.
55 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
56 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
59 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
60 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
62 public void resolve_without_forwarding(org.ldk.structs.NetworkGraph graph, org.ldk.structs.Result_TxOutUtxoLookupErrorZ result) {
63 bindings.UtxoFuture_resolve_without_forwarding(this.ptr, graph == null ? 0 : graph.ptr, result != null ? result.ptr : 0);
67 if (this != null) { this.ptrs_to.AddLast(graph); };
71 * Resolves this future against the given `graph` and with the given `result`.
73 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
74 * have available buffer space.
76 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
77 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
80 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
81 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
83 public void resolve(org.ldk.structs.NetworkGraph graph, org.ldk.structs.P2PGossipSync gossip, org.ldk.structs.Result_TxOutUtxoLookupErrorZ result) {
84 bindings.UtxoFuture_resolve(this.ptr, graph == null ? 0 : graph.ptr, gossip == null ? 0 : gossip.ptr, result != null ? result.ptr : 0);
89 if (this != null) { this.ptrs_to.AddLast(graph); };
90 if (this != null) { this.ptrs_to.AddLast(gossip); };