13 #include <boost/test/unit_test.hpp>
23 std::vector<CAmount> feeV;
26 for (
int j = 0; j < 10; j++) {
27 feeV.push_back(basefee * (j+1));
34 std::vector<uint256> txHashes[10];
38 for (
unsigned int i = 0; i < 128; i++)
42 tx.
vin[0].scriptSig = garbage;
44 tx.
vout[0].nValue=0LL;
48 std::vector<CTransactionRef> block;
54 while (blocknum < 200) {
55 for (
int j = 0; j < 10; j++) {
56 for (
int k = 0; k < 4; k++) {
57 tx.
vin[0].prevout.n = 10000*blocknum+100*j+k;
60 txHashes[j].push_back(hash);
64 for (
int h = 0; h <= blocknum%10; h++) {
68 while (txHashes[9-h].size()) {
71 block.emplace_back(ptx);
72 txHashes[9-h].pop_back();
94 std::vector<CAmount> origFeeEst;
101 for (
int i = 1; i < 10;i++) {
113 while (blocknum < 250)
116 for (
int i = 1; i < 10;i++) {
124 while (blocknum < 265) {
125 for (
int j = 0; j < 10; j++) {
126 for (
int k = 0; k < 4; k++) {
127 tx.
vin[0].prevout.n = 10000*blocknum+100*j+k;
130 txHashes[j].push_back(hash);
137 for (
int i = 1; i < 10;i++) {
144 for (
int j = 0; j < 10; j++) {
145 while(txHashes[j].size()) {
148 block.emplace_back(ptx);
149 txHashes[j].pop_back();
154 for (
int i = 1; i < 10;i++) {
160 while (blocknum < 465) {
161 for (
int j = 0; j < 10; j++) {
162 for (
int k = 0; k < 4; k++) {
163 tx.
vin[0].prevout.n = 10000*blocknum+100*j+k;
168 block.emplace_back(ptx);
174 for (
int i = 1; i < 10; i++) {
183 for (
int i = 1; i < 10; i++) {
int64_t CAmount
Amount in PIV (Can be negative)
Fee rate in PIV per kilobyte: CAmount / kB.
CAmount GetFeePerK() const
Serialized script, used inside transaction inputs and outputs.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
CFeeRate GetMinFee(size_t sizelimit) const
The minimum fee to get into the mempool, which may itself not be enough for larger-sized transactions...
CTransactionRef get(const uint256 &hash) const
CFeeRate estimateFee(int nBlocks) const
Estimate fee rate needed to get into the next nBlocks.
CFeeRate estimateSmartFee(int nBlocks, int *answerFoundAtBlocks=nullptr) const
Estimate fee rate needed to get into the next nBlocks If no answer can be given at nBlocks,...
bool addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, bool validFeeEstimate=true)
void TrimToSize(size_t sizelimit, std::vector< COutPoint > *pvNoSpendsRemaining=nullptr)
Remove transactions from the mempool until its dynamic size is <= sizelimit.
void removeForBlock(const std::vector< CTransactionRef > &vtx, unsigned int nBlockHeight)
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)
BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
unsigned int GetSerializeSize(const std::array< T, N > &item)
array
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)
std::shared_ptr< const CTransaction > CTransactionRef
int64_t GetTime()
DEPRECATED Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)