Bitcoin Core
27.99.0
P2P Digital Currency
|
#include <consensus/amount.h>
#include <policy/packages.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <txmempool.h>
#include <util/result.h>
#include <set>
#include <string>
Go to the source code of this file.
Functions | |
std::optional< std::pair< std::string, CTransactionRef > > | SingleV3Checks (const CTransactionRef &ptx, const CTxMemPool::setEntries &mempool_ancestors, const std::set< Txid > &direct_conflicts, int64_t vsize) |
Must be called for every transaction, even if not v3. More... | |
std::optional< std::string > | PackageV3Checks (const CTransactionRef &ptx, int64_t vsize, const Package &package, const CTxMemPool::setEntries &mempool_ancestors) |
Must be called for every transaction that is submitted within a package, even if not v3. More... | |
Variables | |
static constexpr unsigned int | V3_DESCENDANT_LIMIT {2} |
Maximum number of transactions including an unconfirmed tx and its descendants. More... | |
static constexpr unsigned int | V3_ANCESTOR_LIMIT {2} |
Maximum number of transactions including a V3 tx and all its mempool ancestors. More... | |
static constexpr int64_t | V3_CHILD_MAX_VSIZE {1000} |
Maximum sigop-adjusted virtual size of a tx which spends from an unconfirmed v3 transaction. More... | |
std::optional<std::string> PackageV3Checks | ( | const CTransactionRef & | ptx, |
int64_t | vsize, | ||
const Package & | package, | ||
const CTxMemPool::setEntries & | mempool_ancestors | ||
) |
Must be called for every transaction that is submitted within a package, even if not v3.
For each transaction in a package: If it's not a v3 transaction, verify it has no direct v3 parents in the mempool or the package.
If it is a v3 transaction, verify that any direct parents in the mempool or the package are v3. If such a parent exists, verify that parent has no other children in the package or the mempool, and that the transaction itself has no children in the package.
If any v3 violations in the package exist, this test will fail for one of them:
Definition at line 58 of file v3_policy.cpp.
std::optional<std::pair<std::string, CTransactionRef> > SingleV3Checks | ( | const CTransactionRef & | ptx, |
const CTxMemPool::setEntries & | mempool_ancestors, | ||
const std::set< Txid > & | direct_conflicts, | ||
int64_t | vsize | ||
) |
Must be called for every transaction, even if not v3.
Not strictly necessary for transactions accepted through AcceptMultipleTransactions.
Checks the following rules:
[in] | mempool_ancestors | The in-mempool ancestors of ptx. |
[in] | direct_conflicts | In-mempool transactions this tx conflicts with. These conflicts are used to more accurately calculate the resulting descendant count of in-mempool ancestors. |
[in] | vsize | The sigop-adjusted virtual size of ptx. |
Definition at line 162 of file v3_policy.cpp.
|
staticconstexpr |
Maximum number of transactions including a V3 tx and all its mempool ancestors.
Definition at line 25 of file v3_policy.h.
|
staticconstexpr |
Maximum sigop-adjusted virtual size of a tx which spends from an unconfirmed v3 transaction.
Definition at line 28 of file v3_policy.h.
|
staticconstexpr |
Maximum number of transactions including an unconfirmed tx and its descendants.
Definition at line 23 of file v3_policy.h.