@@ -320,6 +320,14 @@ pub struct ElectrumOpts {
320
320
default_value = "10"
321
321
) ]
322
322
pub stop_gap : usize ,
323
+
324
+ /// Enable domain validation when connecting to Electrum servers.
325
+ #[ clap(
326
+ name = "VALIDATE_DOMAIN" ,
327
+ long = "validate_domain" ,
328
+ default_value = "true"
329
+ ) ]
330
+ pub validate_domain : bool ,
323
331
}
324
332
325
333
/// Options to configure Esplora backend.
@@ -663,6 +671,7 @@ mod test {
663
671
timeout : None ,
664
672
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
665
673
stop_gap : 10 ,
674
+ validate_domain : true ,
666
675
} ,
667
676
#[ cfg( feature = "esplora" ) ]
668
677
esplora_opts : EsploraOpts {
@@ -723,7 +732,8 @@ mod test {
723
732
electrum_opts : ElectrumOpts {
724
733
timeout : Some ( 10 ) ,
725
734
server : "ssl://electrum.blockstream.info:50002" . to_string ( ) ,
726
- stop_gap : 20
735
+ stop_gap : 20 ,
736
+ validate_domain : true ,
727
737
} ,
728
738
proxy_opts : ProxyOpts {
729
739
proxy : Some ( "127.0.0.1:9150" . to_string ( ) ) ,
@@ -927,6 +937,7 @@ mod test {
927
937
timeout : None ,
928
938
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
929
939
stop_gap : 10 ,
940
+ validate_domain : true ,
930
941
} ,
931
942
#[ cfg( feature = "esplora" ) ]
932
943
esplora_opts : EsploraOpts {
@@ -1006,6 +1017,7 @@ mod test {
1006
1017
timeout : None ,
1007
1018
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
1008
1019
stop_gap : 10 ,
1020
+ validate_domain : true ,
1009
1021
} ,
1010
1022
#[ cfg( feature = "esplora" ) ]
1011
1023
esplora_opts : EsploraOpts {
@@ -1078,6 +1090,7 @@ mod test {
1078
1090
timeout : None ,
1079
1091
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
1080
1092
stop_gap : 10 ,
1093
+ validate_domain : true ,
1081
1094
} ,
1082
1095
#[ cfg( feature = "esplora" ) ]
1083
1096
esplora_opts : EsploraOpts {
@@ -1149,6 +1162,7 @@ mod test {
1149
1162
timeout : None ,
1150
1163
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
1151
1164
stop_gap : 10 ,
1165
+ validate_domain : true ,
1152
1166
} ,
1153
1167
#[ cfg( feature = "esplora" ) ]
1154
1168
esplora_opts : EsploraOpts {
@@ -1486,6 +1500,7 @@ mod test {
1486
1500
timeout : None ,
1487
1501
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
1488
1502
stop_gap : 10 ,
1503
+ validate_domain : true ,
1489
1504
} ,
1490
1505
} ,
1491
1506
} ;
0 commit comments