Export `outbound_payments` directly rather than via re-exports
What changed, and why it matters
This commit is a straightforward code cleanup in a Rust Lightning library. It stops hiding an internal module behind re-exports and exposes it directly in the public API. The change fixes an earlier accidental break in the public API where a type (CustomTlvs) was used in a public struct but not re-exported, making it hard for downstream developers to use. There is no runtime security issue, no bug fix in payment logic, and no exploit.
No security action required. Treat as a normal API refactor. Downstream users may need to update import paths if they were relying on the re-exports from `channelmanager`.
Security signals we found
No memory-safety, cryptographic, or payment-state changes
No new input parsing or network message handling
No change to consensus, channel, or HTLC logic
Commit message describes public API ergonomics, not a vulnerability
Diff is purely import/path reorganization plus module visibility
Evidence from the diff
The patch changes lightning/src/ln/mod.rs to make outbound_payment a public module (pub mod outbound_payment) instead of a private module re-exporting selected types through channelmanager. It then updates all internal imports to pull RecipientOnionFields, Retry, Bolt11PaymentError, Bolt12PaymentError, ProbeSendFailure, RetryableSendFailure, etc. from crate::ln::outbound_payment rather than crate::ln::channelmanager. Doc links are updated accordingly. The commit message explicitly frames this as an API-ergonomics / accidental-seal prevention change, not a security fix.
Changed components
lightning/src/ln/mod.rslightning/src/ln/channelmanager.rslightning/src/ln/outbound_payment.rslightning/src/events/mod.rslightning/src/routing/router.rsVarious test and fuzz filesInspect captured patch +68 / −55
diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs
index f87af5c..5fb0743 100644
--- a/fuzz/src/chanmon_consistency.rs
+++ b/fuzz/src/chanmon_consistency.rs
@@ -49,7 +49,6 @@ use lightning::ln::channel::{
use lightning::ln::channel_state::ChannelDetails;
use lightning::ln::channelmanager::{
ChainParameters, ChannelManager, ChannelManagerReadArgs, PaymentId, RecentPaymentDetails,
- RecipientOnionFields,
};
use lightning::ln::functional_test_utils::*;
use lightning::ln::funding::{FundingTxInput, SpliceContribution};
@@ -58,6 +57,7 @@ use lightning::ln::msgs::{
BaseMessageHandler, ChannelMessageHandler, CommitmentUpdate, Init, MessageSendEvent,
UpdateAddHTLC,
};
+use lightning::ln::outbound_payment::RecipientOnionFields;
use lightning::ln::script::ShutdownScript;
use lightning::ln::types::ChannelId;
use lightning::offers::invoice::UnsignedBolt12Invoice;
diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs
index e73db74..600335b 100644
--- a/fuzz/src/full_stack.rs
+++ b/fuzz/src/full_stack.rs
@@ -43,13 +43,14 @@ use lightning::events::bump_transaction::sync::WalletSourceSync;
use lightning::events::Event;
use lightning::ln::channel_state::ChannelDetails;
use lightning::ln::channelmanager::{
- ChainParameters, ChannelManager, InterceptId, PaymentId, RecipientOnionFields, Retry,
+ ChainParameters, ChannelManager, InterceptId, PaymentId,
};
use lightning::ln::functional_test_utils::*;
use lightning::ln::inbound_payment::ExpandedKey;
use lightning::ln::peer_handler::{
IgnoringMessageHandler, MessageHandler, PeerManager, SocketDescriptor,
};
+use lightning::ln::outbound_payment::{RecipientOnionFields, Retry};
use lightning::ln::script::ShutdownScript;
use lightning::ln::types::ChannelId;
use lightning::offers::invoice::UnsignedBolt12Invoice;
diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs
index 80d0ef1..c7dd579 100644
--- a/lightning/src/chain/channelmonitor.rs
+++ b/lightning/src/chain/channelmonitor.rs
@@ -6774,8 +6774,9 @@ mod tests {
DelayedPaymentBasepoint, DelayedPaymentKey, HtlcBasepoint, RevocationBasepoint,
RevocationKey,
};
- use crate::ln::channelmanager::{HTLCSource, PaymentId, RecipientOnionFields};
+ use crate::ln::channelmanager::{HTLCSource, PaymentId};
use crate::ln::functional_test_utils::*;
+ use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::script::ShutdownScript;
use crate::ln::types::ChannelId;
use crate::sign::{ChannelSigner, InMemorySigner};
diff --git a/lightning/src/events/mod.rs b/lightning/src/events/mod.rs
index b029caa..3d860e9 100644
--- a/lightning/src/events/mod.rs
+++ b/lightning/src/events/mod.rs
@@ -24,9 +24,10 @@ use crate::blinded_path::payment::{
};
use crate::chain::transaction;
use crate::ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
-use crate::ln::channelmanager::{InterceptId, PaymentId, RecipientOnionFields};
+use crate::ln::channelmanager::{InterceptId, PaymentId};
use crate::ln::msgs;
use crate::ln::onion_utils::LocalHTLCFailureReason;
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::types::ChannelId;
use crate::offers::invoice::Bolt12Invoice;
use crate::offers::invoice_request::InvoiceRequest;
@@ -662,7 +663,7 @@ pub enum PaymentFailureReason {
#[cfg_attr(feature = "std", doc = "")]
#[cfg_attr(
feature = "std",
- doc = "[`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout"
+ doc = "[`Retry::Timeout`]: crate::ln::outbound_payment::Retry::Timeout"
)]
RetriesExhausted,
/// Either the BOLT 12 invoice was expired by the time we received it or the payment expired while
@@ -1082,7 +1083,7 @@ pub enum Event {
/// This event will eventually be replayed after failures-to-handle (i.e., the event handler
/// returning `Err(ReplayEvent ())`) and will be persisted across restarts.
///
- /// [`Retry`]: crate::ln::channelmanager::Retry
+ /// [`Retry`]: crate::ln::outbound_payment::Retry
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
PaymentFailed {
/// The `payment_id` passed to [`ChannelManager::send_payment`].
diff --git a/lightning/src/ln/accountable_tests.rs b/lightning/src/ln/accountable_tests.rs
index 442186b..16ca142 100644
--- a/lightning/src/ln/accountable_tests.rs
+++ b/lightning/src/ln/accountable_tests.rs
@@ -9,11 +9,10 @@
//! Tests for verifying the correct relay of accountable signals between nodes.
-use crate::ln::channelmanager::{
- HTLCForwardInfo, PaymentId, PendingAddHTLCInfo, PendingHTLCInfo, RecipientOnionFields, Retry,
-};
+use crate::ln::channelmanager::{HTLCForwardInfo, PaymentId, PendingAddHTLCInfo, PendingHTLCInfo};
use crate::ln::functional_test_utils::*;
use crate::ln::msgs::ChannelMessageHandler;
+use crate::ln::outbound_payment::{RecipientOnionFields, Retry};
use crate::routing::router::{PaymentParameters, RouteParameters};
fn test_accountable_forwarding_with_override(
diff --git a/lightning/src/ln/async_payments_tests.rs b/lightning/src/ln/async_payments_tests.rs
index b8d2321..528cec4 100644
--- a/lightning/src/ln/async_payments_tests.rs
+++ b/lightning/src/ln/async_payments_tests.rs
@@ -18,10 +18,7 @@ use crate::events::{
PaymentFailureReason, PaymentPurpose,
};
use crate::ln::blinded_payment_tests::{fail_blinded_htlc_backwards, get_blinded_route_parameters};
-use crate::ln::channelmanager::{
- Bolt12PaymentError, OptionalOfferPaymentParams, PaymentId, RecipientOnionFields,
- MIN_CLTV_EXPIRY_DELTA,
-};
+use crate::ln::channelmanager::{OptionalOfferPaymentParams, PaymentId, MIN_CLTV_EXPIRY_DELTA};
use crate::ln::functional_test_utils::*;
use crate::ln::inbound_payment;
use crate::ln::msgs;
@@ -30,6 +27,7 @@ use crate::ln::msgs::{
};
use crate::ln::offers_tests;
use crate::ln::onion_utils::LocalHTLCFailureReason;
+use crate::ln::outbound_payment::{Bolt12PaymentError, RecipientOnionFields};
use crate::ln::outbound_payment::{
PendingOutboundPayment, Retry, TEST_ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY,
};
diff --git a/lightning/src/ln/async_signer_tests.rs b/lightning/src/ln/async_signer_tests.rs
index f38afc4..53187c1 100644
--- a/lightning/src/ln/async_signer_tests.rs
+++ b/lightning/src/ln/async_signer_tests.rs
@@ -20,8 +20,9 @@ use crate::events::{ClosureReason, Event};
use crate::ln::chan_utils::ClosingTransaction;
use crate::ln::channel::DISCONNECT_PEER_AWAITING_RESPONSE_TICKS;
use crate::ln::channel_state::{ChannelDetails, ChannelShutdownState};
-use crate::ln::channelmanager::{PaymentId, RAACommitmentOrder, RecipientOnionFields};
+use crate::ln::channelmanager::{PaymentId, RAACommitmentOrder};
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, ErrorAction, MessageSendEvent};
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::{functional_test_utils::*, msgs};
use crate::sign::ecdsa::EcdsaChannelSigner;
use crate::sign::SignerProvider;
diff --git a/lightning/src/ln/blinded_payment_tests.rs b/lightning/src/ln/blinded_payment_tests.rs
index 80da764..d78b9df 100644
--- a/lightning/src/ln/blinded_payment_tests.rs
+++ b/lightning/src/ln/blinded_payment_tests.rs
@@ -14,7 +14,7 @@ use crate::blinded_path::payment::{
use crate::blinded_path::utils::is_padded;
use crate::blinded_path::{self, BlindedHop};
use crate::events::{Event, HTLCHandlingFailureType, PaymentFailureReason};
-use crate::ln::channelmanager::{self, HTLCFailureMsg, PaymentId, RecipientOnionFields};
+use crate::ln::channelmanager::{self, HTLCFailureMsg, PaymentId};
use crate::ln::functional_test_utils::*;
use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::{
@@ -22,7 +22,9 @@ use crate::ln::msgs::{
};
use crate::ln::onion_payment;
use crate::ln::onion_utils::{self, LocalHTLCFailureReason};
-use crate::ln::outbound_payment::{RecipientCustomTlvs, Retry, IDEMPOTENCY_TIMEOUT_TICKS};
+use crate::ln::outbound_payment::{
+ RecipientCustomTlvs, RecipientOnionFields, Retry, IDEMPOTENCY_TIMEOUT_TICKS,
+};
use crate::ln::types::ChannelId;
use crate::offers::invoice::UnsignedBolt12Invoice;
use crate::prelude::*;
diff --git a/lightning/src/ln/chanmon_update_fail_tests.rs b/lightning/src/ln/chanmon_update_fail_tests.rs
index ff499d0..3fa2073 100644
--- a/lightning/src/ln/chanmon_update_fail_tests.rs
+++ b/lightning/src/ln/chanmon_update_fail_tests.rs
@@ -19,11 +19,12 @@ use crate::chain::transaction::OutPoint;
use crate::chain::{ChannelMonitorUpdateStatus, Listen, Watch};
use crate::events::{ClosureReason, Event, HTLCHandlingFailureType, PaymentPurpose};
use crate::ln::channel::AnnouncementSigsState;
-use crate::ln::channelmanager::{PaymentId, RAACommitmentOrder, RecipientOnionFields, Retry};
+use crate::ln::channelmanager::{PaymentId, RAACommitmentOrder};
use crate::ln::msgs;
use crate::ln::msgs::{
BaseMessageHandler, ChannelMessageHandler, MessageSendEvent, RoutingMessageHandler,
};
+use crate::ln::outbound_payment::{RecipientOnionFields, Retry};
use crate::ln::types::ChannelId;
use crate::routing::router::{PaymentParameters, RouteParameters};
use crate::sign::NodeSigner;
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index 129a4d5..a2bc5d1 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -84,9 +84,12 @@ use crate::ln::onion_utils::{process_fulfill_attribution_data, AttributionData};
use crate::ln::our_peer_storage::{EncryptedOurPeerStorage, PeerStorageMonitorHolder};
#[cfg(test)]
use crate::ln::outbound_payment;
+#[cfg(any(test, feature = "_externalize_tests"))]
+use crate::ln::outbound_payment::PaymentSendFailure;
use crate::ln::outbound_payment::{
- OutboundPayments, PendingOutboundPayment, RecipientCustomTlvs, RetryableInvoiceRequest,
- SendAlongPathArgs, StaleExpiration,
+ Bolt11PaymentError, Bolt12PaymentError, OutboundPayments, PendingOutboundPayment,
+ ProbeSendFailure, RecipientCustomTlvs, RecipientOnionFields, Retry, RetryableInvoiceRequest,
+ RetryableSendFailure, SendAlongPathArgs, StaleExpiration,
};
use crate::ln::types::ChannelId;
use crate::offers::async_receive_offer_cache::AsyncReceiveOfferCache;
@@ -175,6 +178,7 @@ use crate::prelude::*;
use crate::sync::{Arc, FairRwLock, LockHeldState, LockTestExt, Mutex, RwLock, RwLockReadGuard};
use bitcoin::hex::impl_fmt_traits;
+use crate::ln::script::ShutdownScript;
use core::borrow::Borrow;
use core::cell::RefCell;
use core::convert::Infallible;
@@ -182,14 +186,6 @@ use core::ops::Deref;
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use core::time::Duration;
use core::{cmp, mem};
-// Re-export this for use in the public API.
-#[cfg(any(test, feature = "_externalize_tests"))]
-pub(crate) use crate::ln::outbound_payment::PaymentSendFailure;
-pub use crate::ln::outbound_payment::{
- Bolt11PaymentError, Bolt12PaymentError, ProbeSendFailure, RecipientOnionFields, Retry,
- RetryableSendFailure,
-};
-use crate::ln::script::ShutdownScript;
// We hold various information about HTLC relay in the HTLC objects in Channel itself:
//
@@ -2262,7 +2258,8 @@ impl<
/// # use bitcoin::hashes::Hash;
/// # use lightning::events::{Event, EventsProvider};
/// # use lightning::types::payment::PaymentHash;
-/// # use lightning::ln::channelmanager::{AChannelManager, OptionalBolt11PaymentParams, PaymentId, RecentPaymentDetails, Retry};
+/// # use lightning::ln::channelmanager::{AChannelManager, OptionalBolt11PaymentParams, PaymentId, RecentPaymentDetails};
+/// # use lightning::ln::outbound_payment::Retry;
/// # use lightning_invoice::Bolt11Invoice;
/// #
/// # fn example<T: AChannelManager>(
@@ -2420,7 +2417,8 @@ impl<
/// ```
/// # use core::time::Duration;
/// # use lightning::events::{Event, EventsProvider};
-/// # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
+/// # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails};
+/// # use lightning::ln::outbound_payment::Retry;
/// # use lightning::offers::parse::Bolt12SemanticError;
/// # use lightning::routing::router::RouteParametersConfig;
/// #
diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs
index cea9ea4..e896575 100644
--- a/lightning/src/ln/functional_test_utils.rs
+++ b/lightning/src/ln/functional_test_utils.rs
@@ -27,7 +27,7 @@ use crate::ln::chan_utils::{
};
use crate::ln::channelmanager::{
AChannelManager, ChainParameters, ChannelManager, ChannelManagerReadArgs, PaymentId,
- RAACommitmentOrder, RecipientOnionFields, MIN_CLTV_EXPIRY_DELTA,
+ RAACommitmentOrder, MIN_CLTV_EXPIRY_DELTA,
};
use crate::ln::funding::FundingTxInput;
use crate::ln::msgs;
@@ -35,6 +35,7 @@ use crate::ln::msgs::{
BaseMessageHandler, ChannelMessageHandler, MessageSendEvent, RoutingMessageHandler,
};
use crate::ln::onion_utils::LocalHTLCFailureReason;
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::outbound_payment::Retry;
use crate::ln::peer_handler::IgnoringMessageHandler;
use crate::ln::types::ChannelId;
diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs
index fcb348c..8e854b3 100644
--- a/lightning/src/ln/functional_tests.rs
+++ b/lightning/src/ln/functional_tests.rs
@@ -33,14 +33,15 @@ use crate::ln::channel::{
MIN_CHAN_DUST_LIMIT_SATOSHIS, UNFUNDED_CHANNEL_AGE_LIMIT_TICKS,
};
use crate::ln::channelmanager::{
- PaymentId, RAACommitmentOrder, RecipientOnionFields, BREAKDOWN_TIMEOUT, DISABLE_GOSSIP_TICKS,
- ENABLE_GOSSIP_TICKS, MIN_CLTV_EXPIRY_DELTA,
+ PaymentId, RAACommitmentOrder, BREAKDOWN_TIMEOUT, DISABLE_GOSSIP_TICKS, ENABLE_GOSSIP_TICKS,
+ MIN_CLTV_EXPIRY_DELTA,
};
use crate::ln::msgs;
use crate::ln::msgs::{
BaseMessageHandler, ChannelMessageHandler, ErrorAction, MessageSendEvent, RoutingMessageHandler,
};
use crate::ln::onion_utils::LocalHTLCFailureReason;
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::types::ChannelId;
use crate::ln::{chan_utils, onion_utils};
use crate::routing::gossip::{NetworkGraph, NetworkUpdate};
diff --git a/lightning/src/ln/interception_tests.rs b/lightning/src/ln/interception_tests.rs
index 11b5de1..c83ef17 100644
--- a/lightning/src/ln/interception_tests.rs
+++ b/lightning/src/ln/interception_tests.rs
@@ -12,9 +12,10 @@
//! claim outputs on-chain.
use crate::events::{Event, HTLCHandlingFailureReason, HTLCHandlingFailureType};
-use crate::ln::channelmanager::{PaymentId, RecipientOnionFields};
+use crate::ln::channelmanager::PaymentId;
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler};
use crate::ln::onion_utils::LocalHTLCFailureReason;
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::routing::router::PaymentParameters;
use crate::util::config::HTLCInterceptionFlags;
diff --git a/lightning/src/ln/invoice_utils.rs b/lightning/src/ln/invoice_utils.rs
index 3026df6..7a93a92 100644
--- a/lightning/src/ln/invoice_utils.rs
+++ b/lightning/src/ln/invoice_utils.rs
@@ -589,11 +589,12 @@ mod test {
use crate::chain::channelmonitor::HTLC_FAIL_BACK_BUFFER;
use crate::ln::channelmanager::{
Bolt11InvoiceParameters, OptionalBolt11PaymentParams, PaymentId, PhantomRouteHints,
- RecipientOnionFields, Retry, MIN_FINAL_CLTV_EXPIRY_DELTA,
+ MIN_FINAL_CLTV_EXPIRY_DELTA,
};
use crate::ln::functional_test_utils::*;
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, MessageSendEvent};
use crate::ln::outbound_payment::RecipientCustomTlvs;
+ use crate::ln::outbound_payment::{RecipientOnionFields, Retry};
use crate::routing::router::{PaymentParameters, RouteParameters, RouteParametersConfig};
use crate::sign::PhantomKeysManager;
use crate::types::payment::{PaymentHash, PaymentPreimage};
diff --git a/lightning/src/ln/mod.rs b/lightning/src/ln/mod.rs
index b077c98..d6e0b92 100644
--- a/lightning/src/ln/mod.rs
+++ b/lightning/src/ln/mod.rs
@@ -42,7 +42,7 @@ pub mod channel;
pub(crate) mod channel;
pub mod onion_utils;
-mod outbound_payment;
+pub mod outbound_payment;
pub mod wire;
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
diff --git a/lightning/src/ln/monitor_tests.rs b/lightning/src/ln/monitor_tests.rs
index 04915af..c3266ae 100644
--- a/lightning/src/ln/monitor_tests.rs
+++ b/lightning/src/ln/monitor_tests.rs
@@ -21,7 +21,8 @@ use crate::events::{Event, ClosureReason, HTLCHandlingFailureType};
use crate::ln::channel;
use crate::ln::types::ChannelId;
use crate::ln::chan_utils;
-use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, PaymentId, RecipientOnionFields};
+use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, PaymentId};
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, MessageSendEvent};
use crate::crypto::utils::sign;
use crate::util::ser::Writeable;
diff --git a/lightning/src/ln/offers_tests.rs b/lightning/src/ln/offers_tests.rs
index 1d20d1d..12e631b 100644
--- a/lightning/src/ln/offers_tests.rs
+++ b/lightning/src/ln/offers_tests.rs
@@ -50,7 +50,8 @@ use crate::blinded_path::message::BlindedMessagePath;
use crate::blinded_path::payment::{Bolt12OfferContext, Bolt12RefundContext, DummyTlvs, PaymentContext};
use crate::blinded_path::message::OffersContext;
use crate::events::{ClosureReason, Event, HTLCHandlingFailureType, PaidBolt12Invoice, PaymentFailureReason, PaymentPurpose};
-use crate::ln::channelmanager::{Bolt12PaymentError, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry, self};
+use crate::ln::channelmanager::{PaymentId, RecentPaymentDetails, self};
+use crate::ln::outbound_payment::{Bolt12PaymentError, RecipientOnionFields, Retry};
use crate::types::features::Bolt12InvoiceFeatures;
use crate::ln::functional_test_utils::*;
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, Init, NodeAnnouncement, OnionMessage, OnionMessageHandler, RoutingMessageHandler, SocketAddress, UnsignedGossipMessage, UnsignedNodeAnnouncement};
diff --git a/lightning/src/ln/onion_payment.rs b/lightning/src/ln/onion_payment.rs
index fd328e0..555cc7a 100644
--- a/lightning/src/ln/onion_payment.rs
+++ b/lightning/src/ln/onion_payment.rs
@@ -750,10 +750,11 @@ pub(super) fn check_incoming_htlc_cltv(
#[cfg(test)]
mod tests {
- use crate::ln::channelmanager::{RecipientOnionFields, MIN_CLTV_EXPIRY_DELTA};
+ use crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA;
use crate::ln::functional_test_utils::TEST_FINAL_CLTV;
use crate::ln::msgs;
use crate::ln::onion_utils::create_payment_onion;
+ use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::types::ChannelId;
use crate::routing::router::{Path, RouteHop};
use crate::types::features::{ChannelFeatures, NodeFeatures};
diff --git a/lightning/src/ln/onion_route_tests.rs b/lightning/src/ln/onion_route_tests.rs
index 0355746..27e0cfa 100644
--- a/lightning/src/ln/onion_route_tests.rs
+++ b/lightning/src/ln/onion_route_tests.rs
@@ -16,8 +16,7 @@ use crate::events::{Event, HTLCHandlingFailureType, PathFailure, PaymentFailureR
use crate::ln::channel::EXPIRE_PREV_CONFIG_TICKS;
use crate::ln::channelmanager::{
FailureCode, HTLCForwardInfo, PaymentId, PendingAddHTLCInfo, PendingHTLCInfo,
- PendingHTLCRouting, RecipientOnionFields, CLTV_FAR_FAR_AWAY, DISABLE_GOSSIP_TICKS,
- MIN_CLTV_EXPIRY_DELTA,
+ PendingHTLCRouting, CLTV_FAR_FAR_AWAY, DISABLE_GOSSIP_TICKS, MIN_CLTV_EXPIRY_DELTA,
};
use crate::ln::functional_test_utils::test_default_channel_config;
use crate::ln::msgs;
@@ -28,6 +27,7 @@ use crate::ln::msgs::{
use crate::ln::onion_utils::{
self, build_onion_payloads, construct_onion_keys, LocalHTLCFailureReason,
};
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::wire::Encode;
use crate::routing::gossip::{NetworkUpdate, RoutingFees};
use crate::routing::router::{
diff --git a/lightning/src/ln/onion_utils.rs b/lightning/src/ln/onion_utils.rs
index fcfac7c..d48fcb2 100644
--- a/lightning/src/ln/onion_utils.rs
+++ b/lightning/src/ln/onion_utils.rs
@@ -15,9 +15,10 @@ use crate::crypto::chacha20::ChaCha20;
use crate::crypto::streams::ChaChaReader;
use crate::events::HTLCHandlingFailureReason;
use crate::ln::channel::TOTAL_BITCOIN_SUPPLY_SATOSHIS;
-use crate::ln::channelmanager::{HTLCSource, RecipientOnionFields};
+use crate::ln::channelmanager::HTLCSource;
use crate::ln::msgs::{self, DecodeError, InboundOnionDummyPayload, OnionPacket, UpdateAddHTLC};
use crate::ln::onion_payment::{HopConnector, NextPacketDetails};
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::offers::invoice_request::InvoiceRequest;
use crate::routing::gossip::NetworkUpdate;
use crate::routing::router::{BlindedTail, Path, RouteHop, RouteParameters, TrampolineHop};
diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs
index dd774a0..ea33bb5 100644
--- a/lightning/src/ln/outbound_payment.rs
+++ b/lightning/src/ln/outbound_payment.rs
@@ -7,7 +7,7 @@
// You may not use this file except in accordance with one or both of these
// licenses.
-//! Utilities to send payments and manage outbound payment information.
+//! This module contains various types which are used to configure or process outbound payments.
use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::hashes::Hash;
@@ -2805,8 +2805,9 @@ mod tests {
use crate::blinded_path::EmptyNodeIdLookUp;
use crate::events::{Event, PathFailure, PaymentFailureReason};
- use crate::ln::channelmanager::{PaymentId, RecipientOnionFields};
+ use crate::ln::channelmanager::PaymentId;
use crate::ln::inbound_payment::ExpandedKey;
+ use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::outbound_payment::{
Bolt12PaymentError, OutboundPayments, PendingOutboundPayment, RecipientCustomTlvs, Retry,
RetryableSendFailure, StaleExpiration,
diff --git a/lightning/src/ln/payment_tests.rs b/lightning/src/ln/payment_tests.rs
index e41e60a..f73c55f 100644
--- a/lightning/src/ln/payment_tests.rs
+++ b/lightning/src/ln/payment_tests.rs
@@ -26,13 +26,14 @@ use crate::ln::channel::{
};
use crate::ln::channelmanager::{
HTLCForwardInfo, PaymentId, PendingAddHTLCInfo, PendingHTLCRouting, RecentPaymentDetails,
- RecipientOnionFields, BREAKDOWN_TIMEOUT, MIN_CLTV_EXPIRY_DELTA, MPP_TIMEOUT_TICKS,
+ BREAKDOWN_TIMEOUT, MIN_CLTV_EXPIRY_DELTA, MPP_TIMEOUT_TICKS,
};
use crate::ln::msgs;
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, MessageSendEvent};
use crate::ln::onion_utils::{self, LocalHTLCFailureReason};
use crate::ln::outbound_payment::{
- ProbeSendFailure, RecipientCustomTlvs, Retry, RetryableSendFailure, IDEMPOTENCY_TIMEOUT_TICKS,
+ ProbeSendFailure, RecipientCustomTlvs, RecipientOnionFields, Retry, RetryableSendFailure,
+ IDEMPOTENCY_TIMEOUT_TICKS,
};
use crate::ln::types::ChannelId;
use crate::routing::gossip::{EffectiveCapacity, RoutingFees};
diff --git a/lightning/src/ln/priv_short_conf_tests.rs b/lightning/src/ln/priv_short_conf_tests.rs
index 83aaca2..57ee863 100644
--- a/lightning/src/ln/priv_short_conf_tests.rs
+++ b/lightning/src/ln/priv_short_conf_tests.rs
@@ -14,12 +14,13 @@
use crate::chain::ChannelMonitorUpdateStatus;
use crate::events::{ClosureReason, Event, HTLCHandlingFailureType, PaymentFailureReason};
use crate::ln::channel::CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY;
-use crate::ln::channelmanager::{PaymentId, RecipientOnionFields, MIN_CLTV_EXPIRY_DELTA};
+use crate::ln::channelmanager::{PaymentId, MIN_CLTV_EXPIRY_DELTA};
use crate::ln::msgs;
use crate::ln::msgs::{
BaseMessageHandler, ChannelMessageHandler, ErrorAction, MessageSendEvent, RoutingMessageHandler,
};
use crate::ln::onion_utils::LocalHTLCFailureReason;
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::types::ChannelId;
use crate::routing::gossip::RoutingFees;
use crate::routing::router::{PaymentParameters, RouteHint, RouteHintHop};
diff --git a/lightning/src/ln/quiescence_tests.rs b/lightning/src/ln/quiescence_tests.rs
index a2b14a7..d972fb6 100644
--- a/lightning/src/ln/quiescence_tests.rs
+++ b/lightning/src/ln/quiescence_tests.rs
@@ -2,10 +2,10 @@ use crate::chain::ChannelMonitorUpdateStatus;
use crate::events::{Event, HTLCHandlingFailureType};
use crate::ln::channel::DISCONNECT_PEER_AWAITING_RESPONSE_TICKS;
use crate::ln::channelmanager::PaymentId;
-use crate::ln::channelmanager::RecipientOnionFields;
use crate::ln::functional_test_utils::*;
use crate::ln::msgs;
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, ErrorAction, MessageSendEvent};
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::util::errors::APIError;
use crate::util::ser::Writeable;
use crate::util::test_channel_signer::SignerOp;
diff --git a/lightning/src/ln/reload_tests.rs b/lightning/src/ln/reload_tests.rs
index 4fb2753..a8206df 100644
--- a/lightning/src/ln/reload_tests.rs
+++ b/lightning/src/ln/reload_tests.rs
@@ -18,7 +18,8 @@ use crate::routing::router::{PaymentParameters, RouteParameters};
use crate::sign::EntropySource;
use crate::chain::transaction::OutPoint;
use crate::events::{ClosureReason, Event, HTLCHandlingFailureType};
-use crate::ln::channelmanager::{ChannelManager, ChannelManagerReadArgs, PaymentId, RecipientOnionFields, RAACommitmentOrder};
+use crate::ln::channelmanager::{ChannelManager, ChannelManagerReadArgs, PaymentId, RAACommitmentOrder};
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::msgs;
use crate::ln::types::ChannelId;
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, RoutingMessageHandler, ErrorAction, MessageSendEvent};
diff --git a/lightning/src/ln/shutdown_tests.rs b/lightning/src/ln/shutdown_tests.rs
index 192bc63..982dc78 100644
--- a/lightning/src/ln/shutdown_tests.rs
+++ b/lightning/src/ln/shutdown_tests.rs
@@ -14,10 +14,11 @@ use crate::chain::transaction::OutPoint;
use crate::chain::ChannelMonitorUpdateStatus;
use crate::events::{ClosureReason, Event, HTLCHandlingFailureReason, HTLCHandlingFailureType};
use crate::ln::channel_state::{ChannelDetails, ChannelShutdownState};
-use crate::ln::channelmanager::{self, PaymentId, RecipientOnionFields, Retry};
+use crate::ln::channelmanager::{self, PaymentId};
use crate::ln::msgs;
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, ErrorAction, MessageSendEvent};
use crate::ln::onion_utils::LocalHTLCFailureReason;
+use crate::ln::outbound_payment::{RecipientOnionFields, Retry};
use crate::ln::script::ShutdownScript;
use crate::ln::types::ChannelId;
use crate::prelude::*;
diff --git a/lightning/src/ln/splicing_tests.rs b/lightning/src/ln/splicing_tests.rs
index ef524db..cf93c62 100644
--- a/lightning/src/ln/splicing_tests.rs
+++ b/lightning/src/ln/splicing_tests.rs
@@ -17,12 +17,11 @@ use crate::events::bump_transaction::sync::WalletSourceSync;
use crate::events::{ClosureReason, Event, FundingInfo, HTLCHandlingFailureType};
use crate::ln::chan_utils;
use crate::ln::channel::CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY;
-use crate::ln::channelmanager::{
- provided_init_features, PaymentId, RecipientOnionFields, BREAKDOWN_TIMEOUT,
-};
+use crate::ln::channelmanager::{provided_init_features, PaymentId, BREAKDOWN_TIMEOUT};
use crate::ln::functional_test_utils::*;
use crate::ln::funding::{FundingTxInput, SpliceContribution};
use crate::ln::msgs::{self, BaseMessageHandler, ChannelMessageHandler, MessageSendEvent};
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::ln::types::ChannelId;
use crate::routing::router::{PaymentParameters, RouteParameters};
use crate::util::errors::APIError;
diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs
index 42d5694..b27dee1 100644
--- a/lightning/src/routing/router.rs
+++ b/lightning/src/routing/router.rs
@@ -19,9 +19,10 @@ use crate::blinded_path::payment::{
use crate::blinded_path::{BlindedHop, Direction, IntroductionNode};
use crate::crypto::chacha20::ChaCha20;
use crate::ln::channel_state::ChannelDetails;
-use crate::ln::channelmanager::{PaymentId, RecipientOnionFields, MIN_FINAL_CLTV_EXPIRY_DELTA};
+use crate::ln::channelmanager::{PaymentId, MIN_FINAL_CLTV_EXPIRY_DELTA};
use crate::ln::msgs::{DecodeError, MAX_VALUE_MSAT};
use crate::ln::onion_utils;
+use crate::ln::outbound_payment::RecipientOnionFields;
use crate::offers::invoice::Bolt12Invoice;
use crate::offers::static_invoice::StaticInvoice;
use crate::routing::gossip::{
@@ -1036,8 +1037,6 @@ impl PaymentParameters {
/// whether your router will be allowed to find a multi-part route for this payment. If you
/// set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
/// [`RecipientOnionFields::secret_only`].
- ///
- /// [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
#[rustfmt::skip]
pub fn for_keysend(payee_pubkey: PublicKey, final_cltv_expiry_delta: u32, allow_mpp: bool) -> Self {
Self::from_node_id(payee_pubkey, final_cltv_expiry_delta)
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.