Skip to content

Commit 2637b38

Browse files
committed
Drop stale DNSSec resolution logic in OffersMessageFlow
In 884158d we dropped built-in BIP 353 resolution logic in favor of the `bitcoin-payment-instructions` crate but forgot to do so in the `OffersMessageFlow`. Here we do so.
1 parent 790ffa3 commit 2637b38

1 file changed

Lines changed: 0 additions & 65 deletions

File tree

lightning/src/offers/flow.rs

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ use crate::types::payment::{PaymentHash, PaymentSecret};
6262
use crate::util::logger::Logger;
6363
use crate::util::ser::Writeable;
6464

65-
#[cfg(feature = "dnssec")]
66-
use {
67-
crate::blinded_path::message::DNSResolverContext,
68-
crate::onion_message::dns_resolution::{DNSResolverMessage, DNSSECQuery, OMNameResolver},
69-
};
70-
7165
/// A BOLT12 offers code and flow utility provider, which facilitates
7266
/// BOLT12 builder generation and onion message handling.
7367
///
@@ -94,11 +88,6 @@ pub struct OffersMessageFlow<MR: MessageRouter, L: Logger> {
9488
pending_async_payments_messages: Mutex<Vec<(AsyncPaymentsMessage, MessageSendInstructions)>>,
9589
async_receive_offer_cache: Mutex<AsyncReceiveOfferCache>,
9690

97-
#[cfg(feature = "dnssec")]
98-
pub(crate) hrn_resolver: OMNameResolver,
99-
#[cfg(feature = "dnssec")]
100-
pending_dns_onion_messages: Mutex<Vec<(DNSResolverMessage, MessageSendInstructions)>>,
101-
10291
logger: L,
10392
}
10493

@@ -126,11 +115,6 @@ impl<MR: MessageRouter, L: Logger> OffersMessageFlow<MR, L> {
126115
pending_offers_messages: Mutex::new(Vec::new()),
127116
pending_async_payments_messages: Mutex::new(Vec::new()),
128117

129-
#[cfg(feature = "dnssec")]
130-
hrn_resolver: OMNameResolver::new(current_timestamp, best_block.height),
131-
#[cfg(feature = "dnssec")]
132-
pending_dns_onion_messages: Mutex::new(Vec::new()),
133-
134118
async_receive_offer_cache: Mutex::new(AsyncReceiveOfferCache::new()),
135119

136120
logger,
@@ -220,12 +204,6 @@ impl<MR: MessageRouter, L: Logger> OffersMessageFlow<MR, L> {
220204
break;
221205
}
222206
}
223-
224-
#[cfg(feature = "dnssec")]
225-
{
226-
let updated_time = timestamp.load(Ordering::Acquire) as u32;
227-
self.hrn_resolver.new_best_block(_height, updated_time);
228-
}
229207
}
230208
}
231209

@@ -1306,41 +1284,6 @@ impl<MR: MessageRouter, L: Logger> OffersMessageFlow<MR, L> {
13061284
)
13071285
}
13081286

1309-
/// Enqueues the created [`DNSSECQuery`] to be sent to the counterparty.
1310-
///
1311-
/// # Peers
1312-
///
1313-
/// The user must provide a list of [`MessageForwardNode`] that will be used to generate
1314-
/// valid reply paths for the counterparty to send back the corresponding response for
1315-
/// the [`DNSSECQuery`] message.
1316-
///
1317-
/// [`supports_onion_messages`]: crate::types::features::Features::supports_onion_messages
1318-
#[cfg(feature = "dnssec")]
1319-
pub fn enqueue_dns_onion_message(
1320-
&self, message: DNSSECQuery, context: DNSResolverContext, dns_resolvers: Vec<Destination>,
1321-
peers: Vec<MessageForwardNode>,
1322-
) -> Result<(), Bolt12SemanticError> {
1323-
let reply_paths = self
1324-
.create_blinded_paths(peers, MessageContext::DNSResolver(context))
1325-
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
1326-
1327-
let message_params = dns_resolvers
1328-
.iter()
1329-
.flat_map(|destination| reply_paths.iter().map(move |path| (path, destination)))
1330-
.take(OFFERS_MESSAGE_REQUEST_LIMIT);
1331-
for (reply_path, destination) in message_params {
1332-
self.pending_dns_onion_messages.lock().unwrap().push((
1333-
DNSResolverMessage::DNSSECQuery(message.clone()),
1334-
MessageSendInstructions::WithSpecifiedReplyPath {
1335-
destination: destination.clone(),
1336-
reply_path: reply_path.clone(),
1337-
},
1338-
));
1339-
}
1340-
1341-
Ok(())
1342-
}
1343-
13441287
/// Gets the enqueued [`OffersMessage`] with their corresponding [`MessageSendInstructions`].
13451288
pub fn release_pending_offers_messages(&self) -> Vec<(OffersMessage, MessageSendInstructions)> {
13461289
core::mem::take(&mut self.pending_offers_messages.lock().unwrap())
@@ -1353,14 +1296,6 @@ impl<MR: MessageRouter, L: Logger> OffersMessageFlow<MR, L> {
13531296
core::mem::take(&mut self.pending_async_payments_messages.lock().unwrap())
13541297
}
13551298

1356-
/// Gets the enqueued [`DNSResolverMessage`] with their corresponding [`MessageSendInstructions`].
1357-
#[cfg(feature = "dnssec")]
1358-
pub fn release_pending_dns_messages(
1359-
&self,
1360-
) -> Vec<(DNSResolverMessage, MessageSendInstructions)> {
1361-
core::mem::take(&mut self.pending_dns_onion_messages.lock().unwrap())
1362-
}
1363-
13641299
/// Retrieve an [`Offer`] for receiving async payments as an often-offline recipient. Will only
13651300
/// return an offer if [`Self::set_paths_to_static_invoice_server`] was called and we succeeded in
13661301
/// interactively building a [`StaticInvoice`] with the static invoice server.

0 commit comments

Comments
 (0)