From d549afc37db870c33bf02b4454a7ad53d4a4fe9a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 2 Oct 2024 18:23:31 +0000 Subject: [PATCH] Set the `dns_resolution` feature in `OMDomainResolver` `OMDomainResolver` actually does support building DNSSECProofs, so should be setting the `dns_resolution` `NodeFeature` flag. --- lightning-dns-resolver/Cargo.toml | 1 + lightning-dns-resolver/src/lib.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lightning-dns-resolver/Cargo.toml b/lightning-dns-resolver/Cargo.toml index 14304678d08..1c2ebe615b2 100644 --- a/lightning-dns-resolver/Cargo.toml +++ b/lightning-dns-resolver/Cargo.toml @@ -9,6 +9,7 @@ edition = "2021" [dependencies] lightning = { version = "0.0.124", path = "../lightning", default-features = false } +lightning-types = { version = "0.1", path = "../lightning-types", default-features = false } dnssec-prover = { version = "0.6", default-features = false, features = [ "std", "tokio" ] } tokio = { version = "1.0", default-features = false, features = ["rt"] } diff --git a/lightning-dns-resolver/src/lib.rs b/lightning-dns-resolver/src/lib.rs index 4c264b9f534..f9af268707a 100644 --- a/lightning-dns-resolver/src/lib.rs +++ b/lightning-dns-resolver/src/lib.rs @@ -21,6 +21,8 @@ use lightning::onion_message::messenger::{ MessageSendInstructions, Responder, ResponseInstruction, }; +use lightning_types::features::NodeFeatures; + use tokio::runtime::Handle; #[cfg(not(any(target_pointer_width = "32", target_pointer_width = "64")))] @@ -126,6 +128,12 @@ where None } + fn provided_node_features(&self) -> NodeFeatures { + let mut features = NodeFeatures::empty(); + features.set_dns_resolution_optional(); + features + } + fn release_pending_messages(&self) -> Vec<(DNSResolverMessage, MessageSendInstructions)> { core::mem::take(&mut *self.state.pending_replies.lock().unwrap()) }