pub struct ScoringParameters {
pub base_penalty_msat: u64,
pub failure_penalty_msat: u64,
pub overuse_penalty_start_1024th: u16,
pub overuse_penalty_msat_per_1024th: u64,
pub failure_penalty_half_life: Duration,
}
Expand description
Parameters for configuring Scorer
.
Fields
base_penalty_msat: u64
A fixed penalty in msats to apply to each channel.
Default value: 500 msat
failure_penalty_msat: u64
A penalty in msats to apply to a channel upon failing to relay a payment.
This accumulates for each failure but may be reduced over time based on
failure_penalty_half_life
or when successfully routing through a channel.
Default value: 1,024,000 msat
overuse_penalty_start_1024th: u16
When the amount being sent over a channel is this many 1024ths of the total channel
capacity, we begin applying overuse_penalty_msat_per_1024th
.
Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
overuse_penalty_msat_per_1024th: u64
A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
over the channel exceeds overuse_penalty_start_1024th
by.
Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
failure_penalty_half_life: Duration
The time required to elapse before any accumulated failure_penalty_msat
penalties are
cut in half.
Successfully routing through a channel will immediately cut the penalty in half as well.
Default value: 1 hour
Note
When built with the no-std
feature, time will never elapse. Therefore, this penalty will
never decay.
Trait Implementations
sourceimpl Default for ScoringParameters
impl Default for ScoringParameters
sourceimpl Readable for ScoringParameters
impl Readable for ScoringParameters
sourceimpl Writeable for ScoringParameters
impl Writeable for ScoringParameters
sourcefn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
Writes self out to the given Writer
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 RefUnwindSafe for ScoringParameters
impl Send for ScoringParameters
impl Sync for ScoringParameters
impl Unpin for ScoringParameters
impl UnwindSafe for ScoringParameters
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more