Skip to content

Commit

Permalink
Ensure json extension in wallet (neo-project#608)
Browse files Browse the repository at this point in the history
* Update MainService.cs

* Update MainService.cs
  • Loading branch information
shargon authored and ProDog committed Jul 9, 2020
1 parent b4b0e53 commit 92c09b8
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions neo-cli/CLI/MainService.cs
Expand Up @@ -320,15 +320,21 @@ public void OpenWallet(string path, string password)
throw new FileNotFoundException();
}

if (Path.GetExtension(path) == ".db3")
switch (Path.GetExtension(path).ToLowerInvariant())
{
CurrentWallet = UserWallet.Open(path, password);
}
else
{
NEP6Wallet nep6wallet = new NEP6Wallet(path);
nep6wallet.Unlock(password);
CurrentWallet = nep6wallet;
case ".db3":
{
CurrentWallet = UserWallet.Open(path, password);
break;
}
case ".json":
{
NEP6Wallet nep6wallet = new NEP6Wallet(path);
nep6wallet.Unlock(password);
CurrentWallet = nep6wallet;
break;
}
default: throw new NotSupportedException();
}
}

Expand Down

0 comments on commit 92c09b8

Please sign in to comment.