@@ -6,6 +6,8 @@ use mutiny_core::bitcoin::Network;
6
6
use mutiny_core:: lnurlauth:: AuthManager ;
7
7
use mutiny_core:: logging:: MutinyLogger ;
8
8
use mutiny_core:: vss:: MutinyVssClient ;
9
+ use std:: io:: Write ;
10
+ use std:: str:: FromStr ;
9
11
use std:: sync:: Arc ;
10
12
11
13
mod config;
@@ -14,8 +16,23 @@ mod config;
14
16
async fn main ( ) -> anyhow:: Result < ( ) > {
15
17
let logger = Arc :: new ( MutinyLogger :: default ( ) ) ;
16
18
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 ( ) ;
19
36
20
37
let auth_manager = AuthManager :: new ( xprivkey) . unwrap ( ) ;
21
38
@@ -67,7 +84,7 @@ async fn main() -> anyhow::Result<()> {
67
84
// put the new objects back
68
85
vss. put_objects ( new_objects) . await ?;
69
86
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 ." ) ;
71
88
72
89
Ok ( ( ) )
73
90
}
0 commit comments