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

Returns the “default value” for a type. Read more

Reads a Self in from the given Read

Writes self out to the given Writer

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

Writes self out to a Vec

Writes self out to a Vec

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Reads a Self in from the given Read

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.