Skip to content

Commit 7aef8ee

Browse files
committed
add RouteParametersConfig struct to proto types
1 parent 281b5e8 commit 7aef8ee

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

ldk-server-protos/src/proto/types.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,3 +683,24 @@ message Bolt11InvoiceDescription {
683683
string hash = 2;
684684
}
685685
}
686+
687+
// Configuration options for payment routing and pathfinding.
688+
// See https://docs.rs/lightning/0.2.0/lightning/routing/router/struct.RouteParametersConfig.html for more details on each field.
689+
message RouteParametersConfig {
690+
// The maximum total fees, in millisatoshi, that may accrue during route finding.
691+
// Defaults to 1% of the payment amount + 50 sats
692+
optional uint64 max_total_routing_fee_msat = 1;
693+
694+
// The maximum total CLTV delta we accept for the route.
695+
// Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
696+
uint32 max_total_cltv_expiry_delta = 2;
697+
698+
// The maximum number of paths that may be used by (MPP) payments.
699+
// Defaults to [`DEFAULT_MAX_PATH_COUNT`].
700+
uint32 max_path_count = 3;
701+
702+
// Selects the maximum share of a channel's total capacity which will be
703+
// sent over a channel, as a power of 1/2.
704+
// Default value: 2
705+
uint32 max_channel_saturation_power_of_half = 4;
706+
}

ldk-server-protos/src/types.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,29 @@ pub mod bolt11_invoice_description {
779779
Hash(::prost::alloc::string::String),
780780
}
781781
}
782+
/// Configuration options for payment routing and pathfinding.
783+
/// See <https://docs.rs/lightning/0.2.0/lightning/routing/router/struct.RouteParametersConfig.html> for more details on each field.
784+
#[allow(clippy::derive_partial_eq_without_eq)]
785+
#[derive(Clone, PartialEq, ::prost::Message)]
786+
pub struct RouteParametersConfig {
787+
/// The maximum total fees, in millisatoshi, that may accrue during route finding.
788+
/// Defaults to 1% of the payment amount + 50 sats
789+
#[prost(uint64, optional, tag = "1")]
790+
pub max_total_routing_fee_msat: ::core::option::Option<u64>,
791+
/// The maximum total CLTV delta we accept for the route.
792+
/// Defaults to \[`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`\].
793+
#[prost(uint32, tag = "2")]
794+
pub max_total_cltv_expiry_delta: u32,
795+
/// The maximum number of paths that may be used by (MPP) payments.
796+
/// Defaults to \[`DEFAULT_MAX_PATH_COUNT`\].
797+
#[prost(uint32, tag = "3")]
798+
pub max_path_count: u32,
799+
/// Selects the maximum share of a channel's total capacity which will be
800+
/// sent over a channel, as a power of 1/2.
801+
/// Default value: 2
802+
#[prost(uint32, tag = "4")]
803+
pub max_channel_saturation_power_of_half: u32,
804+
}
782805
/// Represents the direction of a payment.
783806
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
784807
#[repr(i32)]

0 commit comments

Comments
 (0)