@@ -443,15 +443,15 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
443443 tx1.vout .resize (1 );
444444 tx1.vout [0 ].scriptPubKey = CScript () << OP_1 << OP_EQUAL;
445445 tx1.vout [0 ].nValue = 10 * COIN;
446- pool.addUnchecked (entry.Fee (10000LL ).FromTx (tx1));
446+ pool.addUnchecked (entry.Fee (1000LL ).FromTx (tx1));
447447
448448 CMutableTransaction tx2 = CMutableTransaction ();
449449 tx2.vin .resize (1 );
450450 tx2.vin [0 ].scriptSig = CScript () << OP_2;
451451 tx2.vout .resize (1 );
452452 tx2.vout [0 ].scriptPubKey = CScript () << OP_2 << OP_EQUAL;
453453 tx2.vout [0 ].nValue = 10 * COIN;
454- pool.addUnchecked (entry.Fee (5000LL ).FromTx (tx2));
454+ pool.addUnchecked (entry.Fee (500LL ).FromTx (tx2));
455455
456456 pool.TrimToSize (pool.DynamicMemoryUsage ()); // should do nothing
457457 BOOST_CHECK (pool.exists (GenTxid::Txid (tx1.GetHash ())));
@@ -469,7 +469,7 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
469469 tx3.vout .resize (1 );
470470 tx3.vout [0 ].scriptPubKey = CScript () << OP_3 << OP_EQUAL;
471471 tx3.vout [0 ].nValue = 10 * COIN;
472- pool.addUnchecked (entry.Fee (20000LL ).FromTx (tx3));
472+ pool.addUnchecked (entry.Fee (2000LL ).FromTx (tx3));
473473
474474 pool.TrimToSize (pool.DynamicMemoryUsage () * 3 / 4 ); // tx3 should pay for tx2 (CPFP)
475475 BOOST_CHECK (!pool.exists (GenTxid::Txid (tx1.GetHash ())));
@@ -481,8 +481,8 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
481481 BOOST_CHECK (!pool.exists (GenTxid::Txid (tx2.GetHash ())));
482482 BOOST_CHECK (!pool.exists (GenTxid::Txid (tx3.GetHash ())));
483483
484- CFeeRate maxFeeRateRemoved (25000 , GetVirtualTransactionSize (CTransaction (tx3)) + GetVirtualTransactionSize (CTransaction (tx2)));
485- BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), maxFeeRateRemoved.GetFeePerK () + 1000 );
484+ CFeeRate maxFeeRateRemoved (2500 , GetVirtualTransactionSize (CTransaction (tx3)) + GetVirtualTransactionSize (CTransaction (tx2)));
485+ BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), maxFeeRateRemoved.GetFeePerK () + DEFAULT_INCREMENTAL_RELAY_FEE );
486486
487487 CMutableTransaction tx4 = CMutableTransaction ();
488488 tx4.vin .resize (2 );
@@ -532,10 +532,10 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
532532 tx7.vout [1 ].scriptPubKey = CScript () << OP_7 << OP_EQUAL;
533533 tx7.vout [1 ].nValue = 10 * COIN;
534534
535- pool.addUnchecked (entry.Fee (7000LL ).FromTx (tx4));
536- pool.addUnchecked (entry.Fee (1000LL ).FromTx (tx5));
537- pool.addUnchecked (entry.Fee (1100LL ).FromTx (tx6));
538- pool.addUnchecked (entry.Fee (9000LL ).FromTx (tx7));
535+ pool.addUnchecked (entry.Fee (700LL ).FromTx (tx4));
536+ pool.addUnchecked (entry.Fee (100LL ).FromTx (tx5));
537+ pool.addUnchecked (entry.Fee (110LL ).FromTx (tx6));
538+ pool.addUnchecked (entry.Fee (900LL ).FromTx (tx7));
539539
540540 // we only require this to remove, at max, 2 txn, because it's not clear what we're really optimizing for aside from that
541541 pool.TrimToSize (pool.DynamicMemoryUsage () - 1 );
@@ -544,43 +544,43 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
544544 BOOST_CHECK (!pool.exists (GenTxid::Txid (tx7.GetHash ())));
545545
546546 if (!pool.exists (GenTxid::Txid (tx5.GetHash ())))
547- pool.addUnchecked (entry.Fee (1000LL ).FromTx (tx5));
548- pool.addUnchecked (entry.Fee (9000LL ).FromTx (tx7));
547+ pool.addUnchecked (entry.Fee (100LL ).FromTx (tx5));
548+ pool.addUnchecked (entry.Fee (900LL ).FromTx (tx7));
549549
550550 pool.TrimToSize (pool.DynamicMemoryUsage () / 2 ); // should maximize mempool size by only removing 5/7
551551 BOOST_CHECK (pool.exists (GenTxid::Txid (tx4.GetHash ())));
552552 BOOST_CHECK (!pool.exists (GenTxid::Txid (tx5.GetHash ())));
553553 BOOST_CHECK (pool.exists (GenTxid::Txid (tx6.GetHash ())));
554554 BOOST_CHECK (!pool.exists (GenTxid::Txid (tx7.GetHash ())));
555555
556- pool.addUnchecked (entry.Fee (1000LL ).FromTx (tx5));
557- pool.addUnchecked (entry.Fee (9000LL ).FromTx (tx7));
556+ pool.addUnchecked (entry.Fee (100LL ).FromTx (tx5));
557+ pool.addUnchecked (entry.Fee (900LL ).FromTx (tx7));
558558
559559 std::vector<CTransactionRef> vtx;
560560 SetMockTime (42 );
561561 SetMockTime (42 + CTxMemPool::ROLLING_FEE_HALFLIFE);
562- BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), maxFeeRateRemoved.GetFeePerK () + 1000 );
562+ BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), maxFeeRateRemoved.GetFeePerK () + 100 );
563563 // ... we should keep the same min fee until we get a block
564564 pool.removeForBlock (vtx, 1 );
565565 SetMockTime (42 + 2 *CTxMemPool::ROLLING_FEE_HALFLIFE);
566- BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), llround ((maxFeeRateRemoved.GetFeePerK () + 1000 )/2.0 ));
566+ BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), llround ((maxFeeRateRemoved.GetFeePerK () + 100 )/2.0 ));
567567 // ... then feerate should drop 1/2 each halflife
568568
569569 SetMockTime (42 + 2 *CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 );
570- BOOST_CHECK_EQUAL (pool.GetMinFee (pool.DynamicMemoryUsage () * 5 / 2 ).GetFeePerK (), llround ((maxFeeRateRemoved.GetFeePerK () + 1000 )/4.0 ));
570+ BOOST_CHECK_EQUAL (pool.GetMinFee (pool.DynamicMemoryUsage () * 5 / 2 ).GetFeePerK (), llround ((maxFeeRateRemoved.GetFeePerK () + 100 )/4.0 ));
571571 // ... with a 1/2 halflife when mempool is < 1/2 its target size
572572
573573 SetMockTime (42 + 2 *CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4 );
574- BOOST_CHECK_EQUAL (pool.GetMinFee (pool.DynamicMemoryUsage () * 9 / 2 ).GetFeePerK (), llround ((maxFeeRateRemoved.GetFeePerK () + 1000 )/8.0 ));
574+ BOOST_CHECK_EQUAL (pool.GetMinFee (pool.DynamicMemoryUsage () * 9 / 2 ).GetFeePerK (), llround ((maxFeeRateRemoved.GetFeePerK () + 100 )/8.0 ));
575575 // ... with a 1/4 halflife when mempool is < 1/4 its target size
576576
577577 SetMockTime (42 + 7 *CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4 );
578- BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), 1000 );
579- // ... but feerate should never drop below 1000
578+ BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), 100 );
579+ // ... but feerate should never drop below 100
580580
581581 SetMockTime (42 + 8 *CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4 );
582582 BOOST_CHECK_EQUAL (pool.GetMinFee (1 ).GetFeePerK (), 0 );
583- // ... unless it has gone all the way to 0 (after getting past 1000 /2)
583+ // ... unless it has gone all the way to 0 (after getting past 100 /2)
584584}
585585
586586inline CTransactionRef make_tx (std::vector<CAmount>&& output_values, std::vector<CTransactionRef>&& inputs=std::vector<CTransactionRef>(), std::vector<uint32_t>&& input_indices=std::vector<uint32_t>())
0 commit comments