mimblewimble / grin-gui

GUI for Grin Node + Wallet
GNU General Public License v3.0
20 stars 21 forks source link

Wallet creation failed #34

Closed flomang closed 1 year ago

flomang commented 1 year ago

Creating any new wallets at the moment results in a lifecycle error.

flomang commented 1 year ago

Well, it seems the to_mnemonic function of WalletSeed (grin-wallet - src/lifecycle/seed.rs) is throwing the error because the vec in WalletSeed is empty sometimes. I must be in some strange condition as I can generate a testnet wallet successfully but generating a mainnet wallet seems to result in the wallet seed never populating.

Further investigation reveals that the seed decrypt function is popping the encrypted_seed in the final loop causing the vec to be empty in the WalletSeed::from_bytes(...) call.

I see it now. what should the recovery_phrase be defaulted to. I think I had 32 before. Seems the seed_length was being sent in as 0 for mainnet but the logic is different for testnet init_new of seed.rs.