MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ProcessNewPackage

Function ProcessNewPackage

src/validation.cpp:1813–1831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1811}
1812
1813PackageMempoolAcceptResult ProcessNewPackage(Chainstate& active_chainstate, CTxMemPool& pool,
1814 const Package& package, bool test_accept, const std::optional<CFeeRate>& client_maxfeerate)
1815{
1816 AssertLockHeld(cs_main);
1817 assert(!package.empty());
1818 assert(std::all_of(package.cbegin(), package.cend(), [](const auto& tx){return tx != nullptr;}));
1819
1820 std::vector<COutPoint> coins_to_uncache;
1821 const CChainParams& chainparams = active_chainstate.m_chainman.GetParams();
1822 auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
1823 AssertLockHeld(cs_main);
1824 if (test_accept) {
1825 auto args = MemPoolAccept::ATMPArgs::PackageTestAccept(chainparams, GetTime(), coins_to_uncache);
1826 return MemPoolAccept(pool, active_chainstate).AcceptMultipleTransactionsAndCleanup(package, args);
1827 } else {
1828 auto args = MemPoolAccept::ATMPArgs::PackageChildWithParents(chainparams, GetTime(), coins_to_uncache, client_maxfeerate);
1829 return MemPoolAccept(pool, active_chainstate).AcceptPackage(package, args);
1830 }
1831 }();
1832
1833 // Uncache coins pertaining to transactions that were not submitted to the mempool.
1834 if (test_accept || result.m_state.IsInvalid()) {

Callers 6

ProcessMessageMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
package_eval.cppFile · 0.85
tx_pool.cppFile · 0.85
testmempoolacceptFunction · 0.85
submitpackageFunction · 0.85

Calls 7

MemPoolAcceptClass · 0.85
AcceptPackageMethod · 0.80
EXCLUSIVE_LOCKS_REQUIREDFunction · 0.70
GetTimeFunction · 0.50
emptyMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68