mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-14 09:08:11 +00:00
Removed confirmed/conflicted namespaces and keys.
This commit is contained in:
parent
126f160722
commit
2e6a3dbec7
@ -59,7 +59,6 @@ CKevaMemPool::addUnchecked (const uint256& hash, const CTxMemPoolEntry& entry)
|
|||||||
if (entry.isNamespaceKeyUpdate ()) {
|
if (entry.isNamespaceKeyUpdate ()) {
|
||||||
const valtype& nameSpace = entry.getNamespace();
|
const valtype& nameSpace = entry.getNamespace();
|
||||||
assert(mapNamespaceUpdates.count(nameSpace) == 0);
|
assert(mapNamespaceUpdates.count(nameSpace) == 0);
|
||||||
std::string(nameSpace.begin(), nameSpace.end()).c_str(), std::string(entry.getKey().begin(), entry.getKey().end()).c_str());
|
|
||||||
mapNamespaceUpdates.insert (std::make_pair(nameSpace, hash));
|
mapNamespaceUpdates.insert (std::make_pair(nameSpace, hash));
|
||||||
listUnconfirmedKeyValues.push_back(std::make_tuple(hash, nameSpace, entry.getKey(), entry.getValue()));
|
listUnconfirmedKeyValues.push_back(std::make_tuple(hash, nameSpace, entry.getKey(), entry.getValue()));
|
||||||
}
|
}
|
||||||
@ -98,18 +97,34 @@ void CKevaMemPool::remove(const CTxMemPoolEntry& entry)
|
|||||||
const NamespaceTxMap::iterator mit = mapNamespaceRegs.find(entry.getNamespace());
|
const NamespaceTxMap::iterator mit = mapNamespaceRegs.find(entry.getNamespace());
|
||||||
assert (mit != mapNamespaceRegs.end());
|
assert (mit != mapNamespaceRegs.end());
|
||||||
mapNamespaceRegs.erase(mit);
|
mapNamespaceRegs.erase(mit);
|
||||||
|
auto hash = entry.GetTx().GetHash();
|
||||||
|
for (auto iter = listUnconfirmedNamespaces.begin(); iter != listUnconfirmedNamespaces.end(); ++iter) {
|
||||||
|
if (std::get<0>(*iter) == hash) {
|
||||||
|
listUnconfirmedNamespaces.erase(iter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.isNamespaceKeyUpdate()) {
|
if (entry.isNamespaceKeyUpdate()) {
|
||||||
const NamespaceTxMap::iterator mit = mapNamespaceUpdates.find(entry.getNamespace());
|
const NamespaceTxMap::iterator mit = mapNamespaceUpdates.find(entry.getNamespace());
|
||||||
assert (mit != mapNamespaceUpdates.end());
|
assert (mit != mapNamespaceUpdates.end());
|
||||||
mapNamespaceUpdates.erase(mit);
|
mapNamespaceUpdates.erase(mit);
|
||||||
|
auto hash = entry.GetTx().GetHash();
|
||||||
|
for (auto iter = listUnconfirmedKeyValues.begin(); iter != listUnconfirmedKeyValues.end(); ++iter) {
|
||||||
|
if (std::get<0>(*iter) == hash) {
|
||||||
|
listUnconfirmedKeyValues.erase(iter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CKevaMemPool::removeConflicts(const CTransaction& tx)
|
CKevaMemPool::removeConflicts(const CTransaction& tx)
|
||||||
{
|
{
|
||||||
|
// JWU TODO: is this required at all?
|
||||||
|
#if 0
|
||||||
AssertLockHeld (pool.cs);
|
AssertLockHeld (pool.cs);
|
||||||
|
|
||||||
if (!tx.IsKevacoin ())
|
if (!tx.IsKevacoin ())
|
||||||
@ -128,6 +143,7 @@ CKevaMemPool::removeConflicts(const CTransaction& tx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -573,7 +573,7 @@ void CTxMemPool::removeConflicts(const CTransaction &tx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove conflicting keva registrations. */
|
/* Remove conflicting keva registrations. */
|
||||||
kevaMemPool.removeConflicts (tx);
|
kevaMemPool.removeConflicts(tx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user