MCPcopy Create free account
hub / github.com/ElementsProject/elements / PackageMempoolChecks

Method PackageMempoolChecks

src/validation.cpp:1045–1062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1043}
1044
1045bool MemPoolAccept::PackageMempoolChecks(const std::vector<CTransactionRef>& txns,
1046 PackageValidationState& package_state)
1047{
1048 AssertLockHeld(cs_main);
1049 AssertLockHeld(m_pool.cs);
1050
1051 // CheckPackageLimits expects the package transactions to not already be in the mempool.
1052 assert(std::all_of(txns.cbegin(), txns.cend(), [this](const auto& tx)
1053 { return !m_pool.exists(GenTxid::Txid(tx->GetHash()));}));
1054
1055 std::string err_string;
1056 if (!m_pool.CheckPackageLimits(txns, m_limit_ancestors, m_limit_ancestor_size, m_limit_descendants,
1057 m_limit_descendant_size, err_string)) {
1058 // This is a package-wide error, separate from an individual transaction error.
1059 return package_state.Invalid(PackageValidationResult::PCKG_POLICY, "package-mempool-limits", err_string);
1060 }
1061 return true;
1062}
1063
1064bool MemPoolAccept::PolicyScriptChecks(const ATMPArgs& args, Workspace& ws)
1065{

Callers

nothing calls this directly

Calls 6

cbeginMethod · 0.80
cendMethod · 0.80
CheckPackageLimitsMethod · 0.80
InvalidMethod · 0.80
existsMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected