+ /**
+ * The `NetworkGraph` deserialized from the byte given to the constructor when deserializing or the `NetworkGraph`
+ * given explicitly to the new-object constructor.
+ */
+ public final NetworkGraph net_graph;
+
+ /**
+ * A mutex holding the `ProbabilisticScorer` which was loaded on startup.
+ */
+ public final MultiThreadedLockableScore scorer;
+ /**
+ * We wrap the scorer in a MultiThreadedLockableScore which ultimately gates access to the scorer, however sometimes
+ * we want to expose underlying details of the scorer itself. Thus, we expose a safe version that takes the lock
+ * then returns a reference to this scorer.
+ */
+ private final ProbabilisticScorer prob_scorer;
+ private final Logger logger;
+ private final EntropySource entropy_source;
+ private final NodeSigner node_signer;
+
+ /**
+ * Exposes the `ProbabilisticScorer` wrapped inside a lock. Don't forget to `close` this lock when you're done with
+ * it so normal scoring operation can continue.
+ */
+ public class ScorerWrapper implements AutoCloseable {
+ private final Score lock;
+ public final ProbabilisticScorer prob_scorer;
+ private ScorerWrapper(Score lock, ProbabilisticScorer prob_scorer) {
+ this.lock = lock; this.prob_scorer = prob_scorer;
+ }
+ @Override public void close() throws Exception {
+ lock.destroy();
+ }
+ }
+ /**
+ * Gets the `ProbabilisticScorer` which backs the public lockable `scorer`. Don't forget to `close` the lock when
+ * you're done with it.
+ */
+ public ScorerWrapper get_locked_scorer() {
+ return new ScorerWrapper(this.scorer.as_LockableScore().lock(), this.prob_scorer);
+ }
+
+ /**
+ * A simple interface to provide routes to LDK.
+ */
+ public interface RouterWrapper {
+ /**
+ * Gets a route for the given payment.
+ *
+ * @param payment_hash is non-null for this-node-originated payments, however in the future trampoline or other
+ * HTLC re-routing may cause it to be null as we find routes for payments which we did not
+ * originate.
+ * @param payment_id is non-null for this-node-originated payments, however in the future trampoline or other
+ * HTLC re-routing may cause it to be null as we find routes for payments which we did not
+ * originate.
+ * @param default_router Provides a router which uses the LDK route-finder and a ProbabilisticScorer using the
+ * provided ProbabilisticScoringParameters. You may use this to fetch a "default" route,
+ * modifying or storing it as you wish before returning the route to LDK.
+ */
+ Result_RouteLightningErrorZ find_route(byte[] payer_node_id, RouteParameters route_params, ChannelDetails[] first_hops,
+ InFlightHtlcs inflight_htlcs, @Nullable byte[] payment_hash, @Nullable byte[] payment_id, DefaultRouter default_router);
+ }
+