Store HDSeed in CBasicKeyStore

This commit is contained in:
Jack Grigg
2018-08-03 16:51:01 +01:00
parent 7614198f9d
commit 70c8c25e4b
3 changed files with 64 additions and 0 deletions

View File

@@ -23,6 +23,30 @@ bool CKeyStore::AddKey(const CKey &key) {
return AddKeyPubKey(key, key.GetPubKey());
}
bool CBasicKeyStore::SetHDSeed(const HDSeed& seed)
{
LOCK(cs_SpendingKeyStore);
hdSeed = seed;
return true;
}
bool CBasicKeyStore::HaveHDSeed() const
{
LOCK(cs_SpendingKeyStore);
return !hdSeed.IsNull();
}
bool CBasicKeyStore::GetHDSeed(HDSeed& seedOut) const
{
LOCK(cs_SpendingKeyStore);
if (hdSeed.IsNull()) {
return false;
} else {
seedOut = hdSeed;
return true;
}
}
bool CBasicKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey)
{
LOCK(cs_KeyStore);