wallet: Don't allow an HDSeed to be overwritten

We can maybe relax this restriction later once we have worked out the UX
implications.
This commit is contained in:
Jack Grigg
2018-09-03 10:45:17 +01:00
parent 4c1a26fb60
commit b33a7ec46e
3 changed files with 32 additions and 19 deletions

View File

@@ -26,6 +26,11 @@ bool CKeyStore::AddKey(const CKey &key) {
bool CBasicKeyStore::SetHDSeed(const HDSeed& seed)
{
LOCK(cs_SpendingKeyStore);
if (!hdSeed.IsNull()) {
// Don't allow an existing seed to be changed. We can maybe relax this
// restriction later once we have worked out the UX implications.
return false;
}
hdSeed = seed;
return true;
}