6 namespace org { namespace ldk { namespace structs {
10 * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
12 * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
15 * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
17 public class ScorerAccountingForInFlightHtlcs : CommonBase {
18 internal ScorerAccountingForInFlightHtlcs(object _dummy, long ptr) : base(ptr) { }
19 ~ScorerAccountingForInFlightHtlcs() {
20 if (ptr != 0) { bindings.ScorerAccountingForInFlightHtlcs_free(ptr); }
24 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
26 public static ScorerAccountingForInFlightHtlcs of(org.ldk.structs.ScoreLookUp scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) {
27 long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs.ptr);
29 GC.KeepAlive(inflight_htlcs);
30 if (ret >= 0 && ret <= 4096) { return null; }
31 org.ldk.structs.ScorerAccountingForInFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ScorerAccountingForInFlightHtlcs(null, ret); }
32 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
33 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); };
34 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inflight_htlcs); };
39 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
40 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42 public ScoreLookUp as_ScoreLookUp() {
43 long ret = bindings.ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(this.ptr);
45 if (ret >= 0 && ret <= 4096) { return null; }
46 ScoreLookUp ret_hu_conv = new ScoreLookUp(null, ret);
47 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };