pub struct ProbabilisticScorerUsingTime<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time>{ /* private fields */ }Expand description
Probabilistic Score implementation.
(C-not exported) generally all users should use the ProbabilisticScorer type alias.
Implementations§
Source§impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ProbabilisticScorerUsingTime<G, L, T>
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ProbabilisticScorerUsingTime<G, L, T>
Sourcepub fn new(
params: ProbabilisticScoringParameters,
network_graph: G,
logger: L,
) -> Self
pub fn new( params: ProbabilisticScoringParameters, network_graph: G, logger: L, ) -> Self
Creates a new scorer using the given scoring parameters for sending payments from a node through a network graph.
Sourcepub fn debug_log_liquidity_stats(&self)
pub fn debug_log_liquidity_stats(&self)
Dump the contents of this scorer into the configured logger.
Note that this writes roughly one line per channel for which we have a liquidity estimate, which may be a substantial amount of log output.
Sourcepub fn estimated_channel_liquidity_range(
&self,
scid: u64,
target: &NodeId,
) -> Option<(u64, u64)>
pub fn estimated_channel_liquidity_range( &self, scid: u64, target: &NodeId, ) -> Option<(u64, u64)>
Query the estimated minimum and maximum liquidity available for sending a payment over the
channel with scid towards the given target node.
Sourcepub fn add_banned(&mut self, node_id: &NodeId)
pub fn add_banned(&mut self, node_id: &NodeId)
Marks the node with the given node_id as banned, i.e.,
it will be avoided during path finding.
Sourcepub fn remove_banned(&mut self, node_id: &NodeId)
pub fn remove_banned(&mut self, node_id: &NodeId)
Removes the node with the given node_id from the list of nodes to avoid.
Sourcepub fn set_manual_penalty(&mut self, node_id: &NodeId, penalty: u64)
pub fn set_manual_penalty(&mut self, node_id: &NodeId, penalty: u64)
Sets a manual penalty for the given node.
Sourcepub fn remove_manual_penalty(&mut self, node_id: &NodeId)
pub fn remove_manual_penalty(&mut self, node_id: &NodeId)
Removes the node with the given node_id from the list of manual penalties.
Sourcepub fn clear_manual_penalties(&mut self)
pub fn clear_manual_penalties(&mut self)
Clears the list of manual penalties that are applied during path finding.
Trait Implementations§
Source§impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ReadableArgs<(ProbabilisticScoringParameters, G, L)> for ProbabilisticScorerUsingTime<G, L, T>
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ReadableArgs<(ProbabilisticScoringParameters, G, L)> for ProbabilisticScorerUsingTime<G, L, T>
Source§fn read<R: Read>(
r: &mut R,
args: (ProbabilisticScoringParameters, G, L),
) -> Result<Self, DecodeError>
fn read<R: Read>( r: &mut R, args: (ProbabilisticScoringParameters, G, L), ) -> Result<Self, DecodeError>
Source§impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Score for ProbabilisticScorerUsingTime<G, L, T>
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Score for ProbabilisticScorerUsingTime<G, L, T>
Source§fn channel_penalty_msat(
&self,
short_channel_id: u64,
source: &NodeId,
target: &NodeId,
usage: ChannelUsage,
) -> u64
fn channel_penalty_msat( &self, short_channel_id: u64, source: &NodeId, target: &NodeId, usage: ChannelUsage, ) -> u64
send_amt_msat through the
given channel in the direction from source to target. Read more