diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-03-05 09:19:21 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-03-05 09:20:00 -0500 |
commit | d8a62db8bf68896397f175e1d7d52b7be5021985 (patch) | |
tree | 99526047ffe8c1d2d405284124eb6a4e00385c6e /src/interfaces/chain.cpp | |
parent | a74d588f2154cf75e56319786281d00dacbb61a7 (diff) | |
parent | 4d4e4c644826db03317d69a04fea03309c3ebabf (diff) | |
download | bitcoin-d8a62db8bf68896397f175e1d7d52b7be5021985.tar.xz |
Merge #15531: Suggested interfaces::Chain cleanups from #15288
4d4e4c6448 Suggested interfaces::Chain cleanups from #15288 (Russell Yanofsky)
Pull request description:
Mostly documentation improvements requested in the last review of #15288 before it was merged (https://github.com/bitcoin/bitcoin/pull/15288#pullrequestreview-210241864)
Tree-SHA512: 64e912520bbec20a44032f265a8cf3f11ad7f5126c8626b5ad5e888227b1f92ecb321522fab4bbbd613230b55450abd6ace023631d0a4f357a780d65c5638bfe
Diffstat (limited to 'src/interfaces/chain.cpp')
-rw-r--r-- | src/interfaces/chain.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index fb634e73da..2eecea28d0 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -148,7 +148,7 @@ class LockImpl : public Chain::Lock LockAnnotation lock(::cs_main); return CheckFinalTx(tx); } - bool submitToMemoryPool(CTransactionRef tx, CAmount absurd_fee, CValidationState& state) override + bool submitToMemoryPool(const CTransactionRef& tx, CAmount absurd_fee, CValidationState& state) override { LockAnnotation lock(::cs_main); return AcceptToMemoryPool(::mempool, state, tx, nullptr /* missing inputs */, nullptr /* txn replaced */, @@ -207,8 +207,8 @@ public: bool hasDescendantsInMempool(const uint256& txid) override { LOCK(::mempool.cs); - auto it_mp = ::mempool.mapTx.find(txid); - return it_mp != ::mempool.mapTx.end() && it_mp->GetCountWithDescendants() > 1; + auto it = ::mempool.GetIter(txid); + return it && (*it)->GetCountWithDescendants() > 1; } void relayTransaction(const uint256& txid) override { @@ -219,7 +219,7 @@ public: { ::mempool.GetTransactionAncestry(txid, ancestors, descendants); } - bool checkChainLimits(CTransactionRef tx) override + bool checkChainLimits(const CTransactionRef& tx) override { LockPoints lp; CTxMemPoolEntry entry(tx, 0, 0, 0, false, 0, lp); |