6 #ifndef BITCOIN_MINER_H 7 #define BITCOIN_MINER_H 12 #include <boost/multi_index/ordered_index.hpp> 13 #include <boost/multi_index_container.hpp> 35 : tx(_tx), fees(_fees), sigOpCount(_sigOpCount){};
49 nSizeWithAncestors = entry->GetSizeWithAncestors();
50 nModFeesWithAncestors = entry->GetModFeesWithAncestors();
51 nSigOpCountWithAncestors = entry->GetSigOpCountWithAncestors();
56 uint64_t GetVirtualSizeWithAncestors()
const;
58 size_t GetTxSize()
const {
return iter->GetTxSize(); }
94 if (a->GetCountWithAncestors() != b->GetCountWithAncestors()) {
95 return a->GetCountWithAncestors() < b->GetCountWithAncestors();
101 typedef boost::multi_index_container<
103 boost::multi_index::indexed_by<
107 boost::multi_index::ordered_non_unique<
109 boost::multi_index::tag<ancestor_score>,
110 boost::multi_index::identity<CTxMemPoolModifiedEntry>,
114 typedef indexed_modified_transaction_set::nth_index<0>::type::iterator
116 typedef indexed_modified_transaction_set::index<ancestor_score>::type::iterator
172 std::unique_ptr<CBlockTemplate>
173 CreateNewBlock(
const CScript &scriptPubKeyIn);
193 void addPackageTxs(
int &nPackagesSelected,
int &nDescendantsUpdated)
200 bool TestPackage(uint64_t packageSize, int64_t packageSigOpCount)
const;
218 std::vector<CTxMemPool::txiter> &sortedEntries);
231 uint64_t nExcessiveBlockSize,
232 unsigned int &nExtraNonce);
235 #endif // BITCOIN_MINER_H std::shared_ptr< const CTransaction > CTransactionRef
void operator()(CTxMemPoolModifiedEntry &e)
const CTransaction & GetTx() const
indexed_modified_transaction_set::nth_index< 0 >::type::iterator modtxiter
Comparator for CTxMemPool::txiter objects.
indexed_transaction_set::nth_index< 0 >::type::const_iterator txiter
uint64_t nExcessiveBlockSize
bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) const
void IncrementExtraNonce(CBlock *pblock, const CBlockIndex *pindexPrev, uint64_t nExcessiveBlockSize, unsigned int &nExtraNonce)
Modify the extranonce in a block.
CTxMemPool::setEntries inBlock
std::unique_ptr< CBlockTemplate > pblocktemplate
Amount GetModFeesWithAncestors() const
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
uint64_t nMaxGeneratedBlockSize
indexed_modified_transaction_set::index< ancestor_score >::type::iterator modtxscoreiter
CTxMemPool::txiter result_type
int64_t UpdateTime(CBlockHeader *pblock, const CChainParams &chainParams, const CBlockIndex *pindexPrev)
uint64_t nMaxGeneratedBlockSize
update_for_parent_inclusion(CTxMemPool::txiter it)
int64_t nSigOpCountWithAncestors
std::set< txiter, CompareIteratorById > setEntries
Generate a new block, without valid proof-of-work.
Amount nModFeesWithAncestors
static std::optional< int64_t > m_last_block_size
const CTxMemPool & m_mempool
uint64_t nSizeWithAncestors
uint64_t GetSizeWithAncestors() const
size_t GetTxVirtualSize() const
#define EXCLUSIVE_LOCKS_REQUIRED(...)
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
The block chain is a tree shaped structure starting with the genesis block at the root...
const CChainParams & Params()
Return the currently selected parameters.
Serialized script, used inside transaction inputs and outputs.
std::vector< CBlockTemplateEntry > entries
uint64_t GetMaxGeneratedBlockSize() const
Fee rate in satoshis per kilobyte: Amount / kB.
CTxMemPoolModifiedEntry(CTxMemPool::txiter entry)
bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) const
uint64_t nMaxGeneratedBlockSigChecks
CBlockTemplateEntry(CTransactionRef _tx, Amount _fees, int64_t _sigOpCount)
The basic transaction that is broadcasted on the network and contained in blocks. ...
const CChainParams & chainParams
static const bool DEFAULT_PRINTPRIORITY
static std::optional< int64_t > m_last_block_num_txs
result_type operator()(const CTxMemPoolModifiedEntry &entry) const
Amount GetModifiedFee() const
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it...
boost::multi_index_container< CTxMemPoolModifiedEntry, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< modifiedentry_iter, CompareCTxMemPoolIter >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ancestor_score >, boost::multi_index::identity< CTxMemPoolModifiedEntry >, CompareTxMemPoolEntryByAncestorFee > > > indexed_modified_transaction_set