@@ -320,6 +320,10 @@ 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 [default: true].
325
+ #[ clap( name = "VALIDATE_DOMAIN" , long = "validate_domain" ) ]
326
+ pub validate_domain : Option < bool > ,
323
327
}
324
328
325
329
/// Options to configure Esplora backend.
@@ -663,6 +667,7 @@ mod test {
663
667
timeout : None ,
664
668
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
665
669
stop_gap : 10 ,
670
+ validate_domain : None ,
666
671
} ,
667
672
#[ cfg( feature = "esplora" ) ]
668
673
esplora_opts : EsploraOpts {
@@ -707,6 +712,7 @@ mod test {
707
712
"--change_descriptor" , "wpkh(tpubDEnoLuPdBep9bzw5LoGYpsxUQYheRQ9gcgrJhJEcdKFB9cWQRyYmkCyRoTqeD4tJYiVVgt6A3rN6rWn9RYhR9sBsGxji29LYWHuKKbdb1ev/1/*)" ,
708
713
"--server" , "ssl://electrum.blockstream.info:50002" ,
709
714
"--stop_gap" , "20" ,
715
+ "--validate_domain" , "false" ,
710
716
"get_new_address" ] ;
711
717
712
718
let cli_opts = CliOpts :: from_iter ( & cli_args) ;
@@ -723,7 +729,8 @@ mod test {
723
729
electrum_opts : ElectrumOpts {
724
730
timeout : Some ( 10 ) ,
725
731
server : "ssl://electrum.blockstream.info:50002" . to_string ( ) ,
726
- stop_gap : 20
732
+ stop_gap : 20 ,
733
+ validate_domain : Some ( false ) ,
727
734
} ,
728
735
proxy_opts : ProxyOpts {
729
736
proxy : Some ( "127.0.0.1:9150" . to_string ( ) ) ,
@@ -927,6 +934,7 @@ mod test {
927
934
timeout : None ,
928
935
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
929
936
stop_gap : 10 ,
937
+ validate_domain : None ,
930
938
} ,
931
939
#[ cfg( feature = "esplora" ) ]
932
940
esplora_opts : EsploraOpts {
@@ -1006,6 +1014,7 @@ mod test {
1006
1014
timeout : None ,
1007
1015
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
1008
1016
stop_gap : 10 ,
1017
+ validate_domain : None ,
1009
1018
} ,
1010
1019
#[ cfg( feature = "esplora" ) ]
1011
1020
esplora_opts : EsploraOpts {
@@ -1078,6 +1087,7 @@ mod test {
1078
1087
timeout : None ,
1079
1088
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
1080
1089
stop_gap : 10 ,
1090
+ validate_domain : None ,
1081
1091
} ,
1082
1092
#[ cfg( feature = "esplora" ) ]
1083
1093
esplora_opts : EsploraOpts {
@@ -1149,6 +1159,7 @@ mod test {
1149
1159
timeout : None ,
1150
1160
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
1151
1161
stop_gap : 10 ,
1162
+ validate_domain : None ,
1152
1163
} ,
1153
1164
#[ cfg( feature = "esplora" ) ]
1154
1165
esplora_opts : EsploraOpts {
@@ -1486,6 +1497,7 @@ mod test {
1486
1497
timeout : None ,
1487
1498
server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
1488
1499
stop_gap : 10 ,
1500
+ validate_domain : None ,
1489
1501
} ,
1490
1502
} ,
1491
1503
} ;
0 commit comments