From: Jeffrey Czyz Date: Fri, 8 Dec 2023 18:01:58 +0000 (-0600) Subject: CounterpartyForwardingInfo to PaymentRelay mapping X-Git-Tag: v0.0.119~3^2~5 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=edb589203001d4c07e9bbbbb1816363f75917715;p=rust-lightning CounterpartyForwardingInfo to PaymentRelay mapping --- diff --git a/lightning/src/blinded_path/payment.rs b/lightning/src/blinded_path/payment.rs index 7b604fbdc..f4df1e379 100644 --- a/lightning/src/blinded_path/payment.rs +++ b/lightning/src/blinded_path/payment.rs @@ -8,6 +8,7 @@ use crate::blinded_path::BlindedHop; use crate::blinded_path::utils; use crate::io; use crate::ln::PaymentSecret; +use crate::ln::channelmanager::CounterpartyForwardingInfo; use crate::ln::features::BlindedHopFeatures; use crate::ln::msgs::DecodeError; use crate::offers::invoice::BlindedPayInfo; @@ -96,6 +97,15 @@ pub struct PaymentConstraints { pub htlc_minimum_msat: u64, } +impl From for PaymentRelay { + fn from(info: CounterpartyForwardingInfo) -> Self { + let CounterpartyForwardingInfo { + fee_base_msat, fee_proportional_millionths, cltv_expiry_delta + } = info; + Self { cltv_expiry_delta, fee_proportional_millionths, fee_base_msat } + } +} + impl Writeable for ForwardTlvs { fn write(&self, w: &mut W) -> Result<(), io::Error> { encode_tlv_stream!(w, {