Bitcoin Core 22.99.0
P2P Digital Currency
packages.h
Go to the documentation of this file.
1// Copyright (c) 2021 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_POLICY_PACKAGES_H
6#define BITCOIN_POLICY_PACKAGES_H
7
9#include <policy/policy.h>
11
12#include <vector>
13
15static constexpr uint32_t MAX_PACKAGE_COUNT{25};
17static constexpr uint32_t MAX_PACKAGE_SIZE{101};
19
27 PCKG_TX,
28};
29
32using Package = std::vector<CTransactionRef>;
33
34class PackageValidationState : public ValidationState<PackageValidationResult> {};
35
42bool CheckPackage(const Package& txns, PackageValidationState& state);
43
44#endif // BITCOIN_POLICY_PACKAGES_H
Template for capturing information about block/transaction validation.
Definition: validation.h:90
static const int WITNESS_SCALE_FACTOR
Definition: consensus.h:21
std::vector< CTransactionRef > Package
A package is an ordered list of transactions.
Definition: packages.h:32
static constexpr uint32_t MAX_PACKAGE_COUNT
Default maximum number of transactions in a package.
Definition: packages.h:15
static constexpr uint32_t MAX_PACKAGE_SIZE
Default maximum total virtual size of transactions in a package in KvB.
Definition: packages.h:17
bool CheckPackage(const Package &txns, PackageValidationState &state)
Context-free package policy checks:
Definition: packages.cpp:14
PackageValidationResult
A "reason" why a package was invalid.
Definition: packages.h:24
@ PCKG_POLICY
The package itself is invalid (e.g. too many transactions).
@ PCKG_RESULT_UNSET
Initial value. The package has not yet been rejected.
@ PCKG_TX
At least one tx is invalid.
static const unsigned int MAX_STANDARD_TX_WEIGHT
The maximum weight for transactions we're willing to relay/mine.
Definition: policy.h:24