File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,23 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
427
427
sortedOrder.erase (sortedOrder.end ()-2 );
428
428
sortedOrder.insert (sortedOrder.begin (), tx7.GetHash ().ToString ());
429
429
CheckSort<ancestor_score>(pool, sortedOrder);
430
+
431
+ // High-fee parent, low-fee child
432
+ // tx7 -> tx8
433
+ CMutableTransaction tx8 = CMutableTransaction ();
434
+ tx8.vin .resize (1 );
435
+ tx8.vin [0 ].prevout = COutPoint (tx7.GetHash (), 0 );
436
+ tx8.vin [0 ].scriptSig = CScript () << OP_11;
437
+ tx8.vout .resize (1 );
438
+ tx8.vout [0 ].scriptPubKey = CScript () << OP_11 << OP_EQUAL;
439
+ tx8.vout [0 ].nValue = 10 *COIN;
440
+
441
+ // Check that we sort by min(feerate, ancestor_feerate):
442
+ // set the fee so that the ancestor feerate is above tx1/5,
443
+ // but the transaction's own feerate is lower
444
+ pool.addUnchecked (tx8.GetHash (), entry.Fee (5000LL ).FromTx (tx8));
445
+ sortedOrder.insert (sortedOrder.end ()-1 , tx8.GetHash ().ToString ());
446
+ CheckSort<ancestor_score>(pool, sortedOrder);
430
447
}
431
448
432
449
You can’t perform that action at this time.
0 commit comments