RouteParametersConfig

Struct RouteParametersConfig 

Source
pub struct RouteParametersConfig {
    pub max_total_routing_fee_msat: Option<u64>,
    pub max_total_cltv_expiry_delta: u32,
    pub max_path_count: u8,
    pub max_channel_saturation_power_of_half: u8,
}
Expand description

A struct for configuring parameters for routing the payment.

Fields§

§max_total_routing_fee_msat: Option<u64>

The maximum total fees, in millisatoshi, that may accrue during route finding.

This limit also applies to the total fees that may arise while retrying failed payment paths.

Note that values below a few sats may result in some paths being spuriously ignored.

Defaults to 1% of the payment amount + 50 sats

§max_total_cltv_expiry_delta: u32

The maximum total CLTV delta we accept for the route. Defaults to DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA.

§max_path_count: u8

The maximum number of paths that may be used by (MPP) payments. Defaults to DEFAULT_MAX_PATH_COUNT.

§max_channel_saturation_power_of_half: u8

Selects the maximum share of a channel’s total capacity which will be sent over a channel, as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas a lower value prefers to send larger MPP parts, potentially saturating channels and increasing failure probability for those paths.

Note that this restriction will be relaxed during pathfinding after paths which meet this restriction have been found. While paths which meet this criteria will be searched for, it is ultimately up to the scorer to select them over other paths.

A value of 0 will allow payments up to and including a channel’s total announced usable capacity, a value of one will only use up to half its capacity, two 1/4, etc.

Default value: 2

Implementations§

Source§

impl RouteParametersConfig

Source

pub fn with_max_total_routing_fee_msat(self, fee_msat: u64) -> Self

Set the maximum total fees, in millisatoshi, that may accrue during route finding.

This is not exported to bindings users since bindings don’t support move semantics

Source

pub fn with_max_total_cltv_expiry_delta( self, max_total_cltv_expiry_delta: u32, ) -> Self

Includes a limit for the total CLTV expiry delta which is considered during routing

This is not exported to bindings users since bindings don’t support move semantics

Source

pub fn with_max_path_count(self, max_path_count: u8) -> Self

Includes a limit for the maximum number of payment paths that may be used.

This is not exported to bindings users since bindings don’t support move semantics

Source

pub fn with_max_channel_saturation_power_of_half( self, max_channel_saturation_power_of_half: u8, ) -> Self

Includes a limit for the maximum share of a channel’s total capacity that can be sent over, as a power of 1/2. See PaymentParameters::max_channel_saturation_power_of_half.

This is not exported to bindings users since bindings don’t support move semantics

Trait Implementations§

Source§

impl Clone for RouteParametersConfig

Source§

fn clone(&self) -> RouteParametersConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RouteParametersConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RouteParametersConfig

Source§

fn default() -> Self

Initates an new set of route parameter configs with default parameters.

Source§

impl Readable for RouteParametersConfig

Source§

fn read<R: Read>(reader: &mut R) -> Result<Self, DecodeError>

Reads a Self in from the given Read.
Source§

impl Writeable for RouteParametersConfig

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Writes self out to the given Writer.
Source§

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.
Source§

fn encode(&self) -> Vec<u8>

Writes self out to a Vec<u8>.
Source§

impl Copy for RouteParametersConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> LengthReadable for T
where T: Readable,

Source§

fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>

Reads a Self in from the given LengthLimitedRead.
Source§

impl<T> MaybeReadable for T
where T: Readable,

Source§

fn read<R>(reader: &mut R) -> Result<Option<T>, DecodeError>
where R: Read,

Reads a Self in from the given Read.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.