@@ -94,11 +94,13 @@ pub struct Node {
9494
9595 /// Enable block producer with this key file
9696 ///
97- /// MINA_PRIVKEY_PASS must be set to decrypt the keyfile
97+ /// MINA_PRIVKEY_PASS must be set to decrypt the keyfile if it is password-protected
9898 #[ arg( long, env, group = "producer" ) ]
9999 pub producer_key : Option < PathBuf > ,
100- #[ arg( env = "MINA_PRIVKEY_PASS" ) ]
101- pub producer_key_password : Option < String > ,
100+
101+ /// Password used to decrypt the producer key file.
102+ #[ arg( env = "MINA_PRIVKEY_PASS" , default_value = "" ) ]
103+ pub producer_key_password : String ,
102104
103105 /// Address to send coinbase rewards to (if this node is producing blocks).
104106 /// If not provided, coinbase rewards will be sent to the producer
@@ -222,13 +224,12 @@ impl Node {
222224 . block_verifier_index ( block_verifier_index. clone ( ) )
223225 . work_verifier_index ( work_verifier_index. clone ( ) ) ;
224226
225- if let ( Some ( producer_key_path) , Some ( pasword) ) =
226- ( self . producer_key , & self . producer_key_password )
227- {
227+ if let Some ( producer_key_path) = self . producer_key {
228+ let password = & self . producer_key_password ;
228229 node:: core:: info!( node:: core:: log:: system_time( ) ; summary = "loading provers index" ) ;
229230 let provers = BlockProver :: make ( Some ( block_verifier_index) , Some ( work_verifier_index) ) ;
230231 node:: core:: info!( node:: core:: log:: system_time( ) ; summary = "loaded provers index" ) ;
231- node_builder. block_producer_from_file ( provers, producer_key_path, pasword ) ?;
232+ node_builder. block_producer_from_file ( provers, producer_key_path, password ) ?;
232233
233234 if let Some ( pub_key) = self . coinbase_receiver {
234235 node_builder
0 commit comments