MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / ProcessNewPackage

Function ProcessNewPackage

src/validation.cpp:1447–1472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1445}
1446
1447PackageMempoolAcceptResult ProcessNewPackage(Chainstate &active_chainstate,
1448 CTxMemPool &pool,
1449 const Package &package,
1450 bool test_accept) {
1451 AssertLockHeld(cs_main);
1452 assert(!package.empty());
1453 assert(std::all_of(package.cbegin(), package.cend(),
1454 [](const auto &tx) { return tx != nullptr; }));
1455
1456 const Config &config = active_chainstate.m_chainman.GetConfig();
1457
1458 std::vector<COutPoint> coins_to_uncache;
1459 auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
1460 AssertLockHeld(cs_main);
1461 if (test_accept) {
1462 auto args = MemPoolAccept::ATMPArgs::PackageTestAccept(
1463 config, GetTime(), coins_to_uncache);
1464 return MemPoolAccept(pool, active_chainstate)
1465 .AcceptMultipleTransactions(package, args);
1466 } else {
1467 auto args = MemPoolAccept::ATMPArgs::PackageChildWithParents(
1468 config, GetTime(), coins_to_uncache);
1469 return MemPoolAccept(pool, active_chainstate)
1470 .AcceptPackage(package, args);
1471 }
1472 }();
1473
1474 // Uncache coins pertaining to transactions that were not submitted to the
1475 // mempool.

Callers 4

ProcessMessageMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
testmempoolacceptFunction · 0.85
submitpackageFunction · 0.85

Calls 8

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