mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-14 09:08:11 +00:00
Fixed tuple const valtype& crash issues.
This commit is contained in:
parent
ff4cda4884
commit
83f7bd5071
@ -227,6 +227,8 @@ CKevaCache::remove(const valtype& nameSpace, const valtype& key)
|
||||
if (ei != entries.end ())
|
||||
entries.erase (ei);
|
||||
|
||||
//JWU TODO: make sure to remove namespace registration when
|
||||
// the corresponding block is disconnected!!!
|
||||
#if 0
|
||||
deleted.insert(name);
|
||||
#endif
|
||||
|
@ -287,8 +287,8 @@ private:
|
||||
class NameComparator
|
||||
{
|
||||
public:
|
||||
inline bool operator() (const std::tuple<const valtype&, const valtype&> a,
|
||||
const std::tuple<const valtype&, const valtype&> b) const
|
||||
inline bool operator() (const std::tuple<valtype, valtype> a,
|
||||
const std::tuple<valtype, valtype> b) const
|
||||
{
|
||||
unsigned int aSize = std::get<0>(a).size() + std::get<1>(a).size();
|
||||
unsigned int bSize = std::get<0>(b).size() + std::get<1>(b).size();
|
||||
@ -378,7 +378,7 @@ public:
|
||||
* Type of name entry map. This is public because it is also used
|
||||
* by the unit tests.
|
||||
*/
|
||||
typedef std::map<std::tuple<const valtype&, const valtype&>, CKevaData, NameComparator> EntryMap;
|
||||
typedef std::map<std::tuple<valtype, valtype>, CKevaData, NameComparator> EntryMap;
|
||||
typedef std::set<valtype> NamespaceSet;
|
||||
|
||||
private:
|
||||
|
@ -143,7 +143,7 @@ CKevaMemPool::check(const CCoinsView& coins) const
|
||||
nHeight = mapBlockIndex.find (blockHash)->second->nHeight;
|
||||
|
||||
std::set<valtype> nameRegs;
|
||||
std::set<std::tuple<const valtype&, const valtype&>> namespaceKeyUpdates;
|
||||
std::set<std::tuple<valtype, valtype>> namespaceKeyUpdates;
|
||||
for (const auto& entry : pool.mapTx) {
|
||||
const uint256 txHash = entry.GetTx ().GetHash ();
|
||||
if (entry.isNamespaceRegistration()) {
|
||||
@ -168,7 +168,7 @@ CKevaMemPool::check(const CCoinsView& coins) const
|
||||
if (entry.isNamespaceKeyUpdate()) {
|
||||
const valtype& nameSpace = entry.getNamespace();
|
||||
const valtype& key = entry.getKey();
|
||||
std::tuple<const valtype&, const valtype&> tuple(nameSpace, key);
|
||||
std::tuple<valtype, valtype> tuple(nameSpace, key);
|
||||
const NamespaceKeyTxMap::const_iterator mit = mapNamespaceKeyUpdates.find(tuple);
|
||||
assert (mit != mapNamespaceKeyUpdates.end ());
|
||||
assert (mit->second == txHash);
|
||||
|
Loading…
Reference in New Issue
Block a user