 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
13 #include <boost/test/unit_test.hpp>
25 std::vector<CAmount> feeV;
28 for (
int j = 0; j < 10; j++) {
29 feeV.push_back(basefee * (j+1));
36 std::vector<uint256> txHashes[10];
40 for (
unsigned int i = 0; i < 128; i++)
44 tx.
vin[0].scriptSig = garbage;
46 tx.
vout[0].nValue=0LL;
50 std::vector<CTransactionRef> block;
56 while (blocknum < 200) {
57 for (
int j = 0; j < 10; j++) {
58 for (
int k = 0;
k < 4;
k++) {
59 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
62 txHashes[j].push_back(hash);
66 for (
int h = 0; h <= blocknum%10; h++) {
70 while (txHashes[9-h].size()) {
74 txHashes[9-h].pop_back();
90 std::vector<CAmount> origFeeEst;
97 for (
int i = 1; i < 10;i++) {
109 for (
int i = 10; i <= 48; i++) {
115 while (blocknum < 250)
119 for (
int i = 2; i < 10;i++) {
127 while (blocknum < 265) {
128 for (
int j = 0; j < 10; j++) {
129 for (
int k = 0;
k < 4;
k++) {
130 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
133 txHashes[j].push_back(hash);
139 for (
int i = 1; i < 10;i++) {
145 for (
int j = 0; j < 10; j++) {
146 while(txHashes[j].size()) {
149 block.push_back(ptx);
150 txHashes[j].pop_back();
156 for (
int i = 2; i < 10;i++) {
162 while (blocknum < 665) {
163 for (
int j = 0; j < 10; j++) {
164 for (
int k = 0;
k < 4;
k++) {
165 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
170 block.push_back(ptx);
178 for (
int i = 2; i < 9; i++) {
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
CFeeRate estimateFee(int confTarget) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
DEPRECATED.
BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
int64_t GetTime()
DEPRECATED Use either GetTimeSeconds (not mockable) or GetTime<T> (mockable)
std::shared_ptr< const CTransaction > CTransactionRef
#define BOOST_FIXTURE_TEST_SUITE(a, b)
BOOST_AUTO_TEST_SUITE_END()
Fee rate in satoshis per kilobyte: CAmount / kB.
The basic transaction that is broadcasted on the network and contained in blocks.
void push_back(const T &value)
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it.
CTransactionRef get(const uint256 &hash) const
int64_t CAmount
Amount in satoshis (Can be negative)
Serialized script, used inside transaction inputs and outputs.
std::vector< CTxOut > vout
TestMemPoolEntryHelper & Fee(CAmount _fee)
void check(const CCoinsViewCache &active_coins_tip, int64_t spendheight) const EXCLUSIVE_LOCKS_REQUIRED(void addUnchecked(const CTxMemPoolEntry &entry, bool validFeeEstimate=true) EXCLUSIVE_LOCKS_REQUIRED(cs
If sanity-checking is turned on, check makes sure the pool is consistent (does not contain two transa...
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
A mutable version of CTransaction.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
CAmount GetFeePerK() const
Return the fee in satoshis for a size of 1000 bytes.
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
#define BOOST_CHECK(expr)
TestMemPoolEntryHelper & Time(int64_t _time)
void removeForBlock(const std::vector< CTransactionRef > &vtx, unsigned int nBlockHeight) EXCLUSIVE_LOCKS_REQUIRED(cs)
Called when a block is connected.