mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-02-04 19:24:20 +00:00
Stored the latest tx output in namespace data.
This commit is contained in:
parent
1a4f002243
commit
c72450e983
@ -200,9 +200,9 @@ CNameIterator* CCoinsViewCache::IterateNames() const {
|
||||
name history. */
|
||||
void CCoinsViewCache::SetName(const valtype &nameSpace, const valtype &key, const CKevaData& data, bool undo)
|
||||
{
|
||||
#if 0
|
||||
CKevaData oldData;
|
||||
if (GetName(nameSpace, key, oldData)) {
|
||||
#if 0
|
||||
cacheNames.removeExpireIndex(name, oldData.getHeight());
|
||||
|
||||
/* Update the name history. If we are undoing, we expect that
|
||||
@ -228,11 +228,15 @@ void CCoinsViewCache::SetName(const valtype &nameSpace, const valtype &key, cons
|
||||
|
||||
cacheNames.setHistory(name, history);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
assert (!undo);
|
||||
}
|
||||
|
||||
#endif
|
||||
CKevaData namespaceData;
|
||||
if (GetNamespace(nameSpace, namespaceData)) {
|
||||
namespaceData.setUpdateOutpoint(data.getUpdateOutpoint());
|
||||
cacheNames.setNamespace(nameSpace, namespaceData);
|
||||
}
|
||||
cacheNames.set(nameSpace, key, data);
|
||||
#if 0
|
||||
cacheNames.addExpireIndex(name, data.getHeight());
|
||||
|
@ -200,6 +200,12 @@ CKevaCache::GetNamespace(const valtype& nameSpace, CKevaData& data) const
|
||||
return get(nameSpace, ValtypeFromString(CKevaScript::KEVA_DISPLAY_NAME_KEY), data);
|
||||
}
|
||||
|
||||
void
|
||||
CKevaCache::setNamespace(const valtype& nameSpace, const CKevaData& data)
|
||||
{
|
||||
set(nameSpace, ValtypeFromString(CKevaScript::KEVA_DISPLAY_NAME_KEY), data);
|
||||
}
|
||||
|
||||
void
|
||||
CKevaCache::set(const valtype& nameSpace, const valtype& key, const CKevaData& data)
|
||||
{
|
||||
|
@ -130,6 +130,15 @@ public:
|
||||
return prevout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the namespace's updated outpoint.
|
||||
*/
|
||||
inline void
|
||||
setUpdateOutpoint (const COutPoint& out)
|
||||
{
|
||||
prevout = out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address.
|
||||
* @return The name's address.
|
||||
@ -458,6 +467,8 @@ public:
|
||||
removes the "deleted" mark. */
|
||||
void set(const valtype& nameSpace, const valtype& key, const CKevaData& data);
|
||||
|
||||
void setNamespace(const valtype& nameSpace, const CKevaData& data);
|
||||
|
||||
/* Delete a name. If it is in the "entries" set also, remove it there. */
|
||||
void remove(const valtype& nameSpace, const valtype& key);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user