6 #ifndef BITCOIN_MINER_H 7 #define BITCOIN_MINER_H 17 #include <boost/multi_index_container.hpp> 18 #include <boost/multi_index/ordered_index.hpp> 42 nSizeWithAncestors = entry->GetSizeWithAncestors();
43 nModFeesWithAncestors = entry->GetModFeesWithAncestors();
44 nSigOpCostWithAncestors = entry->GetSigOpCostWithAncestors();
50 size_t GetTxSize()
const {
return iter->GetTxSize(); }
85 if (a->GetCountWithAncestors() != b->GetCountWithAncestors())
86 return a->GetCountWithAncestors() < b->GetCountWithAncestors();
91 typedef boost::multi_index_container<
93 boost::multi_index::indexed_by<
94 boost::multi_index::ordered_unique<
99 boost::multi_index::ordered_non_unique<
101 boost::multi_index::tag<ancestor_score>,
102 boost::multi_index::identity<CTxMemPoolModifiedEntry>,
108 typedef indexed_modified_transaction_set::nth_index<0>::type::iterator
modtxiter;
109 typedef indexed_modified_transaction_set::index<ancestor_score>::type::iterator
modtxscoreiter;
161 std::unique_ptr<CBlockTemplate> CreateNewBlock(
const CScript& scriptPubKeyIn);
183 bool TestPackage(uint64_t packageSize, int64_t packageSigOpsCost)
const;
207 #endif // BITCOIN_MINER_H const CTransaction & GetTx() const
indexed_modified_transaction_set::nth_index< 0 >::type::iterator modtxiter
Comparator for CTxMemPool::txiter objects.
static Optional< int64_t > m_last_block_num_txs
std::deque< CInv >::iterator it
unsigned int nBlockMaxWeight
indexed_transaction_set::nth_index< 0 >::type::const_iterator txiter
bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) const
CTxMemPool::setEntries inBlock
std::unique_ptr< CBlockTemplate > pblocktemplate
std::set< txiter, CompareIteratorByHash > setEntries
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
Transaction validation functions.
indexed_modified_transaction_set::index< ancestor_score >::type::iterator modtxscoreiter
int64_t CAmount
Amount in satoshis (Can be negative)
std::vector< int64_t > vTxSigOpsCost
CTxMemPool::txiter result_type
const CChainParams & chainparams
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
update_for_parent_inclusion(CTxMemPool::txiter it)
Generate a new block, without valid proof-of-work.
std::vector< CAmount > vTxFees
Parameters that influence chain consensus.
static Optional< int64_t > m_last_block_weight
int64_t UpdateTime(CBlockHeader *pblock, const Consensus::Params &consensusParams, const CBlockIndex *pindexPrev)
const CTxMemPool & m_mempool
uint64_t nSizeWithAncestors
uint64_t GetSizeWithAncestors() const
uint64_t nBlockSigOpsCost
CAmount nModFeesWithAncestors
void RegenerateCommitments(CBlock &block)
Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed...
#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.
int64_t GetModifiedFee() const
int64_t nSigOpCostWithAncestors
Fee rate in satoshis per kilobyte: CAmount / kB.
CAmount GetModFeesWithAncestors() const
CTxMemPoolModifiedEntry(CTxMemPool::txiter entry)
bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) const
void IncrementExtraNonce(CBlock *pblock, const CBlockIndex *pindexPrev, unsigned int &nExtraNonce)
Modify the extranonce in a block.
std::vector< unsigned char > vchCoinbaseCommitment
The basic transaction that is broadcasted on the network and contained in blocks. ...
static const bool DEFAULT_PRINTPRIORITY
std::optional< T > Optional
Substitute for C++17 std::optional DEPRECATED use std::optional in new code.
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it...