WalletWasabi: Error recovering wallet implies wallet already exists, even after deleting
General Description
I added a wallet with the wrong key path so I closed Wasabi, deleted the wallet json, and tried adding it again with the correct key path. However, I got this error: An item with the same key has already been added.
Well, that’s weird. Maybe there’s some state about the wallet floating around outside the wallet file? I thought I could just rm -rf ~/.walletwasabi
and it would work. Wrong! Even after deleting ~/.walletwasabi
and even, for good measure, removing Wasabi.app and ~/Library/Saved Application State/zksnacks.wasabiwallet.savedStat
, I still get the same error.
This two me means there are two problems:
- There’s mysterious wallet-related state hiding somewhere outside of the wallet json that makes it very confusing and difficult to delete a wallet. I’m fine with this feature not being in the UI, but I’d like to at least be able to do it manually. From what I’ve read on Reddit, most people say you can just delete the JSON and it’s fine. This does indeed remove the wallet from the UI but no one seems to have tried to add it again.
- There’s no obvious way to completely uninstall Wasabi. There’s Wasabi stuff hiding somewhere on my machine even after I’ve closed it and deleted any files that
sudo find / -iname "*wasabi*"
shows me. This is a fairly fresh install so there’s not a lot of cruft and it doesn’t take me long to search my entire drive.
Am I making an obvious mistake here? Any suggestions on how Wasabi still seems to know I’ve added the wallet before, even after blowing away ~/.walletwasabi
?
How To Reproduce?
- Add a wallet
- Close Wasabi
- Delete the wallet json
- Open wasabi
- Try to add the wallet again
Screenshots
N/A
Operating System
MacOS
Logs
2021-04-02 20:40:58 ERROR RecoverWalletViewModel (105) System.ArgumentException: An item with the same key has already been added. Key: 0 <snip!>
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at WalletWasabi.Blockchain.Keys.KeyManager.GenerateNewKey(SmartLabel label, KeyState keyState, Boolean isInternal, Boolean toFile)
at WalletWasabi.Blockchain.Keys.KeyManager.AssertCleanKeysIndexed(Nullable`1 isInternal)
at WalletWasabi.Wallets.Wallet..ctor(String dataDir, Network network, KeyManager keyManager)
at WalletWasabi.Wallets.WalletManager.AddWallet(KeyManager keyManager)
at WalletWasabi.Gui.Tabs.WalletManager.RecoverWallets.RecoverWalletViewModel.RecoverWallet(WalletManagerViewModel owner)
Wasabi Version
1.1.12.8
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17
Thanks @lontivero. The error message really threw me for a loop.
@CalebFenton that’s not a valid account key path. The account key path is
m/49'/0'/0'
however take into account that Wasabi will try to derive p2wkh scripts and i don’t know how Mycelium generates the scrips.@molnard this problem was already fixed here https://github.com/zkSNACKs/WalletWasabi/pull/4070 but it seems it was not backported.