Skip to content

Commit 05cf1af

Browse files
committed
CounterpartyForwardingInfo to PaymentRelay mapping
1 parent 2c40555 commit 05cf1af

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lightning/src/blinded_path/payment.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::blinded_path::BlindedHop;
88
use crate::blinded_path::utils;
99
use crate::io;
1010
use crate::ln::PaymentSecret;
11+
use crate::ln::channelmanager::CounterpartyForwardingInfo;
1112
use crate::ln::features::BlindedHopFeatures;
1213
use crate::ln::msgs::DecodeError;
1314
use crate::offers::invoice::BlindedPayInfo;
@@ -96,6 +97,15 @@ pub struct PaymentConstraints {
9697
pub htlc_minimum_msat: u64,
9798
}
9899

100+
impl From<CounterpartyForwardingInfo> for PaymentRelay {
101+
fn from(info: CounterpartyForwardingInfo) -> Self {
102+
let CounterpartyForwardingInfo {
103+
fee_base_msat, fee_proportional_millionths, cltv_expiry_delta
104+
} = info;
105+
Self { cltv_expiry_delta, fee_proportional_millionths, fee_base_msat }
106+
}
107+
}
108+
99109
impl Writeable for ForwardTlvs {
100110
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
101111
encode_tlv_stream!(w, {

0 commit comments

Comments
 (0)