@@ -6,6 +6,8 @@ use mutiny_core::bitcoin::Network;
66use mutiny_core:: lnurlauth:: AuthManager ;
77use mutiny_core:: logging:: MutinyLogger ;
88use mutiny_core:: vss:: MutinyVssClient ;
9+ use std:: io:: Write ;
10+ use std:: str:: FromStr ;
911use std:: sync:: Arc ;
1012
1113mod config;
@@ -14,8 +16,23 @@ mod config;
1416async fn main ( ) -> anyhow:: Result < ( ) > {
1517 let logger = Arc :: new ( MutinyLogger :: default ( ) ) ;
1618 let config: Config = Config :: parse ( ) ;
17- let seed = config. seed . to_seed ( "" ) ;
18- let xprivkey = ExtendedPrivKey :: new_master ( Network :: Bitcoin , & seed) . unwrap ( ) ;
19+
20+ // Create a mutable string to store the user input
21+ let mut input = String :: new ( ) ;
22+
23+ // Prompt the user for input
24+ print ! ( "Enter your mnemonic seed: " ) ;
25+ // Flush stdout to ensure the prompt is displayed before input is read
26+ std:: io:: stdout ( ) . flush ( ) ?;
27+
28+ // Read the input from stdin and handle potential errors
29+ std:: io:: stdin ( )
30+ . read_line ( & mut input)
31+ . expect ( "Failed to read line" ) ;
32+
33+ let seed = bip39:: Mnemonic :: from_str ( input. trim ( ) ) ?;
34+
35+ let xprivkey = ExtendedPrivKey :: new_master ( Network :: Bitcoin , & seed. to_seed ( "" ) ) . unwrap ( ) ;
1936
2037 let auth_manager = AuthManager :: new ( xprivkey) . unwrap ( ) ;
2138
@@ -67,7 +84,7 @@ async fn main() -> anyhow::Result<()> {
6784 // put the new objects back
6885 vss. put_objects ( new_objects) . await ?;
6986
70- println ! ( "Done ! Open Mutiny Wallet and your channels should force close." ) ;
87+ println ! ( "\n Done ! Open Mutiny Wallet and your channels should force close and be recoverable on-chain in 3-14 days ." ) ;
7188
7289 Ok ( ( ) )
7390}
0 commit comments