@@ -320,6 +320,10 @@ pub struct ElectrumOpts {
320320 default_value = "10"
321321 ) ]
322322 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 > ,
323327}
324328
325329/// Options to configure Esplora backend.
@@ -663,6 +667,7 @@ mod test {
663667 timeout : None ,
664668 server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
665669 stop_gap : 10 ,
670+ validate_domain : None ,
666671 } ,
667672 #[ cfg( feature = "esplora" ) ]
668673 esplora_opts : EsploraOpts {
@@ -707,6 +712,7 @@ mod test {
707712 "--change_descriptor" , "wpkh(tpubDEnoLuPdBep9bzw5LoGYpsxUQYheRQ9gcgrJhJEcdKFB9cWQRyYmkCyRoTqeD4tJYiVVgt6A3rN6rWn9RYhR9sBsGxji29LYWHuKKbdb1ev/1/*)" ,
708713 "--server" , "ssl://electrum.blockstream.info:50002" ,
709714 "--stop_gap" , "20" ,
715+ "--validate_domain" , "false" ,
710716 "get_new_address" ] ;
711717
712718 let cli_opts = CliOpts :: from_iter ( & cli_args) ;
@@ -723,7 +729,8 @@ mod test {
723729 electrum_opts : ElectrumOpts {
724730 timeout : Some ( 10 ) ,
725731 server : "ssl://electrum.blockstream.info:50002" . to_string ( ) ,
726- stop_gap : 20
732+ stop_gap : 20 ,
733+ validate_domain : Some ( false ) ,
727734 } ,
728735 proxy_opts : ProxyOpts {
729736 proxy : Some ( "127.0.0.1:9150" . to_string ( ) ) ,
@@ -927,6 +934,7 @@ mod test {
927934 timeout : None ,
928935 server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
929936 stop_gap : 10 ,
937+ validate_domain : None ,
930938 } ,
931939 #[ cfg( feature = "esplora" ) ]
932940 esplora_opts : EsploraOpts {
@@ -1006,6 +1014,7 @@ mod test {
10061014 timeout : None ,
10071015 server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
10081016 stop_gap : 10 ,
1017+ validate_domain : None ,
10091018 } ,
10101019 #[ cfg( feature = "esplora" ) ]
10111020 esplora_opts : EsploraOpts {
@@ -1078,6 +1087,7 @@ mod test {
10781087 timeout : None ,
10791088 server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
10801089 stop_gap : 10 ,
1090+ validate_domain : None ,
10811091 } ,
10821092 #[ cfg( feature = "esplora" ) ]
10831093 esplora_opts : EsploraOpts {
@@ -1149,6 +1159,7 @@ mod test {
11491159 timeout : None ,
11501160 server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
11511161 stop_gap : 10 ,
1162+ validate_domain : None ,
11521163 } ,
11531164 #[ cfg( feature = "esplora" ) ]
11541165 esplora_opts : EsploraOpts {
@@ -1486,6 +1497,7 @@ mod test {
14861497 timeout : None ,
14871498 server : "ssl://electrum.blockstream.info:60002" . to_string ( ) ,
14881499 stop_gap : 10 ,
1500+ validate_domain : None ,
14891501 } ,
14901502 } ,
14911503 } ;
0 commit comments