wallet: Comment out HDSeed and CHDChain persistence to disk

Sapling keys generated from the seed are not yet persisted, so we don't
want to persist the seed or chain state either, otherwise the wallet
could end up in an inconsistent state.

Some tests are temporarily disabled because commenting out HDSeed
persistence breaks invariants inside CCryptoKeyStore.

Revert this commit during the PR for #3388.
This commit is contained in:
Jack Grigg
2018-08-29 00:42:19 +01:00
parent c58dae6cda
commit b7f9a7ae02
4 changed files with 12 additions and 2 deletions

View File

@@ -1925,12 +1925,14 @@ bool CWallet::SetHDSeed(const HDSeed& seed)
return true;
}
/* TODO: Uncomment during PR for #3388
{
LOCK(cs_wallet);
if (!IsCrypted()) {
return CWalletDB(strWalletFile).WriteHDSeed(seed);
}
}
*/
return true;
}
@@ -1944,6 +1946,7 @@ bool CWallet::SetCryptedHDSeed(const uint256& seedFp, const std::vector<unsigned
return true;
}
/* TODO: Uncomment during PR for #3388
{
LOCK(cs_wallet);
if (pwalletdbEncryption)
@@ -1951,14 +1954,17 @@ bool CWallet::SetCryptedHDSeed(const uint256& seedFp, const std::vector<unsigned
else
return CWalletDB(strWalletFile).WriteCryptedHDSeed(seedFp, vchCryptedSecret);
}
*/
return false;
}
void CWallet::SetHDChain(const CHDChain& chain, bool memonly)
{
LOCK(cs_wallet);
/* TODO: Uncomment during PR for #3388
if (!memonly && fFileBacked && !CWalletDB(strWalletFile).WriteHDChain(chain))
throw std::runtime_error(std::string(__func__) + ": writing chain failed");
*/
hdChain = chain;
}