File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ use crate::ln::features::BlindedHopFeatures;
1313use crate :: ln:: msgs:: DecodeError ;
1414use crate :: offers:: invoice:: BlindedPayInfo ;
1515use crate :: prelude:: * ;
16+ use crate :: routing:: gossip:: DirectedChannelInfo ;
1617use crate :: util:: ser:: { Readable , Writeable , Writer } ;
1718
1819use core:: convert:: TryFrom ;
@@ -106,6 +107,17 @@ impl From<CounterpartyForwardingInfo> for PaymentRelay {
106107 }
107108}
108109
110+ impl < ' a > From < DirectedChannelInfo < ' a > > for PaymentRelay {
111+ fn from ( info : DirectedChannelInfo < ' a > ) -> Self {
112+ let direction = info. direction ( ) ;
113+ Self {
114+ cltv_expiry_delta : direction. cltv_expiry_delta ,
115+ fee_proportional_millionths : direction. fees . proportional_millionths ,
116+ fee_base_msat : direction. fees . base_msat ,
117+ }
118+ }
119+ }
120+
109121impl Writeable for ForwardTlvs {
110122 fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , io:: Error > {
111123 encode_tlv_stream ! ( w, {
Original file line number Diff line number Diff line change @@ -1026,7 +1026,7 @@ impl<'a> DirectedChannelInfo<'a> {
10261026
10271027 /// Returns information for the direction.
10281028 #[ inline]
1029- pub ( super ) fn direction ( & self ) -> & ' a ChannelUpdateInfo { self . direction }
1029+ pub ( crate ) fn direction ( & self ) -> & ' a ChannelUpdateInfo { self . direction }
10301030
10311031 /// Returns the `node_id` of the source hop.
10321032 ///
You can’t perform that action at this time.
0 commit comments