File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ pub use electrum_client;
34
34
pub use error:: Error ;
35
35
pub use which;
36
36
37
+ #[ derive( Debug , Clone , Eq , PartialEq ) ]
38
+ pub enum Backend {
39
+ Electrs ,
40
+ Esplora ,
41
+ Mempool ,
42
+ }
43
+
37
44
/// Electrs configuration parameters, implements a convenient [Default] for most common use.
38
45
///
39
46
/// Default values:
@@ -81,6 +88,9 @@ pub struct Conf<'a> {
81
88
/// Persistent directory path
82
89
pub staticdir : Option < PathBuf > ,
83
90
91
+ /// The backend type in use
92
+ pub backend : Backend ,
93
+
84
94
/// Try to spawn the process `attempt` time
85
95
///
86
96
/// The OS is giving available ports to use, however, they aren't booked, so it could rarely
@@ -110,6 +120,7 @@ impl Default for Conf<'_> {
110
120
staticdir : None ,
111
121
attempts : 3 ,
112
122
buffered_logs : false ,
123
+ backend : Backend :: Electrs ,
113
124
}
114
125
}
115
126
}
@@ -202,7 +213,11 @@ impl ElectrsD {
202
213
let cookie_file;
203
214
#[ cfg( not( feature = "legacy" ) ) ]
204
215
{
205
- args. push ( "--cookie-file" ) ;
216
+ if let Backend :: Mempool = conf. backend {
217
+ args. push ( "--cookie" ) ;
218
+ } else {
219
+ args. push ( "--cookie-file" ) ;
220
+ }
206
221
cookie_file = format ! ( "{}" , bitcoind. params. cookie_file. display( ) ) ;
207
222
args. push ( & cookie_file) ;
208
223
}
You can’t perform that action at this time.
0 commit comments