+ * 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);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(short_channel_id);
+ Reference.reachabilityFence(source);
+ Reference.reachabilityFence(target);
+ Reference.reachabilityFence(usage);
+ Reference.reachabilityFence(score_params);
+ if (this != null) { this.ptrs_to.add(source); };
+ if (this != null) { this.ptrs_to.add(target); };
+ if (this != null) { this.ptrs_to.add(usage); };
+ if (this != null) { this.ptrs_to.add(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);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(path);
+ Reference.reachabilityFence(short_channel_id);
+ if (this != null) { this.ptrs_to.add(path); };
+ }
+
+ /**
+ * Handles updating channel penalties after successfully routing along a path.
+ */
+ public void payment_path_successful(org.ldk.structs.Path path) {
+ bindings.Score_payment_path_successful(this.ptr, path == null ? 0 : path.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(path);
+ if (this != null) { this.ptrs_to.add(path); };
+ }
+
+ /**
+ * Handles updating channel penalties after a probe over the given path failed.
+ */
+ public void probe_failed(org.ldk.structs.Path path, long short_channel_id) {
+ bindings.Score_probe_failed(this.ptr, path == null ? 0 : path.ptr, short_channel_id);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(path);
+ Reference.reachabilityFence(short_channel_id);
+ if (this != null) { this.ptrs_to.add(path); };
+ }
+
+ /**
+ * Handles updating channel penalties after a probe over the given path succeeded.
+ */
+ public void probe_successful(org.ldk.structs.Path path) {
+ bindings.Score_probe_successful(this.ptr, path == null ? 0 : path.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(path);
+ if (this != null) { this.ptrs_to.add(path); };
+ }
+
+ /**
+ * Serialize the object into a byte array