Skip to content

Commit b3612b8

Browse files
committed
Add constructor to RouteParameters
1 parent 073f078 commit b3612b8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightning/src/routing/router.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,13 @@ pub struct RouteParameters {
435435
pub final_value_msat: u64,
436436
}
437437

438+
impl RouteParameters {
439+
/// Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
440+
pub fn from_payment_params_and_value(payment_params: PaymentParameters, final_value_msat: u64) -> Self {
441+
Self { payment_params, final_value_msat }
442+
}
443+
}
444+
438445
impl Writeable for RouteParameters {
439446
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
440447
write_tlv_fields!(writer, {

0 commit comments

Comments
 (0)