diff options
author | glozow <gloriajzhao@gmail.com> | 2021-09-29 19:36:01 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-10-04 15:00:28 +0100 |
commit | 082c5bf099c64e3d27abe9b68a71ce500b693e7e (patch) | |
tree | de3cef3823de0046834bbf621ba3a32e2b09042d /src/net_processing.cpp | |
parent | ed6115f1eae0eb4669601106a9aaff078a2f3a74 (diff) | |
download | bitcoin-082c5bf099c64e3d27abe9b68a71ce500b693e7e.tar.xz |
[refactor] pass coinsview and height to check()
Removes check's dependency on validation.h
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 008b4d679c..12c4eece56 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2298,7 +2298,8 @@ void PeerManagerImpl::ProcessOrphanTx(std::set<uint256>& orphan_work_set) break; } } - m_mempool.check(m_chainman.ActiveChainstate()); + CChainState& active_chainstate = m_chainman.ActiveChainstate(); + m_mempool.check(active_chainstate.CoinsTip(), active_chainstate.m_chain.Height() + 1); } bool PeerManagerImpl::PrepareBlockFilterRequest(CNode& peer, @@ -3260,7 +3261,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, const TxValidationState& state = result.m_state; if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) { - m_mempool.check(m_chainman.ActiveChainstate()); + CChainState& active_chainstate = m_chainman.ActiveChainstate(); + m_mempool.check(active_chainstate.CoinsTip(), active_chainstate.m_chain.Height() + 1); // As this version of the transaction was acceptable, we can forget about any // requests for it. m_txrequest.ForgetTxHash(tx.GetHash()); |