pub struct ProbabilisticScorerUsingTime<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> where
L::Target: Logger, { /* private fields */ }
Expand description
Probabilistic Score
implementation.
(C-not exported) generally all users should use the ProbabilisticScorer
type alias.
Implementations
sourceimpl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ProbabilisticScorerUsingTime<G, L, T> where
L::Target: Logger,
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ProbabilisticScorerUsingTime<G, L, T> where
L::Target: Logger,
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
sourceimpl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ReadableArgs<(ProbabilisticScoringParameters, G, L)> for ProbabilisticScorerUsingTime<G, L, T> where
L::Target: Logger,
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ReadableArgs<(ProbabilisticScoringParameters, G, L)> for ProbabilisticScorerUsingTime<G, L, T> where
L::Target: Logger,
sourcefn 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>
Reads a Self in from the given Read
sourceimpl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Score for ProbabilisticScorerUsingTime<G, L, T> where
L::Target: Logger,
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Score for ProbabilisticScorerUsingTime<G, L, T> where
L::Target: Logger,
sourcefn 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
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
. Read more
sourcefn payment_path_failed(&mut self, path: &[&RouteHop], short_channel_id: u64)
fn payment_path_failed(&mut self, path: &[&RouteHop], short_channel_id: u64)
Handles updating channel penalties after failing to route through a channel.
sourcefn payment_path_successful(&mut self, path: &[&RouteHop])
fn payment_path_successful(&mut self, path: &[&RouteHop])
Handles updating channel penalties after successfully routing along a path.
sourcefn probe_failed(&mut self, path: &[&RouteHop], short_channel_id: u64)
fn probe_failed(&mut self, path: &[&RouteHop], short_channel_id: u64)
Handles updating channel penalties after a probe over the given path failed.
sourcefn probe_successful(&mut self, path: &[&RouteHop])
fn probe_successful(&mut self, path: &[&RouteHop])
Handles updating channel penalties after a probe over the given path succeeded.
sourceimpl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Writeable for ProbabilisticScorerUsingTime<G, L, T> where
L::Target: Logger,
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Writeable for ProbabilisticScorerUsingTime<G, L, T> where
L::Target: Logger,
sourcefn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Writes self out to a Vec
sourcefn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length. Read more
Auto Trait Implementations
impl<G, L, T> RefUnwindSafe for ProbabilisticScorerUsingTime<G, L, T> where
G: RefUnwindSafe,
L: RefUnwindSafe,
T: RefUnwindSafe,
impl<G, L, T> Send for ProbabilisticScorerUsingTime<G, L, T> where
G: Send,
L: Send,
T: Send,
impl<G, L, T> Sync for ProbabilisticScorerUsingTime<G, L, T> where
G: Sync,
L: Sync,
T: Sync,
impl<G, L, T> Unpin for ProbabilisticScorerUsingTime<G, L, T> where
G: Unpin,
L: Unpin,
T: Unpin,
impl<G, L, T> UnwindSafe for ProbabilisticScorerUsingTime<G, L, T> where
G: UnwindSafe,
L: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more