- public static Score new_impl(ScoreInterface arg) {
- LDKScoreHolder impl_holder = new LDKScoreHolder();
- impl_holder.held = new Score(new LDKScoreImpl(arg, impl_holder));
- return impl_holder.held;
- }
- /**
- * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
- * given channel in the direction from `source` to `target`.
- *
- * The channel's capacity (less any other MPP parts that are also being considered for use in
- * the same payment) is given by `capacity_msat`. It may be determined from various sources
- * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
- * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
- * Thus, implementations should be overflow-safe.
- */
- public long channel_penalty_msat(long short_channel_id, org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, org.ldk.structs.ChannelUsage usage, org.ldk.structs.ProbabilisticScoringFeeParameters score_params) {
- long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, usage == null ? 0 : usage.ptr, score_params == null ? 0 : score_params.ptr);
- GC.KeepAlive(this);
- GC.KeepAlive(short_channel_id);
- GC.KeepAlive(source);
- GC.KeepAlive(target);
- GC.KeepAlive(usage);
- GC.KeepAlive(score_params);
- if (this != null) { this.ptrs_to.AddLast(source); };
- if (this != null) { this.ptrs_to.AddLast(target); };
- if (this != null) { this.ptrs_to.AddLast(usage); };
- if (this != null) { this.ptrs_to.AddLast(score_params); };
- return ret;
- }
-
- /**
- * Handles updating channel penalties after failing to route through a channel.
- */
- public void payment_path_failed(org.ldk.structs.Path path, long short_channel_id) {
- bindings.Score_payment_path_failed(this.ptr, path == null ? 0 : path.ptr, short_channel_id);
- GC.KeepAlive(this);
- GC.KeepAlive(path);
- GC.KeepAlive(short_channel_id);
- if (this != null) { this.ptrs_to.AddLast(path); };
- }