aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-07-22 19:11:42 -0700
committerPieter Wuille <pieter@wuille.net>2020-07-30 13:45:03 -0700
commit10b7a6d532148f880568c529e61a6d7edc7c91a9 (patch)
tree92594d393f9231d738fdf8c0e1c98071eb6a3831 /src/txmempool.h
parent5c124e17407a5b5824fec062b73a03a1030fa28c (diff)
downloadbitcoin-10b7a6d532148f880568c529e61a6d7edc7c91a9.tar.xz
refactor: make txmempool interface use GenTxid
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index d4e9845942..4743e1b63a 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -716,14 +716,15 @@ public:
return totalTxSize;
}
- bool exists(const uint256& hash, bool wtxid=false) const
+ bool exists(const GenTxid& gtxid) const
{
LOCK(cs);
- if (wtxid) {
- return (mapTx.get<index_by_wtxid>().count(hash) != 0);
+ if (gtxid.IsWtxid()) {
+ return (mapTx.get<index_by_wtxid>().count(gtxid.GetHash()) != 0);
}
- return (mapTx.count(hash) != 0);
+ return (mapTx.count(gtxid.GetHash()) != 0);
}
+ bool exists(const uint256& txid) const { return exists(GenTxid{false, txid}); }
CTransactionRef get(const uint256& hash) const;
txiter get_iter_from_wtxid(const uint256& wtxid) const EXCLUSIVE_LOCKS_REQUIRED(cs)
@@ -731,7 +732,8 @@ public:
AssertLockHeld(cs);
return mapTx.project<0>(mapTx.get<index_by_wtxid>().find(wtxid));
}
- TxMempoolInfo info(const uint256& hash, bool wtxid=false) const;
+ TxMempoolInfo info(const uint256& hash) const;
+ TxMempoolInfo info(const GenTxid& gtxid) const;
std::vector<TxMempoolInfo> infoAll() const;
size_t DynamicMemoryUsage() const;