@@ -63,17 +63,17 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
6363 BOOST_CHECK_EQUAL (testPool.size (), poolSize);
6464
6565 // Just the parent:
66- testPool.addUnchecked (txParent. GetHash (), entry.FromTx (txParent));
66+ testPool.addUnchecked (entry.FromTx (txParent));
6767 poolSize = testPool.size ();
6868 testPool.removeRecursive (txParent);
6969 BOOST_CHECK_EQUAL (testPool.size (), poolSize - 1 );
7070
7171 // Parent, children, grandchildren:
72- testPool.addUnchecked (txParent. GetHash (), entry.FromTx (txParent));
72+ testPool.addUnchecked (entry.FromTx (txParent));
7373 for (int i = 0 ; i < 3 ; i++)
7474 {
75- testPool.addUnchecked (txChild[i]. GetHash (), entry.FromTx (txChild[i]));
76- testPool.addUnchecked (txGrandChild[i]. GetHash (), entry.FromTx (txGrandChild[i]));
75+ testPool.addUnchecked (entry.FromTx (txChild[i]));
76+ testPool.addUnchecked (entry.FromTx (txGrandChild[i]));
7777 }
7878 // Remove Child[0], GrandChild[0] should be removed:
7979 poolSize = testPool.size ();
@@ -95,8 +95,8 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
9595 // Add children and grandchildren, but NOT the parent (simulate the parent being in a block)
9696 for (int i = 0 ; i < 3 ; i++)
9797 {
98- testPool.addUnchecked (txChild[i]. GetHash (), entry.FromTx (txChild[i]));
99- testPool.addUnchecked (txGrandChild[i]. GetHash (), entry.FromTx (txGrandChild[i]));
98+ testPool.addUnchecked (entry.FromTx (txChild[i]));
99+ testPool.addUnchecked (entry.FromTx (txGrandChild[i]));
100100 }
101101 // Now remove the parent, as might happen if a block-re-org occurs but the parent cannot be
102102 // put into the mempool (maybe because it is non-standard):
@@ -128,36 +128,36 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
128128 tx1.vout .resize (1 );
129129 tx1.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
130130 tx1.vout [0 ].nValue = 10 * COIN;
131- pool.addUnchecked (tx1. GetHash (), entry.Fee (10000LL ).FromTx (tx1));
131+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx1));
132132
133133 /* highest fee */
134134 CMutableTransaction tx2 = CMutableTransaction ();
135135 tx2.vout .resize (1 );
136136 tx2.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
137137 tx2.vout [0 ].nValue = 2 * COIN;
138- pool.addUnchecked (tx2. GetHash (), entry.Fee (20000LL ).FromTx (tx2));
138+ pool.addUnchecked (entry.Fee (20000LL ).FromTx (tx2));
139139
140140 /* lowest fee */
141141 CMutableTransaction tx3 = CMutableTransaction ();
142142 tx3.vout .resize (1 );
143143 tx3.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
144144 tx3.vout [0 ].nValue = 5 * COIN;
145- pool.addUnchecked (tx3. GetHash (), entry.Fee (0LL ).FromTx (tx3));
145+ pool.addUnchecked (entry.Fee (0LL ).FromTx (tx3));
146146
147147 /* 2nd highest fee */
148148 CMutableTransaction tx4 = CMutableTransaction ();
149149 tx4.vout .resize (1 );
150150 tx4.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
151151 tx4.vout [0 ].nValue = 6 * COIN;
152- pool.addUnchecked (tx4. GetHash (), entry.Fee (15000LL ).FromTx (tx4));
152+ pool.addUnchecked (entry.Fee (15000LL ).FromTx (tx4));
153153
154154 /* equal fee rate to tx1, but newer */
155155 CMutableTransaction tx5 = CMutableTransaction ();
156156 tx5.vout .resize (1 );
157157 tx5.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
158158 tx5.vout [0 ].nValue = 11 * COIN;
159159 entry.nTime = 1 ;
160- pool.addUnchecked (tx5. GetHash (), entry.Fee (10000LL ).FromTx (tx5));
160+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx5));
161161 BOOST_CHECK_EQUAL (pool.size (), 5U );
162162
163163 std::vector<std::string> sortedOrder;
@@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
175175 tx6.vout .resize (1 );
176176 tx6.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
177177 tx6.vout [0 ].nValue = 20 * COIN;
178- pool.addUnchecked (tx6. GetHash (), entry.Fee (0LL ).FromTx (tx6));
178+ pool.addUnchecked (entry.Fee (0LL ).FromTx (tx6));
179179 BOOST_CHECK_EQUAL (pool.size (), 6U );
180180 // Check that at this point, tx6 is sorted low
181181 sortedOrder.insert (sortedOrder.begin (), tx6.GetHash ().ToString ());
@@ -198,7 +198,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
198198 BOOST_CHECK_EQUAL (pool.CalculateMemPoolAncestors (entry.Fee (2000000LL ).FromTx (tx7), setAncestorsCalculated, 100 , 1000000 , 1000 , 1000000 , dummy), true );
199199 BOOST_CHECK (setAncestorsCalculated == setAncestors);
200200
201- pool.addUnchecked (tx7. GetHash (), entry.FromTx (tx7), setAncestors);
201+ pool.addUnchecked (entry.FromTx (tx7), setAncestors);
202202 BOOST_CHECK_EQUAL (pool.size (), 7U );
203203
204204 // Now tx6 should be sorted higher (high fee child): tx7, tx6, tx2, ...
@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
216216 tx8.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
217217 tx8.vout [0 ].nValue = 10 * COIN;
218218 setAncestors.insert (pool.mapTx .find (tx7.GetHash ()));
219- pool.addUnchecked (tx8. GetHash (), entry.Fee (0LL ).Time (2 ).FromTx (tx8), setAncestors);
219+ pool.addUnchecked (entry.Fee (0LL ).Time (2 ).FromTx (tx8), setAncestors);
220220
221221 // Now tx8 should be sorted low, but tx6/tx both high
222222 sortedOrder.insert (sortedOrder.begin (), tx8.GetHash ().ToString ());
@@ -230,7 +230,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
230230 tx9.vout .resize (1 );
231231 tx9.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
232232 tx9.vout [0 ].nValue = 1 * COIN;
233- pool.addUnchecked (tx9. GetHash (), entry.Fee (0LL ).Time (3 ).FromTx (tx9), setAncestors);
233+ pool.addUnchecked (entry.Fee (0LL ).Time (3 ).FromTx (tx9), setAncestors);
234234
235235 // tx9 should be sorted low
236236 BOOST_CHECK_EQUAL (pool.size (), 9U );
@@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
256256 BOOST_CHECK_EQUAL (pool.CalculateMemPoolAncestors (entry.Fee (200000LL ).Time (4 ).FromTx (tx10), setAncestorsCalculated, 100 , 1000000 , 1000 , 1000000 , dummy), true );
257257 BOOST_CHECK (setAncestorsCalculated == setAncestors);
258258
259- pool.addUnchecked (tx10. GetHash (), entry.FromTx (tx10), setAncestors);
259+ pool.addUnchecked (entry.FromTx (tx10), setAncestors);
260260
261261 /* *
262262 * tx8 and tx9 should both now be sorted higher
@@ -301,36 +301,36 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
301301 tx1.vout .resize (1 );
302302 tx1.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
303303 tx1.vout [0 ].nValue = 10 * COIN;
304- pool.addUnchecked (tx1. GetHash (), entry.Fee (10000LL ).FromTx (tx1));
304+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx1));
305305
306306 /* highest fee */
307307 CMutableTransaction tx2 = CMutableTransaction ();
308308 tx2.vout .resize (1 );
309309 tx2.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
310310 tx2.vout [0 ].nValue = 2 * COIN;
311- pool.addUnchecked (tx2. GetHash (), entry.Fee (20000LL ).FromTx (tx2));
311+ pool.addUnchecked (entry.Fee (20000LL ).FromTx (tx2));
312312 uint64_t tx2Size = GetVirtualTransactionSize (tx2);
313313
314314 /* lowest fee */
315315 CMutableTransaction tx3 = CMutableTransaction ();
316316 tx3.vout .resize (1 );
317317 tx3.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
318318 tx3.vout [0 ].nValue = 5 * COIN;
319- pool.addUnchecked (tx3. GetHash (), entry.Fee (0LL ).FromTx (tx3));
319+ pool.addUnchecked (entry.Fee (0LL ).FromTx (tx3));
320320
321321 /* 2nd highest fee */
322322 CMutableTransaction tx4 = CMutableTransaction ();
323323 tx4.vout .resize (1 );
324324 tx4.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
325325 tx4.vout [0 ].nValue = 6 * COIN;
326- pool.addUnchecked (tx4. GetHash (), entry.Fee (15000LL ).FromTx (tx4));
326+ pool.addUnchecked (entry.Fee (15000LL ).FromTx (tx4));
327327
328328 /* equal fee rate to tx1, but newer */
329329 CMutableTransaction tx5 = CMutableTransaction ();
330330 tx5.vout .resize (1 );
331331 tx5.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
332332 tx5.vout [0 ].nValue = 11 * COIN;
333- pool.addUnchecked (tx5. GetHash (), entry.Fee (10000LL ).FromTx (tx5));
333+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx5));
334334 BOOST_CHECK_EQUAL (pool.size (), 5U );
335335
336336 std::vector<std::string> sortedOrder;
@@ -359,7 +359,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
359359 tx6.vout [0 ].nValue = 20 * COIN;
360360 uint64_t tx6Size = GetVirtualTransactionSize (tx6);
361361
362- pool.addUnchecked (tx6. GetHash (), entry.Fee (0LL ).FromTx (tx6));
362+ pool.addUnchecked (entry.Fee (0LL ).FromTx (tx6));
363363 BOOST_CHECK_EQUAL (pool.size (), 6U );
364364 // Ties are broken by hash
365365 if (tx3.GetHash () < tx6.GetHash ())
@@ -381,7 +381,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
381381 /* set the fee to just below tx2's feerate when including ancestor */
382382 CAmount fee = (20000 /tx2Size)*(tx7Size + tx6Size) - 1 ;
383383
384- pool.addUnchecked (tx7. GetHash (), entry.Fee (fee).FromTx (tx7));
384+ pool.addUnchecked (entry.Fee (fee).FromTx (tx7));
385385 BOOST_CHECK_EQUAL (pool.size (), 7U );
386386 sortedOrder.insert (sortedOrder.begin ()+1 , tx7.GetHash ().ToString ());
387387 CheckSort<ancestor_score>(pool, sortedOrder);
@@ -413,7 +413,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
413413 // Check that we sort by min(feerate, ancestor_feerate):
414414 // set the fee so that the ancestor feerate is above tx1/5,
415415 // but the transaction's own feerate is lower
416- pool.addUnchecked (tx8. GetHash (), entry.Fee (5000LL ).FromTx (tx8));
416+ pool.addUnchecked (entry.Fee (5000LL ).FromTx (tx8));
417417 sortedOrder.insert (sortedOrder.end ()-1 , tx8.GetHash ().ToString ());
418418 CheckSort<ancestor_score>(pool, sortedOrder);
419419}
@@ -431,15 +431,15 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
431431 tx1.vout .resize (1 );
432432 tx1.vout [0 ].scriptPubKey = CScript () << OP_1 << OP_EQUAL;
433433 tx1.vout [0 ].nValue = 10 * COIN;
434- pool.addUnchecked (tx1. GetHash (), entry.Fee (10000LL ).FromTx (tx1));
434+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx1));
435435
436436 CMutableTransaction tx2 = CMutableTransaction ();
437437 tx2.vin .resize (1 );
438438 tx2.vin [0 ].scriptSig = CScript () << OP_2;
439439 tx2.vout .resize (1 );
440440 tx2.vout [0 ].scriptPubKey = CScript () << OP_2 << OP_EQUAL;
441441 tx2.vout [0 ].nValue = 10 * COIN;
442- pool.addUnchecked (tx2. GetHash (), entry.Fee (5000LL ).FromTx (tx2));
442+ pool.addUnchecked (entry.Fee (5000LL ).FromTx (tx2));
443443
444444 pool.TrimToSize (pool.DynamicMemoryUsage ()); // should do nothing
445445 BOOST_CHECK (pool.exists (tx1.GetHash ()));
@@ -449,15 +449,15 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
449449 BOOST_CHECK (pool.exists (tx1.GetHash ()));
450450 BOOST_CHECK (!pool.exists (tx2.GetHash ()));
451451
452- pool.addUnchecked (tx2. GetHash (), entry.FromTx (tx2));
452+ pool.addUnchecked (entry.FromTx (tx2));
453453 CMutableTransaction tx3 = CMutableTransaction ();
454454 tx3.vin .resize (1 );
455455 tx3.vin [0 ].prevout = COutPoint (tx2.GetHash (), 0 );
456456 tx3.vin [0 ].scriptSig = CScript () << OP_2;
457457 tx3.vout .resize (1 );
458458 tx3.vout [0 ].scriptPubKey = CScript () << OP_3 << OP_EQUAL;
459459 tx3.vout [0 ].nValue = 10 * COIN;
460- pool.addUnchecked (tx3. GetHash (), entry.Fee (20000LL ).FromTx (tx3));
460+ pool.addUnchecked (entry.Fee (20000LL ).FromTx (tx3));
461461
462462 pool.TrimToSize (pool.DynamicMemoryUsage () * 3 / 4 ); // tx3 should pay for tx2 (CPFP)
463463 BOOST_CHECK (!pool.exists (tx1.GetHash ()));
@@ -520,10 +520,10 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
520520 tx7.vout [1 ].scriptPubKey = CScript () << OP_7 << OP_EQUAL;
521521 tx7.vout [1 ].nValue = 10 * COIN;
522522
523- pool.addUnchecked (tx4. GetHash (), entry.Fee (7000LL ).FromTx (tx4));
524- pool.addUnchecked (tx5. GetHash (), entry.Fee (1000LL ).FromTx (tx5));
525- pool.addUnchecked (tx6. GetHash (), entry.Fee (1100LL ).FromTx (tx6));
526- pool.addUnchecked (tx7. GetHash (), entry.Fee (9000LL ).FromTx (tx7));
523+ pool.addUnchecked (entry.Fee (7000LL ).FromTx (tx4));
524+ pool.addUnchecked (entry.Fee (1000LL ).FromTx (tx5));
525+ pool.addUnchecked (entry.Fee (1100LL ).FromTx (tx6));
526+ pool.addUnchecked (entry.Fee (9000LL ).FromTx (tx7));
527527
528528 // we only require this to remove, at max, 2 txn, because it's not clear what we're really optimizing for aside from that
529529 pool.TrimToSize (pool.DynamicMemoryUsage () - 1 );
@@ -532,17 +532,17 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
532532 BOOST_CHECK (!pool.exists (tx7.GetHash ()));
533533
534534 if (!pool.exists (tx5.GetHash ()))
535- pool.addUnchecked (tx5. GetHash (), entry.Fee (1000LL ).FromTx (tx5));
536- pool.addUnchecked (tx7. GetHash (), entry.Fee (9000LL ).FromTx (tx7));
535+ pool.addUnchecked (entry.Fee (1000LL ).FromTx (tx5));
536+ pool.addUnchecked (entry.Fee (9000LL ).FromTx (tx7));
537537
538538 pool.TrimToSize (pool.DynamicMemoryUsage () / 2 ); // should maximize mempool size by only removing 5/7
539539 BOOST_CHECK (pool.exists (tx4.GetHash ()));
540540 BOOST_CHECK (!pool.exists (tx5.GetHash ()));
541541 BOOST_CHECK (pool.exists (tx6.GetHash ()));
542542 BOOST_CHECK (!pool.exists (tx7.GetHash ()));
543543
544- pool.addUnchecked (tx5. GetHash (), entry.Fee (1000LL ).FromTx (tx5));
545- pool.addUnchecked (tx7. GetHash (), entry.Fee (9000LL ).FromTx (tx7));
544+ pool.addUnchecked (entry.Fee (1000LL ).FromTx (tx5));
545+ pool.addUnchecked (entry.Fee (9000LL ).FromTx (tx7));
546546
547547 std::vector<CTransactionRef> vtx;
548548 SetMockTime (42 );
@@ -603,7 +603,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
603603 // [tx1]
604604 //
605605 CTransactionRef tx1 = make_tx (/* output_values */ {10 * COIN});
606- pool.addUnchecked (tx1-> GetHash (), entry.Fee (10000LL ).FromTx (tx1));
606+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx1));
607607
608608 // Ancestors / descendants should be 1 / 1 (itself / itself)
609609 pool.GetTransactionAncestry (tx1->GetHash (), ancestors, descendants);
@@ -615,7 +615,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
615615 // [tx1].0 <- [tx2]
616616 //
617617 CTransactionRef tx2 = make_tx (/* output_values */ {495 * CENT, 5 * COIN}, /* inputs */ {tx1});
618- pool.addUnchecked (tx2-> GetHash (), entry.Fee (10000LL ).FromTx (tx2));
618+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx2));
619619
620620 // Ancestors / descendants should be:
621621 // transaction ancestors descendants
@@ -634,7 +634,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
634634 // [tx1].0 <- [tx2].0 <- [tx3]
635635 //
636636 CTransactionRef tx3 = make_tx (/* output_values */ {290 * CENT, 200 * CENT}, /* inputs */ {tx2});
637- pool.addUnchecked (tx3-> GetHash (), entry.Fee (10000LL ).FromTx (tx3));
637+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx3));
638638
639639 // Ancestors / descendants should be:
640640 // transaction ancestors descendants
@@ -659,7 +659,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
659659 // \---1 <- [tx4]
660660 //
661661 CTransactionRef tx4 = make_tx (/* output_values */ {290 * CENT, 250 * CENT}, /* inputs */ {tx2}, /* input_indices */ {1 });
662- pool.addUnchecked (tx4-> GetHash (), entry.Fee (10000LL ).FromTx (tx4));
662+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx4));
663663
664664 // Ancestors / descendants should be:
665665 // transaction ancestors descendants
@@ -696,13 +696,13 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
696696 CTransactionRef& tyi = *ty[i];
697697 tyi = make_tx (/* output_values */ {v}, /* inputs */ i > 0 ? std::vector<CTransactionRef>{*ty[i - 1 ]} : std::vector<CTransactionRef>{});
698698 v -= 50 * CENT;
699- pool.addUnchecked (tyi-> GetHash (), entry.Fee (10000LL ).FromTx (tyi));
699+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (tyi));
700700 pool.GetTransactionAncestry (tyi->GetHash (), ancestors, descendants);
701701 BOOST_CHECK_EQUAL (ancestors, i+1 );
702702 BOOST_CHECK_EQUAL (descendants, i+1 );
703703 }
704704 CTransactionRef ty6 = make_tx (/* output_values */ {5 * COIN}, /* inputs */ {tx3, ty5});
705- pool.addUnchecked (ty6-> GetHash (), entry.Fee (10000LL ).FromTx (ty6));
705+ pool.addUnchecked (entry.Fee (10000LL ).FromTx (ty6));
706706
707707 // Ancestors / descendants should be:
708708 // transaction ancestors descendants
0 commit comments