mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-03-15 15:39:09 +01:00
Make FinalOnionHopData
public
In 4b5db8c3ce
, `channelmanager::PendingHTLCRouting` was made
public, exposing a `FinalOnionHopData` field to the world. However,
`FinalOnionHopData` was left crate-private, making the enum
impossible to construct.
There isn't a strong reason for this (even though the
`FinalOnionHopData` API is somewhat confusing, being separated from
the rest of the onion structs), so we expose it here.
This commit is contained in:
parent
83e76d78b7
commit
bb0ddad00d
1 changed files with 16 additions and 8 deletions
|
@ -1668,23 +1668,31 @@ pub trait OnionMessageHandler: EventsProvider {
|
|||
fn provided_init_features(&self, their_node_id: &PublicKey) -> InitFeatures;
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[cfg_attr(test, derive(Debug, PartialEq))]
|
||||
/// Information communicated in the onion to the recipient for multi-part tracking and proof that
|
||||
/// the payment is associated with an invoice.
|
||||
pub struct FinalOnionHopData {
|
||||
/// When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
|
||||
/// Because it is generated by the recipient and included in the invoice, it also provides
|
||||
/// proof to the recipient that the payment was sent by someone with the generated invoice.
|
||||
pub payment_secret: PaymentSecret,
|
||||
/// The intended total amount that this payment is for.
|
||||
///
|
||||
/// Message serialization may panic if this value is more than 21 million Bitcoin.
|
||||
pub total_msat: u64,
|
||||
}
|
||||
|
||||
mod fuzzy_internal_msgs {
|
||||
use bitcoin::secp256k1::PublicKey;
|
||||
use crate::blinded_path::payment::{PaymentConstraints, PaymentRelay};
|
||||
use crate::prelude::*;
|
||||
use crate::ln::{PaymentPreimage, PaymentSecret};
|
||||
use crate::ln::features::BlindedHopFeatures;
|
||||
use super::FinalOnionHopData;
|
||||
|
||||
// These types aren't intended to be pub, but are exposed for direct fuzzing (as we deserialize
|
||||
// them from untrusted input):
|
||||
#[derive(Clone)]
|
||||
#[cfg_attr(test, derive(Debug, PartialEq))]
|
||||
pub struct FinalOnionHopData {
|
||||
pub payment_secret: PaymentSecret,
|
||||
/// The total value, in msat, of the payment as received by the ultimate recipient.
|
||||
/// Message serialization may panic if this value is more than 21 million Bitcoin.
|
||||
pub total_msat: u64,
|
||||
}
|
||||
|
||||
pub enum InboundOnionPayload {
|
||||
Forward {
|
||||
|
|
Loading…
Add table
Reference in a new issue