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;
pub htlc_minimum_msat: u64,
}
+impl From<CounterpartyForwardingInfo> 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<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
encode_tlv_stream!(w, {
}
}
-// This will be removed once we support forwarding blinded HTLCs, because we'll always read a
-// `BlindedPaymentTlvs` instead.
-impl Readable for ReceiveTlvs {
- fn read<R: io::Read>(r: &mut R) -> Result<Self, DecodeError> {
- _init_and_read_tlv_stream!(r, {
- (12, payment_constraints, required),
- (65536, payment_secret, required),
- });
- Ok(Self {
- payment_secret: payment_secret.0.unwrap(),
- payment_constraints: payment_constraints.0.unwrap()
- })
- }
-}
-
impl<'a> Writeable for BlindedPaymentTlvsRef<'a> {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
// TODO: write padding