@@ -14,9 +14,6 @@ mod commands;
1414mod handlers;
1515mod nodes;
1616mod utils;
17-
18- use nodes:: Nodes ;
19-
2017use bitcoin:: Network ;
2118
2219use log:: { debug, error, warn} ;
@@ -40,63 +37,7 @@ fn main() {
4037 warn ! ( "This is experimental software and not currently recommended for use on Bitcoin mainnet, proceed with caution." )
4138 }
4239
43- #[ cfg( feature = "regtest-node" ) ]
44- let bitcoind = {
45- if network != Network :: Regtest {
46- error ! ( "Do not override default network value for `regtest-node` features" ) ;
47- }
48- let bitcoind_conf = electrsd:: bitcoind:: Conf :: default ( ) ;
49- let bitcoind_exe = electrsd:: bitcoind:: downloaded_exe_path ( )
50- . expect ( "We should always have downloaded path" ) ;
51- electrsd:: bitcoind:: BitcoinD :: with_conf ( bitcoind_exe, & bitcoind_conf) . unwrap ( )
52- } ;
53-
54- #[ cfg( feature = "regtest-bitcoin" ) ]
55- let backend = {
56- Nodes :: Bitcoin {
57- rpc_url : bitcoind. params . rpc_socket . to_string ( ) ,
58- rpc_auth : bitcoind
59- . params
60- . cookie_file
61- . clone ( )
62- . into_os_string ( )
63- . into_string ( )
64- . unwrap ( ) ,
65- }
66- } ;
67-
68- #[ cfg( feature = "regtest-electrum" ) ]
69- let ( _electrsd, backend) = {
70- let elect_conf = electrsd:: Conf :: default ( ) ;
71- let elect_exe =
72- electrsd:: downloaded_exe_path ( ) . expect ( "We should always have downloaded path" ) ;
73- let electrsd = electrsd:: ElectrsD :: with_conf ( elect_exe, & bitcoind, & elect_conf) . unwrap ( ) ;
74- let backend = Nodes :: Electrum {
75- electrum_url : electrsd. electrum_url . clone ( ) ,
76- } ;
77- ( electrsd, backend)
78- } ;
79-
80- #[ cfg( any( feature = "regtest-esplora-ureq" , feature = "regtest-esplora-reqwest" ) ) ]
81- let ( _electrsd, backend) = {
82- let mut elect_conf = electrsd:: Conf :: default ( ) ;
83- elect_conf. http_enabled = true ;
84- let elect_exe =
85- electrsd:: downloaded_exe_path ( ) . expect ( "Electrsd downloaded binaries not found" ) ;
86- let electrsd = electrsd:: ElectrsD :: with_conf ( elect_exe, & bitcoind, & elect_conf) . unwrap ( ) ;
87- let backend = Nodes :: Esplora {
88- esplora_url : electrsd
89- . esplora_url
90- . clone ( )
91- . expect ( "Esplora port not open in electrum" ) ,
92- } ;
93- ( electrsd, nodes)
94- } ;
95-
96- #[ cfg( not( feature = "regtest-node" ) ) ]
97- let backend = Nodes :: None ;
98-
99- match handle_command ( cli_opts, network, backend) {
40+ match handle_command ( cli_opts) {
10041 Ok ( result) => println ! ( "{}" , result) ,
10142 Err ( e) => {
10243 match e {
0 commit comments