Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make NEP6Wallet.path public #1627

Merged
merged 7 commits into from
May 6, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/neo/Wallets/NEP6/NEP6Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,22 @@ public void Save()
File.WriteAllText(path, wallet.ToString());
}

public bool Backup()
{
string backup = path + ".bak";
if (!File.Exists(path) || File.Exists(backup))
return false;
try
{
File.Copy(path, backup);
}
catch (IOException)
{
return false;
}
return true;
}

public IDisposable Unlock(string password)
{
if (!VerifyPassword(password))
Expand Down