File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -92,27 +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- std:: fs:: read ( s)
106- . map_err ( |e| {
107- log:: error!( "Failed to read ohttp_keys file: {}" , e) ;
108- ConfigError :: Message ( format ! (
109- "Failed to read ohttp_keys file: {}" ,
110- e
111- ) )
112- } )
113- . ok ( )
114- } ) ,
115- ) ?
112+ . set_override_option ( "ohttp_keys" , ohttp_keys)
116113 } ;
117114
118115 let max_fee_rate = matches
You can’t perform that action at this time.
0 commit comments