aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-10-30 13:10:02 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-10-30 14:27:31 +0100
commitd314e8a818d4c162b1c7201533e6b600dcab2d91 (patch)
treeead168b71776df14aa263bb28bb5678eaf9c0646 /src/txmempool.cpp
parentecad0a8019fb9e8503ec92b6057a5e649866e25e (diff)
downloadbitcoin-d314e8a818d4c162b1c7201533e6b600dcab2d91.tar.xz
refactor: Replace all uses of boost::optional with our own Optional type
After this: - `boost::optional` is no longer used directly (only through `Optional` which is an alias for it) - `boost/optional.hpp` is only included in one place
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index e4c1fd4bc6..77353f5f05 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -8,6 +8,7 @@
#include <consensus/consensus.h>
#include <consensus/tx_verify.h>
#include <consensus/validation.h>
+#include <optional.h>
#include <validation.h>
#include <policy/policy.h>
#include <policy/fees.h>
@@ -155,7 +156,7 @@ bool CTxMemPool::CalculateMemPoolAncestors(const CTxMemPoolEntry &entry, setEntr
// GetMemPoolParents() is only valid for entries in the mempool, so we
// iterate mapTx to find parents.
for (unsigned int i = 0; i < tx.vin.size(); i++) {
- boost::optional<txiter> piter = GetIter(tx.vin[i].prevout.hash);
+ Optional<txiter> piter = GetIter(tx.vin[i].prevout.hash);
if (piter) {
parentHashes.insert(*piter);
if (parentHashes.size() + 1 > limitAncestorCount) {
@@ -860,11 +861,11 @@ const CTransaction* CTxMemPool::GetConflictTx(const COutPoint& prevout) const
return it == mapNextTx.end() ? nullptr : it->second;
}
-boost::optional<CTxMemPool::txiter> CTxMemPool::GetIter(const uint256& txid) const
+Optional<CTxMemPool::txiter> CTxMemPool::GetIter(const uint256& txid) const
{
auto it = mapTx.find(txid);
if (it != mapTx.end()) return it;
- return boost::optional<txiter>{};
+ return Optional<txiter>{};
}
CTxMemPool::setEntries CTxMemPool::GetIterSet(const std::set<uint256>& hashes) const