15
15
16
16
BOOST_FIXTURE_TEST_SUITE (miniminer_tests, TestingSetup)
17
17
18
+ const CAmount low_fee{CENT/2000 }; // 500 ṩ
19
+ const CAmount med_fee{CENT/200 }; // 5000 ṩ
20
+ const CAmount high_fee{CENT/10 }; // 100_000 ṩ
21
+
22
+
18
23
static inline CTransactionRef make_tx (const std::vector<COutPoint>& inputs, size_t num_outputs)
19
24
{
20
25
CMutableTransaction tx = CMutableTransaction ();
@@ -107,15 +112,11 @@ BOOST_FIXTURE_TEST_CASE(miniminer_1p1c, TestChain100Setup)
107
112
LOCK2 (::cs_main, pool.cs );
108
113
TestMemPoolEntryHelper entry;
109
114
110
- const CAmount low_fee{CENT/2000 };
111
- const CAmount normal_fee{CENT/200 };
112
- const CAmount high_fee{CENT/10 };
113
-
114
115
// Create a parent tx0 and child tx1 with normal fees:
115
116
const auto tx0 = make_tx ({COutPoint{m_coinbase_txns[0 ]->GetHash (), 0 }}, /* num_outputs=*/ 2 );
116
- pool.addUnchecked (entry.Fee (normal_fee ).FromTx (tx0));
117
+ pool.addUnchecked (entry.Fee (med_fee ).FromTx (tx0));
117
118
const auto tx1 = make_tx ({COutPoint{tx0->GetHash (), 0 }}, /* num_outputs=*/ 1 );
118
- pool.addUnchecked (entry.Fee (normal_fee ).FromTx (tx1));
119
+ pool.addUnchecked (entry.Fee (med_fee ).FromTx (tx1));
119
120
120
121
// Create a low-feerate parent tx2 and high-feerate child tx3 (cpfp)
121
122
const auto tx2 = make_tx ({COutPoint{m_coinbase_txns[1 ]->GetHash (), 0 }}, /* num_outputs=*/ 2 );
@@ -128,9 +129,10 @@ BOOST_FIXTURE_TEST_CASE(miniminer_1p1c, TestChain100Setup)
128
129
pool.addUnchecked (entry.Fee (low_fee).FromTx (tx4));
129
130
const auto tx5 = make_tx ({COutPoint{tx4->GetHash (), 0 }}, /* num_outputs=*/ 1 );
130
131
pool.addUnchecked (entry.Fee (low_fee).FromTx (tx5));
132
+ const CAmount tx5_delta{CENT/100 };
131
133
// Make tx5's modified fee much higher than its base fee. This should cause it to pass
132
134
// the fee-related checks despite being low-feerate.
133
- pool.PrioritiseTransaction (tx5->GetHash (), CENT/ 100 );
135
+ pool.PrioritiseTransaction (tx5->GetHash (), tx5_delta );
134
136
135
137
// Create a high-feerate parent tx6, low-feerate child tx7
136
138
const auto tx6 = make_tx ({COutPoint{m_coinbase_txns[3 ]->GetHash (), 0 }}, /* num_outputs=*/ 2 );
@@ -342,10 +344,6 @@ BOOST_FIXTURE_TEST_CASE(miniminer_overlap, TestChain100Setup)
342
344
LOCK2 (::cs_main, pool.cs );
343
345
TestMemPoolEntryHelper entry;
344
346
345
- const CAmount low_fee{CENT/2000 }; // 500 ṩ
346
- const CAmount med_fee{CENT/200 }; // 5000 ṩ
347
- const CAmount high_fee{CENT/10 }; // 100_000 ṩ
348
-
349
347
// Create 3 parents of different feerates, and 1 child spending outputs from all 3 parents.
350
348
const auto tx0 = make_tx ({COutPoint{m_coinbase_txns[0 ]->GetHash (), 0 }}, /* num_outputs=*/ 2 );
351
349
pool.addUnchecked (entry.Fee (low_fee).FromTx (tx0));
0 commit comments