File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -92,25 +92,24 @@ impl AppConfig {
9292 ) ?
9393 } ;
9494
95+ #[ cfg( feature = "v2" ) ]
96+ let ohttp_keys = matches
97+ . get_one :: < String > ( "ohttp_keys" )
98+ . map ( |s| std:: fs:: read ( s) )
99+ . transpose ( )
100+ . map_err ( |e| {
101+ log:: error!( "Failed to read ohttp_keys file: {}" , e) ;
102+ ConfigError :: Message ( format ! ( "Failed to read ohttp_keys file: {}" , e) )
103+ } ) ?;
104+
95105 #[ cfg( feature = "v2" ) ]
96106 let builder = {
97107 builder
98108 . set_override_option (
99109 "pj_directory" ,
100110 matches. get_one :: < Url > ( "pj_directory" ) . map ( |s| s. as_str ( ) ) ,
101111 ) ?
102- . set_override_option (
103- "ohttp_keys" ,
104- matches. get_one :: < String > ( "ohttp_keys" ) . and_then ( |s| {
105- Some ( std:: fs:: read ( s) . map_err ( |e| {
106- log:: error!( "Failed to read ohttp_keys file: {}" , e) ;
107- ConfigError :: Message ( format ! (
108- "Failed to read ohttp_keys file: {}" ,
109- e
110- ) )
111- } ) ?)
112- } ) ,
113- ) ?
112+ . set_override_option ( "ohttp_keys" , ohttp_keys)
114113 } ;
115114
116115 let max_fee_rate = matches
You can’t perform that action at this time.
0 commit comments