Renaming SetSerial to SetNullifier.

This commit is contained in:
Sean Bowe 2016-07-14 15:51:53 -06:00
parent 616f8d05af
commit d90e46ba8d
4 changed files with 6 additions and 6 deletions

View File

@ -185,7 +185,7 @@ void CCoinsViewCache::PopAnchor(const uint256 &newrt) {
}
}
void CCoinsViewCache::SetSerial(const uint256 &serial, bool spent) {
void CCoinsViewCache::SetNullifier(const uint256 &serial, bool spent) {
std::pair<CSerialsMap::iterator, bool> ret = cacheSerials.insert(std::make_pair(serial, CSerialsCacheEntry()));
ret.first->second.entered = spent;
ret.first->second.flags |= CSerialsCacheEntry::DIRTY;

View File

@ -473,7 +473,7 @@ public:
void PopAnchor(const uint256 &rt);
// Marks a serial as spent or not.
void SetSerial(const uint256 &serial, bool spent);
void SetNullifier(const uint256 &serial, bool spent);
/**
* Return a pointer to CCoins in the cache, or NULL if not found. This is

View File

@ -1588,7 +1588,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
// spend nullifiers
BOOST_FOREACH(const JSDescription &pour, tx.vjoinsplit) {
BOOST_FOREACH(const uint256 &serial, pour.nullifiers) {
inputs.SetSerial(serial, true);
inputs.SetNullifier(serial, true);
}
}
@ -1910,7 +1910,7 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
// unspend nullifiers
BOOST_FOREACH(const JSDescription &pour, tx.vjoinsplit) {
BOOST_FOREACH(const uint256 &serial, pour.nullifiers) {
view.SetSerial(serial, false);
view.SetNullifier(serial, false);
}
}

View File

@ -171,14 +171,14 @@ BOOST_AUTO_TEST_CASE(serials_test)
uint256 myserial = GetRandHash();
BOOST_CHECK(!cache.GetNullifier(myserial));
cache.SetSerial(myserial, true);
cache.SetNullifier(myserial, true);
BOOST_CHECK(cache.GetNullifier(myserial));
cache.Flush();
CCoinsViewCacheTest cache2(&base);
BOOST_CHECK(cache2.GetNullifier(myserial));
cache2.SetSerial(myserial, false);
cache2.SetNullifier(myserial, false);
BOOST_CHECK(!cache2.GetNullifier(myserial));
cache2.Flush();