Changeset View
Changeset View
Standalone View
Standalone View
src/miner.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
// Container for tracking updates to ancestor feerate as we include (parent) | // Container for tracking updates to ancestor feerate as we include (parent) | ||||
// transactions in a block | // transactions in a block | ||||
struct CTxMemPoolModifiedEntry { | struct CTxMemPoolModifiedEntry { | ||||
explicit CTxMemPoolModifiedEntry(CTxMemPool::txiter entry) { | explicit CTxMemPoolModifiedEntry(CTxMemPool::txiter entry) { | ||||
iter = entry; | iter = entry; | ||||
nSizeWithAncestors = entry->GetSizeWithAncestors(); | nSizeWithAncestors = entry->GetSizeWithAncestors(); | ||||
nVirtualSizeWithAncestors = entry->GetVirtualSizeWithAncestors(); | |||||
nModFeesWithAncestors = entry->GetModFeesWithAncestors(); | nModFeesWithAncestors = entry->GetModFeesWithAncestors(); | ||||
nSigOpCountWithAncestors = entry->GetSigOpCountWithAncestors(); | nSigOpCountWithAncestors = entry->GetSigOpCountWithAncestors(); | ||||
} | } | ||||
Amount GetModifiedFee() const { return iter->GetModifiedFee(); } | Amount GetModifiedFee() const { return iter->GetModifiedFee(); } | ||||
uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; } | uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; } | ||||
uint64_t GetVirtualSizeWithAncestors() const { | |||||
return nVirtualSizeWithAncestors; | |||||
} | |||||
Amount GetModFeesWithAncestors() const { return nModFeesWithAncestors; } | Amount GetModFeesWithAncestors() const { return nModFeesWithAncestors; } | ||||
size_t GetTxSize() const { return iter->GetTxSize(); } | size_t GetTxSize() const { return iter->GetTxSize(); } | ||||
size_t GetTxVirtualSize() const { return iter->GetTxVirtualSize(); } | |||||
const CTransaction &GetTx() const { return iter->GetTx(); } | const CTransaction &GetTx() const { return iter->GetTx(); } | ||||
CTxMemPool::txiter iter; | CTxMemPool::txiter iter; | ||||
uint64_t nSizeWithAncestors; | uint64_t nSizeWithAncestors; | ||||
uint64_t nVirtualSizeWithAncestors; | |||||
Amount nModFeesWithAncestors; | Amount nModFeesWithAncestors; | ||||
int64_t nSigOpCountWithAncestors; | int64_t nSigOpCountWithAncestors; | ||||
}; | }; | ||||
/** | /** | ||||
* Comparator for CTxMemPool::txiter objects. | * Comparator for CTxMemPool::txiter objects. | ||||
* It simply compares the internal memory address of the CTxMemPoolEntry object | * It simply compares the internal memory address of the CTxMemPoolEntry object | ||||
* pointed to. This means it has no meaning, and is only useful for using them | * pointed to. This means it has no meaning, and is only useful for using them | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | typedef indexed_modified_transaction_set::index<ancestor_score>::type::iterator | ||||
modtxscoreiter; | modtxscoreiter; | ||||
struct update_for_parent_inclusion { | struct update_for_parent_inclusion { | ||||
explicit update_for_parent_inclusion(CTxMemPool::txiter it) : iter(it) {} | explicit update_for_parent_inclusion(CTxMemPool::txiter it) : iter(it) {} | ||||
void operator()(CTxMemPoolModifiedEntry &e) { | void operator()(CTxMemPoolModifiedEntry &e) { | ||||
e.nModFeesWithAncestors -= iter->GetFee(); | e.nModFeesWithAncestors -= iter->GetFee(); | ||||
e.nSizeWithAncestors -= iter->GetTxSize(); | e.nSizeWithAncestors -= iter->GetTxSize(); | ||||
e.nVirtualSizeWithAncestors -= iter->GetTxVirtualSize(); | |||||
e.nSigOpCountWithAncestors -= iter->GetSigOpCount(); | e.nSigOpCountWithAncestors -= iter->GetSigOpCount(); | ||||
} | } | ||||
CTxMemPool::txiter iter; | CTxMemPool::txiter iter; | ||||
}; | }; | ||||
/** Generate a new block, without valid proof-of-work */ | /** Generate a new block, without valid proof-of-work */ | ||||
class BlockAssembler { | class BlockAssembler { | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |