Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

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

* Update MainService.cs
  • Loading branch information
shargon committed Jun 18, 2020
1 parent ba5e3ea commit 3c3409c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions neo-cli/CLI/MainService.cs
Expand Up @@ -318,15 +318,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 3c3409c

Please sign in to comment.