Renaming SetSerial to SetNullifier.
This commit is contained in:
parent
616f8d05af
commit
d90e46ba8d
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue