forked from lightningdevkit/ldk-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.rs
64 lines (58 loc) · 2.42 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Objects for different types of payments.
mod bolt11;
mod bolt12;
mod onchain;
mod spontaneous;
pub(crate) mod store;
mod unified_qr;
pub use bolt11::Bolt11Payment;
pub use bolt12::Bolt12Payment;
pub use onchain::OnchainPayment;
pub use spontaneous::SpontaneousPayment;
pub use store::{LSPFeeLimits, PaymentDetails, PaymentDirection, PaymentKind, PaymentStatus};
pub use unified_qr::{QrPaymentResult, UnifiedQrPayment};
/// Represents information used to route a payment.
#[derive(Clone, Debug, PartialEq)]
pub struct SendingParameters {
/// 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.
pub max_total_routing_fee_msat: Option<u64>,
/// The maximum total CLTV delta we accept for the route.
///
/// Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
///
/// [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`]: lightning::routing::router::DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA
pub max_total_cltv_expiry_delta: Option<u32>,
/// The maximum number of paths that may be used by (MPP) payments.
///
/// Defaults to [`DEFAULT_MAX_PATH_COUNT`].
///
/// [`DEFAULT_MAX_PATH_COUNT`]: lightning::routing::router::DEFAULT_MAX_PATH_COUNT
pub max_path_count: Option<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.
///
/// Examples:
///
/// | Value | Max Proportion of Channel Capacity Used |
/// |-------|-----------------------------------------|
/// | 0 | Up to 100% of the channel’s capacity |
/// | 1 | Up to 50% of the channel’s capacity |
/// | 2 | Up to 25% of the channel’s capacity |
/// | 3 | Up to 12.5% of the channel’s capacity |
///
/// Default value: 2
pub max_channel_saturation_power_of_half: Option<u8>,
}