File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ indexmap = "2.0"
4646# Terminal UI
4747crossterm = " 0.27"
4848
49- # DNS
50- trust-dns- resolver = " 0.23 "
49+ # DNS (trust-dns-resolver was renamed to hickory_resolver)
50+ hickory- resolver = " 0.25 "
5151
5252# Also add log to main dependencies for consistency
5353log = " 0.4"
@@ -68,4 +68,4 @@ path = "src/lib.rs"
6868
6969[features ]
7070# Gate incomplete mock-dependent tests to avoid "unexpected cfg" warnings.
71- skip_mock_implementation_incomplete = []
71+ skip_mock_implementation_incomplete = []
Original file line number Diff line number Diff line change 22
33use dashcore:: Network ;
44use std:: net:: { IpAddr , SocketAddr } ;
5- use trust_dns_resolver:: config:: { ResolverConfig , ResolverOpts } ;
6- use trust_dns_resolver:: TokioAsyncResolver ;
5+ use hickory_resolver:: config:: { ResolverConfig , ResolverOpts } ;
6+ use hickory_resolver:: name_server:: TokioConnectionProvider ;
7+ use hickory_resolver:: TokioResolver ;
78
89use crate :: error:: SpvError as Error ;
910use crate :: network:: constants:: { MAINNET_DNS_SEEDS , TESTNET_DNS_SEEDS } ;
1011
1112/// DNS discovery for finding initial peers
1213pub struct DnsDiscovery {
13- resolver : TokioAsyncResolver ,
14+ resolver : TokioResolver ,
1415}
1516
1617impl DnsDiscovery {
1718 /// Create a new DNS discovery instance
1819 pub async fn new ( ) -> Result < Self , Error > {
19- let resolver =
20- TokioAsyncResolver :: tokio ( ResolverConfig :: default ( ) , ResolverOpts :: default ( ) ) ;
21-
22- Ok ( Self {
23- resolver,
24- } )
20+ let resolver = hickory_resolver:: Resolver :: builder_with_config (
21+ ResolverConfig :: default ( ) ,
22+ TokioConnectionProvider :: default ( ) ,
23+ )
24+ . with_options ( ResolverOpts :: default ( ) )
25+ . build ( ) ;
26+
27+ Ok ( Self { resolver } )
2528 }
2629
2730 /// Discover peers for the given network
You can’t perform that action at this time.
0 commit comments