Drop `ChannelManager`-built-in BIP 353 resolution logic
What changed, and why it matters
This commit removes an old, already-deprecated feature from the Lightning Dev Kit's core ChannelManager: the ability to pay a BOLT 12 offer by resolving a human-readable BIP 353 name (like an email-style address) through DNS-over-onion-message inside the library. The project now expects users to use a separate, dedicated `bitcoin-payment-instructions` crate for that name resolution instead. The change is a routine API cleanup, not a security fix, and does not introduce any vulnerability.
No security action required. Developers using the deprecated `pay_for_offer_from_human_readable_name` API should migrate to the `bitcoin-payment-instructions` crate and then call `pay_for_offer_from_hrn` or `pay_for_offer` as appropriate.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes ChannelManager::pay_for_offer_from_human_readable_name, the DNSResolverMessageHandler implementation for ChannelManager, the AwaitingOffer outbound-payment state helpers, the testing_dnssec_proof_offer_resolution_override test hook, and the dnssec-feature-gated SimpleArcOnionMessenger/SimpleRefOnionMessenger type aliases. It also removes the corresponding end-to-end DNS-resolution test in lightning-dns-resolver. Documentation is updated to point callers to the external bitcoin-payment-instructions crate. The AwaitingOffer variant is retained in serialization for backward compatibility but is no longer created.
Changed components
lightning/src/ln/channelmanager.rslightning/src/ln/outbound_payment.rslightning/src/onion_message/messenger.rslightning/src/ln/functional_test_utils.rslightning-dns-resolver/src/lib.rsInspect captured patch +17 / −447
diff --git a/lightning-dns-resolver/src/lib.rs b/lightning-dns-resolver/src/lib.rs
index e957884..c6d583a 100644
--- a/lightning-dns-resolver/src/lib.rs
+++ b/lightning-dns-resolver/src/lib.rs
@@ -147,32 +147,21 @@ mod test {
use super::*;
use bitcoin::secp256k1::{self, PublicKey, Secp256k1};
- use bitcoin::Block;
use lightning::blinded_path::message::{
BlindedMessagePath, MessageContext, MessageForwardNode,
};
use lightning::blinded_path::NodeIdLookUp;
- use lightning::events::{Event, PaymentPurpose};
- use lightning::ln::channelmanager::{OptionalOfferPaymentParams, PaymentId};
- use lightning::ln::functional_test_utils::*;
- use lightning::ln::msgs::{
- BaseMessageHandler, ChannelMessageHandler, Init, OnionMessageHandler,
- };
- use lightning::offers::offer::Offer;
+ use lightning::ln::channelmanager::PaymentId;
+ use lightning::ln::msgs::{BaseMessageHandler, Init, OnionMessageHandler};
use lightning::onion_message::dns_resolution::{HumanReadableName, OMNameResolver};
use lightning::onion_message::messenger::{
AOnionMessenger, Destination, MessageRouter, OnionMessagePath, OnionMessenger,
};
- use lightning::routing::router::DEFAULT_PAYMENT_DUMMY_HOPS;
use lightning::sign::{KeysManager, NodeSigner, ReceiveAuthKey, Recipient};
use lightning::types::features::InitFeatures;
- use lightning::types::payment::PaymentHash;
use lightning::util::logger::Logger;
- use lightning::expect_payment_claimed;
- use lightning_types::string::UntrustedString;
-
use std::sync::Mutex;
use std::time::{Duration, Instant, SystemTime};
@@ -348,153 +337,4 @@ mod test {
assert_eq!(resolution.1, payment_id);
assert!(resolution.2[.."bitcoin:".len()].eq_ignore_ascii_case("bitcoin:"));
}
-
- async fn pay_offer_flow<'a, 'b, 'c>(
- nodes: &[Node<'a, 'b, 'c>], resolver_messenger: &impl AOnionMessenger,
- resolver_id: PublicKey, payer_id: PublicKey, payee_id: PublicKey, offer: Offer,
- name: HumanReadableName, payment_id: PaymentId, payer_note: Option<String>,
- resolvers: Vec<Destination>,
- ) {
- // Override contents to offer provided
- let proof_override = &nodes[0].node.testing_dnssec_proof_offer_resolution_override;
- proof_override.lock().unwrap().insert(name.clone(), offer);
- let amt = 42_000;
- let mut opts = OptionalOfferPaymentParams::default();
- opts.payer_note = payer_note.clone();
- #[allow(deprecated)]
- nodes[0]
- .node
- .pay_for_offer_from_human_readable_name(name, amt, payment_id, opts, resolvers)
- .unwrap();
-
- let query = nodes[0].onion_messenger.next_onion_message_for_peer(resolver_id).unwrap();
- resolver_messenger.get_om().handle_onion_message(payer_id, &query);
-
- assert!(resolver_messenger.get_om().next_onion_message_for_peer(payer_id).is_none());
- let start = Instant::now();
- let response = loop {
- tokio::time::sleep(Duration::from_millis(10)).await;
- if let Some(msg) = resolver_messenger.get_om().next_onion_message_for_peer(payer_id) {
- break msg;
- }
- assert!(start.elapsed() < Duration::from_secs(10), "Resolution took too long");
- };
-
- nodes[0].onion_messenger.handle_onion_message(resolver_id, &response);
-
- let invreq = nodes[0].onion_messenger.next_onion_message_for_peer(payee_id).unwrap();
- nodes[1].onion_messenger.handle_onion_message(payer_id, &invreq);
-
- let inv = nodes[1].onion_messenger.next_onion_message_for_peer(payer_id).unwrap();
- nodes[0].onion_messenger.handle_onion_message(payee_id, &inv);
-
- check_added_monitors(&nodes[0], 1);
- let updates = get_htlc_update_msgs(&nodes[0], &payee_id);
- nodes[1].node.handle_update_add_htlc(payer_id, &updates.update_add_htlcs[0]);
- do_commitment_signed_dance(&nodes[1], &nodes[0], &updates.commitment_signed, false, false);
-
- for _ in 0..DEFAULT_PAYMENT_DUMMY_HOPS {
- assert!(nodes[1].node.needs_pending_htlc_processing());
- nodes[1].node.process_pending_htlc_forwards();
- }
-
- expect_and_process_pending_htlcs(&nodes[1], false);
-
- let claimable_events = nodes[1].node.get_and_clear_pending_events();
- assert_eq!(claimable_events.len(), 1);
- let our_payment_preimage;
- if let Event::PaymentClaimable { purpose, amount_msat, .. } = &claimable_events[0] {
- assert_eq!(*amount_msat, amt);
- if let PaymentPurpose::Bolt12OfferPayment {
- payment_preimage, payment_context, ..
- } = purpose
- {
- our_payment_preimage = payment_preimage.unwrap();
- nodes[1].node.claim_funds(our_payment_preimage);
- let payment_hash: PaymentHash = our_payment_preimage.into();
- expect_payment_claimed!(nodes[1], payment_hash, amt);
- if let Some(note) = payer_note {
- assert_eq!(
- payment_context.invoice_request.payer_note_truncated,
- Some(UntrustedString(note.into()))
- );
- } else {
- assert_eq!(payment_context.invoice_request.payer_note_truncated, None);
- }
- } else {
- panic!();
- }
- } else {
- panic!();
- }
-
- check_added_monitors(&nodes[1], 1);
- let mut updates = get_htlc_update_msgs(&nodes[1], &payer_id);
- nodes[0].node.handle_update_fulfill_htlc(payee_id, updates.update_fulfill_htlcs.remove(0));
- do_commitment_signed_dance(&nodes[0], &nodes[1], &updates.commitment_signed, false, false);
-
- expect_payment_sent(&nodes[0], our_payment_preimage, None, true, true);
- }
-
- #[tokio::test]
- async fn end_to_end_test() {
- let chanmon_cfgs = create_chanmon_cfgs(2);
- let node_cfgs = create_node_cfgs_with_node_id_message_router(2, &chanmon_cfgs);
- let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
- let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
-
- create_announced_chan_between_nodes(&nodes, 0, 1);
-
- // The DNSSEC validation will only work with the current time, so set the time on the
- // resolver.
- let now = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs();
- let block = Block {
- header: create_dummy_header(nodes[0].best_block_hash(), now as u32),
- txdata: Vec::new(),
- };
- connect_block(&nodes[0], &block);
- connect_block(&nodes[1], &block);
-
- let payer_id = nodes[0].node.get_our_node_id();
- let payee_id = nodes[1].node.get_our_node_id();
-
- let (resolver_messenger, resolver_id) = create_resolver();
- let init_msg = get_om_init();
- nodes[0].onion_messenger.peer_connected(resolver_id, &init_msg, true).unwrap();
- resolver_messenger.get_om().peer_connected(payer_id, &init_msg, false).unwrap();
-
- let name = HumanReadableName::from_encoded("matt@mattcorallo.com").unwrap();
-
- let bs_offer = nodes[1].node.create_offer_builder().unwrap().build().unwrap();
- let resolvers = vec![Destination::Node(resolver_id)];
-
- pay_offer_flow(
- &nodes,
- &resolver_messenger,
- resolver_id,
- payer_id,
- payee_id,
- bs_offer.clone(),
- name.clone(),
- PaymentId([42; 32]),
- None,
- resolvers.clone(),
- )
- .await;
-
- // Pay offer with payer_note
- pay_offer_flow(
- &nodes,
- &resolver_messenger,
- resolver_id,
- payer_id,
- payee_id,
- bs_offer,
- name,
- PaymentId([21; 32]),
- Some("foo".into()),
- resolvers,
- )
- .await;
- }
}
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index 2e78270..6608754 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -142,15 +142,6 @@ use crate::util::wakers::{Future, Notifier};
#[cfg(test)]
use crate::blinded_path::payment::BlindedPaymentPath;
-#[cfg(feature = "dnssec")]
-use {
- crate::blinded_path::message::DNSResolverContext,
- crate::onion_message::dns_resolution::{
- DNSResolverMessage, DNSResolverMessageHandler, DNSSECProof, DNSSECQuery,
- },
- crate::onion_message::messenger::Destination,
-};
-
#[cfg(c_bindings)]
use {
crate::offers::offer::OfferWithDerivedMetadataBuilder,
@@ -715,12 +706,7 @@ impl Default for OptionalBolt11PaymentParams {
}
}
-/// Optional arguments to [`ChannelManager::pay_for_offer`]
-#[cfg_attr(
- feature = "dnssec",
- doc = "and [`ChannelManager::pay_for_offer_from_human_readable_name`]"
-)]
-/// .
+/// Optional arguments to [`ChannelManager::pay_for_offer`].
///
/// These fields will often not need to be set, and the provided [`Self::default`] can be used.
pub struct OptionalOfferPaymentParams {
@@ -2942,14 +2928,6 @@ pub struct ChannelManager<
/// [`ConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee`] estimate.
last_days_feerates: Mutex<VecDeque<(u32, u32)>>,
- #[cfg(feature = "_test_utils")]
- /// In testing, it is useful be able to forge a name -> offer mapping so that we can pay an
- /// offer generated in the test.
- ///
- /// This allows for doing so, validating proofs as normal, but, if they pass, replacing the
- /// offer they resolve to to the given one.
- pub testing_dnssec_proof_offer_resolution_override: Mutex<HashMap<HumanReadableName, Offer>>,
-
#[cfg(test)]
pub(super) entropy_source: ES,
#[cfg(not(test))]
@@ -3680,9 +3658,6 @@ impl<
signer_provider,
logger,
-
- #[cfg(feature = "_test_utils")]
- testing_dnssec_proof_offer_resolution_override: Mutex::new(new_hash_map()),
}
}
@@ -5704,6 +5679,12 @@ impl<
/// # Custom Routing Parameters
/// Users can customize routing parameters via [`RouteParametersConfig`].
/// To use default settings, call the function with [`RouteParametersConfig::default`].
+ ///
+ /// In general, you should use the
+ /// [`bitcoin-payment-instructions` crate](https://docs.rs/bitcoin-payment-instructions/) to
+ /// resolve payment instructions strings (e.g. from QR codes, link opens, pasted instructions,
+ /// or typed instructions) into payment instructions and use this when the instructions resolve
+ /// to a BOLT 11 invoice.
pub fn pay_for_bolt11_invoice(
&self, invoice: &Bolt11Invoice, payment_id: PaymentId, amount_msats: Option<u64>,
optional_params: OptionalBolt11PaymentParams,
@@ -14588,6 +14569,12 @@ impl<
/// - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
/// request.
///
+ /// In general, you should use the
+ /// [`bitcoin-payment-instructions` crate](https://docs.rs/bitcoin-payment-instructions/) to
+ /// resolve payment instructions strings (e.g. from QR codes, link opens, pasted instructions,
+ /// or typed instructions) into payment instructions and use this when the instructions resolve
+ /// to a BOLT 12 offer.
+ ///
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
/// [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
@@ -14787,72 +14774,6 @@ impl<
Ok(invoice)
}
- /// Pays for an [`Offer`] looked up using [BIP 353] Human Readable Names resolved by the DNS
- /// resolver(s) at `dns_resolvers` which resolve names according to [bLIP 32].
- ///
- /// Because most wallets support on-chain or other payment schemes beyond only offers, this is
- /// deprecated in favor of the [`bitcoin-payment-instructions`] crate, which can be used to
- /// build an [`OfferFromHrn`] and call [`Self::pay_for_offer_from_hrn`]. Thus, this method is
- /// deprecated.
- ///
- /// # Payment
- ///
- /// The provided `payment_id` is used to ensure that only one invoice is paid for the request
- /// when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
- /// been sent.
- ///
- /// To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
- /// invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
- /// payment will fail with an [`PaymentFailureReason::UserAbandoned`] or
- /// [`PaymentFailureReason::InvoiceRequestExpired`], respectively.
- ///
- /// # Privacy
- ///
- /// For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
- /// to construct a [`BlindedMessagePath`] for the reply path.
- ///
- /// # Errors
- ///
- /// Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link.
- ///
- /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
- /// [bLIP 32]: https://github.com/lightning/blips/blob/master/blip-0032.md
- /// [`OMNameResolver::resolve_name`]: crate::onion_message::dns_resolution::OMNameResolver::resolve_name
- /// [`OMNameResolver::handle_dnssec_proof_for_uri`]: crate::onion_message::dns_resolution::OMNameResolver::handle_dnssec_proof_for_uri
- /// [`bitcoin-payment-instructions`]: https://docs.rs/bitcoin-payment-instructions/
- /// [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
- /// [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
- /// [`PaymentFailureReason::UserAbandoned`]: crate::events::PaymentFailureReason::UserAbandoned
- /// [`PaymentFailureReason::InvoiceRequestRejected`]: crate::events::PaymentFailureReason::InvoiceRequestRejected
- #[cfg(feature = "dnssec")]
- #[deprecated(note = "Use bitcoin-payment-instructions and pay_for_offer_from_hrn instead")]
- pub fn pay_for_offer_from_human_readable_name(
- &self, name: HumanReadableName, amount_msats: u64, payment_id: PaymentId,
- optional_params: OptionalOfferPaymentParams, dns_resolvers: Vec<Destination>,
- ) -> Result<(), ()> {
- let (onion_message, context) =
- self.flow.hrn_resolver.resolve_name(payment_id, name, &self.entropy_source)?;
-
- let expiration = StaleExpiration::TimerTicks(1);
- self.pending_outbound_payments.add_new_awaiting_offer(
- payment_id,
- expiration,
- optional_params.retry_strategy,
- optional_params.route_params_config,
- amount_msats,
- optional_params.payer_note,
- )?;
-
- self.flow
- .enqueue_dns_onion_message(
- onion_message,
- context,
- dns_resolvers,
- self.get_peers_for_blinded_path(),
- )
- .map_err(|_| ())
- }
-
/// Gets a payment secret and payment hash for use in an invoice given to a third party wishing
/// to pay us.
///
@@ -17398,65 +17319,6 @@ impl<
}
}
-#[cfg(feature = "dnssec")]
-impl<
- M: chain::Watch<SP::EcdsaSigner>,
- T: BroadcasterInterface,
- ES: EntropySource,
- NS: NodeSigner,
- SP: SignerProvider,
- F: FeeEstimator,
- R: Router,
- MR: MessageRouter,
- L: Logger,
- > DNSResolverMessageHandler for ChannelManager<M, T, ES, NS, SP, F, R, MR, L>
-{
- fn handle_dnssec_query(
- &self, _message: DNSSECQuery, _responder: Option<Responder>,
- ) -> Option<(DNSResolverMessage, ResponseInstruction)> {
- None
- }
-
- #[rustfmt::skip]
- fn handle_dnssec_proof(&self, message: DNSSECProof, context: DNSResolverContext) {
- let offer_opt = self.flow.hrn_resolver.handle_dnssec_proof_for_offer(message, context);
- #[cfg_attr(not(feature = "_test_utils"), allow(unused_mut))]
- if let Some((completed_requests, mut offer)) = offer_opt {
- for (name, payment_id) in completed_requests {
- #[cfg(feature = "_test_utils")]
- if let Some(replacement_offer) = self.testing_dnssec_proof_offer_resolution_override.lock().unwrap().remove(&name) {
- // If we have multiple pending requests we may end up over-using the override
- // offer, but tests can deal with that.
- offer = replacement_offer;
- }
- if let Ok((amt_msats, payer_note)) = self.pending_outbound_payments.params_for_payment_awaiting_offer(payment_id) {
- let offer_pay_res =
- self.pay_for_offer_intern(&offer, None, Some(amt_msats), payer_note, payment_id, Some(name),
- |retryable_invoice_request| {
- self.pending_outbound_payments
- .received_offer(payment_id, Some(retryable_invoice_request))
- .map_err(|_| Bolt12SemanticError::DuplicatePaymentId)
- });
- if offer_pay_res.is_err() {
- // The offer we tried to pay is the canonical current offer for the name we
- // wanted to pay. If we can't pay it, there's no way to recover so fail the
- // payment.
- // Note that the PaymentFailureReason should be ignored for an
- // AwaitingInvoice payment.
- self.pending_outbound_payments.abandon_payment(
- payment_id, PaymentFailureReason::RouteNotFound, &self.pending_events,
- );
- }
- }
- }
- }
- }
-
- fn release_pending_messages(&self) -> Vec<(DNSResolverMessage, MessageSendInstructions)> {
- self.flow.release_pending_dns_messages()
- }
-}
-
impl<
M: chain::Watch<SP::EcdsaSigner>,
T: BroadcasterInterface,
@@ -20233,9 +20095,6 @@ impl<
logger: args.logger,
config: RwLock::new(args.config),
-
- #[cfg(feature = "_test_utils")]
- testing_dnssec_proof_offer_resolution_override: Mutex::new(new_hash_map()),
};
let mut processed_claims: HashSet<Vec<MPPClaimHTLCSource>> = new_hash_set();
diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs
index 84cdf78..d39cee7 100644
--- a/lightning/src/ln/functional_test_utils.rs
+++ b/lightning/src/ln/functional_test_utils.rs
@@ -521,7 +521,6 @@ pub type TestChannelManager<'node_cfg, 'chan_mon_cfg> = ChannelManager<
&'chan_mon_cfg test_utils::TestLogger,
>;
-#[cfg(not(feature = "dnssec"))]
type TestOnionMessenger<'chan_man, 'node_cfg, 'chan_mon_cfg> = OnionMessenger<
DedicatedEntropy,
&'node_cfg test_utils::TestKeysInterface,
@@ -534,19 +533,6 @@ type TestOnionMessenger<'chan_man, 'node_cfg, 'chan_mon_cfg> = OnionMessenger<
IgnoringMessageHandler,
>;
-#[cfg(feature = "dnssec")]
-type TestOnionMessenger<'chan_man, 'node_cfg, 'chan_mon_cfg> = OnionMessenger<
- DedicatedEntropy,
- &'node_cfg test_utils::TestKeysInterface,
- &'chan_mon_cfg test_utils::TestLogger,
- &'chan_man TestChannelManager<'node_cfg, 'chan_mon_cfg>,
- &'node_cfg test_utils::TestMessageRouter<'chan_mon_cfg>,
- &'chan_man TestChannelManager<'node_cfg, 'chan_mon_cfg>,
- &'chan_man TestChannelManager<'node_cfg, 'chan_mon_cfg>,
- &'chan_man TestChannelManager<'node_cfg, 'chan_mon_cfg>,
- IgnoringMessageHandler,
->;
-
/// For use with [`OnionMessenger`] otherwise `test_restored_packages_retry` will fail. This is
/// because that test uses older serialized data produced by calling [`EntropySource`] in a specific
/// manner. Using the same [`EntropySource`] with [`OnionMessenger`] would introduce another call,
@@ -4797,19 +4783,6 @@ pub fn create_network<'a, 'b: 'a, 'c: 'b>(
for i in 0..node_count {
let dedicated_entropy = DedicatedEntropy(RandomBytes::new([i as u8; 32]));
- #[cfg(feature = "dnssec")]
- let onion_messenger = OnionMessenger::new_with_offline_peer_interception(
- dedicated_entropy,
- cfgs[i].keys_manager,
- cfgs[i].logger,
- &chan_mgrs[i],
- &cfgs[i].message_router,
- &chan_mgrs[i],
- &chan_mgrs[i],
- &chan_mgrs[i],
- IgnoringMessageHandler {},
- );
- #[cfg(not(feature = "dnssec"))]
let onion_messenger = OnionMessenger::new_with_offline_peer_interception(
dedicated_entropy,
cfgs[i].keys_manager,
diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs
index 9241e6c..7259f60 100644
--- a/lightning/src/ln/outbound_payment.rs
+++ b/lightning/src/ln/outbound_payment.rs
@@ -2033,65 +2033,6 @@ impl OutboundPayments {
(payment, onion_session_privs)
}
- #[cfg(feature = "dnssec")]
- pub(super) fn add_new_awaiting_offer(
- &self, payment_id: PaymentId, expiration: StaleExpiration, retry_strategy: Retry,
- route_params_config: RouteParametersConfig, amount_msats: u64, payer_note: Option<String>,
- ) -> Result<(), ()> {
- let mut pending_outbounds = self.pending_outbound_payments.lock().unwrap();
- match pending_outbounds.entry(payment_id) {
- hash_map::Entry::Occupied(_) => Err(()),
- hash_map::Entry::Vacant(entry) => {
- entry.insert(PendingOutboundPayment::AwaitingOffer {
- expiration,
- retry_strategy,
- route_params_config,
- amount_msats,
- payer_note,
- });
-
- Ok(())
- },
- }
- }
-
- #[cfg(feature = "dnssec")]
- #[rustfmt::skip]
- pub(super) fn params_for_payment_awaiting_offer(&self, payment_id: PaymentId) -> Result<(u64, Option<String>), ()> {
- match self.pending_outbound_payments.lock().unwrap().entry(payment_id) {
- hash_map::Entry::Occupied(entry) => match entry.get() {
- PendingOutboundPayment::AwaitingOffer { amount_msats, payer_note, .. } => Ok((*amount_msats, payer_note.clone())),
- _ => Err(()),
- },
- _ => Err(()),
- }
- }
-
- #[cfg(feature = "dnssec")]
- #[rustfmt::skip]
- pub(super) fn received_offer(
- &self, payment_id: PaymentId, retryable_invoice_request: Option<RetryableInvoiceRequest>,
- ) -> Result<(), ()> {
- match self.pending_outbound_payments.lock().unwrap().entry(payment_id) {
- hash_map::Entry::Occupied(entry) => match entry.get() {
- PendingOutboundPayment::AwaitingOffer {
- expiration, retry_strategy, route_params_config, ..
- } => {
- let mut new_val = PendingOutboundPayment::AwaitingInvoice {
- expiration: *expiration,
- retry_strategy: *retry_strategy,
- route_params_config: *route_params_config,
- retryable_invoice_request,
- };
- core::mem::swap(&mut new_val, entry.into_mut());
- Ok(())
- },
- _ => Err(()),
- },
- hash_map::Entry::Vacant(_) => Err(()),
- }
- }
-
pub(super) fn add_new_awaiting_invoice(
&self, payment_id: PaymentId, expiration: StaleExpiration, retry_strategy: Retry,
route_params_config: RouteParametersConfig,
@@ -2886,6 +2827,8 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
},
// Added in 0.1. Prior versions will drop these outbounds on downgrade, which is safe because
// no HTLCs are in-flight.
+ // No longer created in 0.3 as we now expect BIP 353 to happen before a payment makes it into
+ // the `lightning` crate.
(11, AwaitingOffer) => {
(0, expiration, required),
(2, retry_strategy, required),
diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs
index f94eb78..7ef4e4a 100644
--- a/lightning/src/onion_message/messenger.rs
+++ b/lightning/src/onion_message/messenger.rs
@@ -2340,28 +2340,6 @@ impl<
/// [`SimpleArcChannelManager`]: crate::ln::channelmanager::SimpleArcChannelManager
/// [`SimpleArcPeerManager`]: crate::ln::peer_handler::SimpleArcPeerManager
#[cfg(not(c_bindings))]
-#[cfg(feature = "dnssec")]
-pub type SimpleArcOnionMessenger<M, T, F, L> = OnionMessenger<
- Arc<KeysManager>,
- Arc<KeysManager>,
- Arc<L>,
- Arc<SimpleArcChannelManager<M, T, F, L>>,
- Arc<DefaultMessageRouter<Arc<NetworkGraph<Arc<L>>>, Arc<L>, Arc<KeysManager>>>,
- Arc<SimpleArcChannelManager<M, T, F, L>>,
- Arc<SimpleArcChannelManager<M, T, F, L>>,
- Arc<SimpleArcChannelManager<M, T, F, L>>,
- IgnoringMessageHandler,
->;
-
-/// Useful for simplifying the parameters of [`SimpleArcChannelManager`] and
-/// [`SimpleArcPeerManager`]. See their docs for more details.
-///
-/// This is not exported to bindings users as type aliases aren't supported in most languages.
-///
-/// [`SimpleArcChannelManager`]: crate::ln::channelmanager::SimpleArcChannelManager
-/// [`SimpleArcPeerManager`]: crate::ln::peer_handler::SimpleArcPeerManager
-#[cfg(not(c_bindings))]
-#[cfg(not(feature = "dnssec"))]
pub type SimpleArcOnionMessenger<M, T, F, L> = OnionMessenger<
Arc<KeysManager>,
Arc<KeysManager>,
@@ -2382,29 +2360,6 @@ pub type SimpleArcOnionMessenger<M, T, F, L> = OnionMessenger<
/// [`SimpleRefChannelManager`]: crate::ln::channelmanager::SimpleRefChannelManager
/// [`SimpleRefPeerManager`]: crate::ln::peer_handler::SimpleRefPeerManager
#[cfg(not(c_bindings))]
-#[cfg(feature = "dnssec")]
-pub type SimpleRefOnionMessenger<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, M, T, F, L> =
- OnionMessenger<
- &'a KeysManager,
- &'a KeysManager,
- &'b L,
- &'j SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, M, T, F, L>,
- &'i DefaultMessageRouter<&'g NetworkGraph<&'b L>, &'b L, &'a KeysManager>,
- &'j SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, M, T, F, L>,
- &'j SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, M, T, F, L>,
- &'j SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, M, T, F, L>,
- IgnoringMessageHandler,
- >;
-
-/// Useful for simplifying the parameters of [`SimpleRefChannelManager`] and
-/// [`SimpleRefPeerManager`]. See their docs for more details.
-///
-/// This is not exported to bindings users as type aliases aren't supported in most languages.
-///
-/// [`SimpleRefChannelManager`]: crate::ln::channelmanager::SimpleRefChannelManager
-/// [`SimpleRefPeerManager`]: crate::ln::peer_handler::SimpleRefPeerManager
-#[cfg(not(c_bindings))]
-#[cfg(not(feature = "dnssec"))]
pub type SimpleRefOnionMessenger<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, M, T, F, L> =
OnionMessenger<
&'a KeysManager,
Why this scored 15/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.