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++) {
int64_t CAmount
Amount in satoshis (Can be negative)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
CFeeRate estimateFee(int confTarget) const
DEPRECATED.
Fee rate in satoshis per kilobyte: CAmount / kB.
CAmount GetFeePerK() const
Return the fee in satoshis for a size of 1000 bytes.
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it.
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...
CTransactionRef get(const uint256 &hash) const
void removeForBlock(const std::vector< CTransactionRef > &vtx, unsigned int nBlockHeight) EXCLUSIVE_LOCKS_REQUIRED(cs)
Called when a block is connected.
void push_back(const T &value)
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK(expr)
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
std::shared_ptr< const CTransaction > CTransactionRef
A mutable version of CTransaction.
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
std::vector< CTxOut > vout
TestMemPoolEntryHelper & Time(int64_t _time)
TestMemPoolEntryHelper & Fee(CAmount _fee)
int64_t GetTime()
DEPRECATED Use either GetTimeSeconds (not mockable) or GetTime<T> (mockable)