Skip to content

Commit

Permalink
Merge pull request #7 from neo-project/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
ProDog authored May 7, 2020
2 parents 7c37012 + abc9f2d commit 179ef16
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions neo-cli/CLI/MainService.Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,25 @@ private void OnChangePasswordCommand()
return;
}

if (CurrentWallet is NEP6Wallet wallet)
{
string backupFile = wallet.Path + ".bak";
if (!File.Exists(wallet.Path) || File.Exists(backupFile))
{
Console.WriteLine("Wallet backup fail");
return;
}
try
{
File.Copy(wallet.Path, backupFile);
}
catch (IOException)
{
Console.WriteLine("Wallet backup fail");
return;
}
}

bool succeed = CurrentWallet.ChangePassword(oldPassword, newPassword);
if (succeed)
{
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/neo-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Neo" Version="3.0.0-CI00906" />
<PackageReference Include="Neo" Version="3.0.0-CI00907" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 179ef16

Please sign in to comment.