CTxMemPool: add helper methods, to reduce global mempool.mapTx accesses
[novacoin.git] / src / main.h
index 29bd358..30bf1dd 100644 (file)
@@ -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;