File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -74,23 +74,14 @@ impl MasterAccount {
7474 network : Network ,
7575 passphrase : & str ,
7676 ) -> Result < MasterAccount , Error > {
77- let context = SecpContext :: new ( ) ;
7877 let mut random = vec ! [ 0u8 ; entropy as usize ] ;
7978 thread_rng ( ) . fill_bytes ( random. as_mut_slice ( ) ) ;
8079 let seed = Seed ( random) ;
81- let encrypted = seed. encrypt ( passphrase) ?;
82- let master_key = context. master_private_key ( network, & seed) ?;
83- let public_master_key = context. extended_public_from_private ( & master_key) ;
8480 let now = SystemTime :: now ( )
8581 . duration_since ( UNIX_EPOCH )
8682 . unwrap ( )
8783 . as_secs ( ) ;
88- Ok ( MasterAccount {
89- master_public : public_master_key,
90- encrypted,
91- accounts : HashMap :: new ( ) ,
92- birth : now,
93- } )
84+ Self :: from_seed ( & seed, now, network, passphrase)
9485 }
9586
9687 /// Restore from encrypted store
You can’t perform that action at this time.
0 commit comments