6 namespace org { namespace ldk { namespace structs {
10 * [`Score`] implementation that factors in in-flight HTLC liquidity.
12 * Useful for custom [`Router`] implementations to wrap their [`Score`] on-the-fly when calling
15 * [`Score`]: crate::routing::scoring::Score
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.Score scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) {
27 long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs == null ? 0 : 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 * Serialize the ScorerAccountingForInFlightHtlcs object into a byte array which can be read by ScorerAccountingForInFlightHtlcs_read
41 public byte[] write() {
42 byte[] ret = bindings.ScorerAccountingForInFlightHtlcs_write(this.ptr);
48 * Constructs a new Score which calls the relevant methods on this_arg.
49 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
51 public Score as_Score() {
52 long ret = bindings.ScorerAccountingForInFlightHtlcs_as_Score(this.ptr);
54 if (ret >= 0 && ret <= 4096) { return null; }
55 Score ret_hu_conv = new Score(null, ret);
56 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };