Replace vAnchorCache with a cache size counter

The anchor is obtained from the returned witnesses; since all witnesses are to
the same point (the latest blockchain tip), they all have the same root.
This commit is contained in:
Jack Grigg
2016-08-31 14:13:28 +12:00
parent 3fac1020e7
commit 4086e5ce98
5 changed files with 27 additions and 21 deletions

View File

@@ -162,10 +162,10 @@ bool CWalletDB::WriteDefaultKey(const CPubKey& vchPubKey)
return Write(std::string("defaultkey"), vchPubKey);
}
bool CWalletDB::WriteAnchorCache(const std::list<uint256>& vAnchorCache)
bool CWalletDB::WriteWitnessCacheSize(int64_t nWitnessCacheSize)
{
nWalletDBUpdated++;
return Write(std::string("anchorcache"), vAnchorCache);
return Write(std::string("witnesscachesize"), nWitnessCacheSize);
}
bool CWalletDB::ReadPool(int64_t nPool, CKeyPool& keypool)
@@ -637,9 +637,9 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
return false;
}
}
else if (strType == "anchorcache")
else if (strType == "witnesscachesize")
{
ssValue >> pwallet->vAnchorCache;
ssValue >> pwallet->nWitnessCacheSize;
}
} catch (...)
{