|
9 | 9 | #include "consensus/validation.h"
|
10 | 10 | #include "validation.h"
|
11 | 11 | #include "miner.h"
|
| 12 | +#include "policy/policy.h" |
12 | 13 | #include "pubkey.h"
|
13 | 14 | #include "script/standard.h"
|
14 | 15 | #include "txmempool.h"
|
|
24 | 25 |
|
25 | 26 | BOOST_FIXTURE_TEST_SUITE(miner_tests, TestingSetup)
|
26 | 27 |
|
| 28 | +static CFeeRate blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE); |
| 29 | + |
27 | 30 | static
|
28 | 31 | struct {
|
29 | 32 | unsigned char extranonce;
|
@@ -112,16 +115,16 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,
|
112 | 115 | BOOST_CHECK(pblocktemplate->block.vtx[2]->GetHash() == hashHighFeeTx);
|
113 | 116 | BOOST_CHECK(pblocktemplate->block.vtx[3]->GetHash() == hashMediumFeeTx);
|
114 | 117 |
|
115 |
| - // Test that a package below the min relay fee doesn't get included |
| 118 | + // Test that a package below the block min tx fee doesn't get included |
116 | 119 | tx.vin[0].prevout.hash = hashHighFeeTx;
|
117 | 120 | tx.vout[0].nValue = 5000000000LL - 1000 - 50000; // 0 fee
|
118 | 121 | uint256 hashFreeTx = tx.GetHash();
|
119 | 122 | mempool.addUnchecked(hashFreeTx, entry.Fee(0).FromTx(tx));
|
120 | 123 | size_t freeTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
|
121 | 124 |
|
122 | 125 | // Calculate a fee on child transaction that will put the package just
|
123 |
| - // below the min relay fee (assuming 1 child tx of the same size). |
124 |
| - CAmount feeToUse = minRelayTxFee.GetFee(2*freeTxSize) - 1; |
| 126 | + // below the block min tx fee (assuming 1 child tx of the same size). |
| 127 | + CAmount feeToUse = blockMinFeeRate.GetFee(2*freeTxSize) - 1; |
125 | 128 |
|
126 | 129 | tx.vin[0].prevout.hash = hashFreeTx;
|
127 | 130 | tx.vout[0].nValue = 5000000000LL - 1000 - 50000 - feeToUse;
|
@@ -158,7 +161,7 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,
|
158 | 161 | // This tx can't be mined by itself
|
159 | 162 | tx.vin[0].prevout.hash = hashFreeTx2;
|
160 | 163 | tx.vout.resize(1);
|
161 |
| - feeToUse = minRelayTxFee.GetFee(freeTxSize); |
| 164 | + feeToUse = blockMinFeeRate.GetFee(freeTxSize); |
162 | 165 | tx.vout[0].nValue = 5000000000LL - 100000000 - feeToUse;
|
163 | 166 | uint256 hashLowFeeTx2 = tx.GetHash();
|
164 | 167 | mempool.addUnchecked(hashLowFeeTx2, entry.Fee(feeToUse).SpendsCoinbase(false).FromTx(tx));
|
|
0 commit comments