|
30 | 30 | #include <node/peerman_args.h>
|
31 | 31 | #include <node/warnings.h>
|
32 | 32 | #include <noui.h>
|
| 33 | +#include <policy/coin_age_priority.h> |
33 | 34 | #include <policy/fees.h>
|
34 | 35 | #include <pow.h>
|
35 | 36 | #include <random.h>
|
@@ -520,6 +521,8 @@ CMutableTransaction TestChain100Setup::CreateValidMempoolTransaction(CTransactio
|
520 | 521 |
|
521 | 522 | std::vector<CTransactionRef> TestChain100Setup::PopulateMempool(FastRandomContext& det_rand, size_t num_transactions, bool submit)
|
522 | 523 | {
|
| 524 | + auto& active_chainstate = m_node.chainman->ActiveChainstate(); |
| 525 | + const auto height = active_chainstate.m_chain.Height(); |
523 | 526 | std::vector<CTransactionRef> mempool_transactions;
|
524 | 527 | std::deque<std::pair<COutPoint, CAmount>> unspent_prevouts;
|
525 | 528 | std::transform(m_coinbase_txns.begin(), m_coinbase_txns.end(), std::back_inserter(unspent_prevouts),
|
@@ -557,9 +560,11 @@ std::vector<CTransactionRef> TestChain100Setup::PopulateMempool(FastRandomContex
|
557 | 560 | if (submit) {
|
558 | 561 | LOCK2(cs_main, m_node.mempool->cs);
|
559 | 562 | LockPoints lp;
|
| 563 | + CAmount in_chain_input_value; |
| 564 | + double dPriority = GetPriority(*ptx, active_chainstate.CoinsTip(), height + 1, in_chain_input_value); |
560 | 565 | m_node.mempool->addUnchecked(CTxMemPoolEntry(ptx, /*fee=*/(total_in - num_outputs * amount_per_output),
|
561 |
| - /*time=*/0, /*entry_priority=*/0, /*entry_height=*/1, /*entry_sequence=*/0, |
562 |
| - /*in_chain_input_value=*/0, |
| 566 | + /*time=*/0, /*entry_priority=*/ dPriority, /*entry_height=*/ height, /*entry_sequence=*/0, |
| 567 | + in_chain_input_value, |
563 | 568 | /*spends_coinbase=*/false, /*sigops_cost=*/4, lp));
|
564 | 569 | }
|
565 | 570 | --num_transactions;
|
|
0 commit comments