X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FProbabilisticScorer.java;h=1bedb70ddb17e84491fc76f7890764c6abbc2121;hb=8f5edad2f310a130b658e1b530fe2516724c4d99;hp=36bc4f597b5c61bbfb6076cdaba78a8a02db9f8b;hpb=976cee7605402903ce1de9e566a48e4cbe18ee29;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ProbabilisticScorer.java b/src/main/java/org/ldk/structs/ProbabilisticScorer.java index 36bc4f59..1bedb70d 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScorer.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScorer.java @@ -107,10 +107,31 @@ public class ProbabilisticScorer extends CommonBase { } /** - * Clears the list of nodes that are avoided during path finding. + * Sets a manual penalty for the given node. */ - public void clear_banned() { - bindings.ProbabilisticScorer_clear_banned(this.ptr); + public void set_manual_penalty(NodeId node_id, long penalty) { + bindings.ProbabilisticScorer_set_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr & ~1, penalty); + Reference.reachabilityFence(this); + Reference.reachabilityFence(node_id); + Reference.reachabilityFence(penalty); + this.ptrs_to.add(node_id); + } + + /** + * Removes the node with the given `node_id` from the list of manual penalties. + */ + public void remove_manual_penalty(NodeId node_id) { + bindings.ProbabilisticScorer_remove_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr & ~1); + Reference.reachabilityFence(this); + Reference.reachabilityFence(node_id); + this.ptrs_to.add(node_id); + } + + /** + * Clears the list of manual penalties that are applied during path finding. + */ + public void clear_manual_penalties() { + bindings.ProbabilisticScorer_clear_manual_penalties(this.ptr); Reference.reachabilityFence(this); }