|
5 | 5 | #ifndef BITCOIN_NODE_MINI_MINER_H
|
6 | 6 | #define BITCOIN_NODE_MINI_MINER_H
|
7 | 7 |
|
8 |
| -#include <txmempool.h> |
| 8 | +#include <consensus/amount.h> |
| 9 | +#include <primitives/transaction.h> |
| 10 | +#include <uint256.h> |
9 | 11 |
|
| 12 | +#include <map> |
10 | 13 | #include <memory>
|
11 | 14 | #include <optional>
|
| 15 | +#include <set> |
12 | 16 | #include <stdint.h>
|
| 17 | +#include <vector> |
| 18 | + |
| 19 | +class CFeeRate; |
| 20 | +class CTxMemPool; |
13 | 21 |
|
14 | 22 | namespace node {
|
15 | 23 |
|
16 | 24 | // Container for tracking updates to ancestor feerate as we include ancestors in the "block"
|
17 | 25 | class MiniMinerMempoolEntry
|
18 | 26 | {
|
19 |
| - const CAmount fee_individual; |
20 | 27 | const CTransactionRef tx;
|
21 | 28 | const int64_t vsize_individual;
|
22 |
| - CAmount fee_with_ancestors; |
23 | 29 | int64_t vsize_with_ancestors;
|
| 30 | + const CAmount fee_individual; |
| 31 | + CAmount fee_with_ancestors; |
24 | 32 |
|
25 | 33 | // This class must be constructed while holding mempool.cs. After construction, the object's
|
26 | 34 | // methods can be called without holding that lock.
|
27 | 35 |
|
28 | 36 | public:
|
29 |
| - explicit MiniMinerMempoolEntry(CTxMemPool::txiter entry) : |
30 |
| - fee_individual{entry->GetModifiedFee()}, |
31 |
| - tx{entry->GetSharedTx()}, |
32 |
| - vsize_individual(entry->GetTxSize()), |
33 |
| - fee_with_ancestors{entry->GetModFeesWithAncestors()}, |
34 |
| - vsize_with_ancestors(entry->GetSizeWithAncestors()) |
| 37 | + explicit MiniMinerMempoolEntry(CAmount fee_self, |
| 38 | + CAmount fee_ancestor, |
| 39 | + int64_t vsize_self, |
| 40 | + int64_t vsize_ancestor, |
| 41 | + const CTransactionRef& tx_in): |
| 42 | + tx{tx_in}, |
| 43 | + vsize_individual{vsize_self}, |
| 44 | + vsize_with_ancestors{vsize_ancestor}, |
| 45 | + fee_individual{fee_self}, |
| 46 | + fee_with_ancestors{fee_ancestor} |
35 | 47 | { }
|
36 | 48 |
|
37 | 49 | CAmount GetModifiedFee() const { return fee_individual; }
|
|
0 commit comments