Bitcoin ABC 0.30.7
P2P Digital Currency
Functions
packages.cpp File Reference
#include <consensus/validation.h>
#include <policy/packages.h>
#include <primitives/transaction.h>
#include <primitives/txid.h>
#include <util/hasher.h>
#include <numeric>
#include <unordered_set>
Include dependency graph for packages.cpp:

Go to the source code of this file.

Functions

bool CheckPackage (const Package &txns, PackageValidationState &state)
 Context-free package policy checks: More...
 
bool IsChildWithParents (const Package &package)
 Context-free check that a package is exactly one child and its parents; not all parents need to be present, but the package must not contain any transactions that are not the child's parents. More...
 
bool IsChildWithParentsTree (const Package &package)
 Context-free check that a package IsChildWithParents() and none of the parents depend on each other (the package is a "tree"). More...
 
uint256 GetPackageHash (const Package &package)
 

Function Documentation

◆ CheckPackage()

bool CheckPackage ( const Package txns,
PackageValidationState state 
)

Context-free package policy checks:

  1. The number of transactions cannot exceed MAX_PACKAGE_COUNT.
  2. The total virtual size cannot exceed MAX_PACKAGE_SIZE.
  3. If any dependencies exist between transactions, parents must appear before children.
  4. Transactions cannot conflict, i.e., spend the same inputs.

Definition at line 14 of file packages.cpp.

Here is the call graph for this function:

◆ GetPackageHash()

uint256 GetPackageHash ( const Package package)

Definition at line 129 of file packages.cpp.

Here is the call graph for this function:

◆ IsChildWithParents()

bool IsChildWithParents ( const Package package)

Context-free check that a package is exactly one child and its parents; not all parents need to be present, but the package must not contain any transactions that are not the child's parents.

It is expected to be sorted, which means the last transaction must be the child.

Definition at line 86 of file packages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsChildWithParentsTree()

bool IsChildWithParentsTree ( const Package package)

Context-free check that a package IsChildWithParents() and none of the parents depend on each other (the package is a "tree").

Definition at line 109 of file packages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: