CTxMemPool: add helper methods, to reduce global mempool.mapTx accesses
This commit is contained in:
10
src/main.h
10
src/main.h
@@ -1621,6 +1621,16 @@ public:
|
||||
LOCK(cs);
|
||||
return mapTx.size();
|
||||
}
|
||||
|
||||
bool exists(uint256 hash)
|
||||
{
|
||||
return (mapTx.count(hash) != 0);
|
||||
}
|
||||
|
||||
CTransaction& lookup(uint256 hash)
|
||||
{
|
||||
return mapTx[hash];
|
||||
}
|
||||
};
|
||||
|
||||
extern CTxMemPool mempool;
|
||||
|
||||
Reference in New Issue
Block a user