Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | private: | ||||
// Information about descendants of this transaction that are in the | // Information about descendants of this transaction that are in the | ||||
// mempool; if we remove this transaction we must remove all of these | // mempool; if we remove this transaction we must remove all of these | ||||
// descendants as well. | // descendants as well. | ||||
//!< number of descendant transactions | //!< number of descendant transactions | ||||
uint64_t nCountWithDescendants; | uint64_t nCountWithDescendants; | ||||
//!< ... and size | //!< ... and size | ||||
uint64_t nSizeWithDescendants; | uint64_t nSizeWithDescendants; | ||||
//!< ... and total fees (all including us) | //!< ... and total fees (all including us) | ||||
Amount nModFeesWithDescendants; | Amount nModFeesWithDescendants; | ||||
//!< ... and sigop count | |||||
int64_t nSigOpCountWithDescendants; | |||||
// Analogous statistics for ancestor transactions | // Analogous statistics for ancestor transactions | ||||
uint64_t nCountWithAncestors; | uint64_t nCountWithAncestors; | ||||
uint64_t nSizeWithAncestors; | uint64_t nSizeWithAncestors; | ||||
Amount nModFeesWithAncestors; | Amount nModFeesWithAncestors; | ||||
int64_t nSigOpCountWithAncestors; | int64_t nSigOpCountWithAncestors; | ||||
public: | public: | ||||
Show All 10 Lines | public: | ||||
unsigned int GetHeight() const { return entryHeight; } | unsigned int GetHeight() const { return entryHeight; } | ||||
int64_t GetSigOpCount() const { return sigOpCount; } | int64_t GetSigOpCount() const { return sigOpCount; } | ||||
Amount GetModifiedFee() const { return nFee + feeDelta; } | Amount GetModifiedFee() const { return nFee + feeDelta; } | ||||
size_t DynamicMemoryUsage() const { return nUsageSize; } | size_t DynamicMemoryUsage() const { return nUsageSize; } | ||||
const LockPoints &GetLockPoints() const { return lockPoints; } | const LockPoints &GetLockPoints() const { return lockPoints; } | ||||
// Adjusts the descendant state. | // Adjusts the descendant state. | ||||
void UpdateDescendantState(int64_t modifySize, Amount modifyFee, | void UpdateDescendantState(int64_t modifySize, Amount modifyFee, | ||||
int64_t modifyCount); | int64_t modifyCount, int64_t modifySigOpCount); | ||||
// Adjusts the ancestor state | // Adjusts the ancestor state | ||||
void UpdateAncestorState(int64_t modifySize, Amount modifyFee, | void UpdateAncestorState(int64_t modifySize, Amount modifyFee, | ||||
int64_t modifyCount, int modifySigOps); | int64_t modifyCount, int modifySigOps); | ||||
// Updates the fee delta used for mining priority score, and the | // Updates the fee delta used for mining priority score, and the | ||||
// modified fees with descendants. | // modified fees with descendants. | ||||
void UpdateFeeDelta(Amount feeDelta); | void UpdateFeeDelta(Amount feeDelta); | ||||
// Update the LockPoints after a reorg | // Update the LockPoints after a reorg | ||||
void UpdateLockPoints(const LockPoints &lp); | void UpdateLockPoints(const LockPoints &lp); | ||||
uint64_t GetCountWithDescendants() const { return nCountWithDescendants; } | uint64_t GetCountWithDescendants() const { return nCountWithDescendants; } | ||||
uint64_t GetSizeWithDescendants() const { return nSizeWithDescendants; } | uint64_t GetSizeWithDescendants() const { return nSizeWithDescendants; } | ||||
Amount GetModFeesWithDescendants() const { return nModFeesWithDescendants; } | Amount GetModFeesWithDescendants() const { return nModFeesWithDescendants; } | ||||
int64_t GetSigOpCountWithDescendants() const { | |||||
return nSigOpCountWithDescendants; | |||||
} | |||||
bool GetSpendsCoinbase() const { return spendsCoinbase; } | bool GetSpendsCoinbase() const { return spendsCoinbase; } | ||||
uint64_t GetCountWithAncestors() const { return nCountWithAncestors; } | uint64_t GetCountWithAncestors() const { return nCountWithAncestors; } | ||||
uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; } | uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; } | ||||
Amount GetModFeesWithAncestors() const { return nModFeesWithAncestors; } | Amount GetModFeesWithAncestors() const { return nModFeesWithAncestors; } | ||||
int64_t GetSigOpCountWithAncestors() const { | int64_t GetSigOpCountWithAncestors() const { | ||||
return nSigOpCountWithAncestors; | return nSigOpCountWithAncestors; | ||||
} | } | ||||
//!< Index in mempool's vTxHashes | //!< Index in mempool's vTxHashes | ||||
mutable size_t vTxHashesIdx; | mutable size_t vTxHashesIdx; | ||||
}; | }; | ||||
// Helpers for modifying CTxMemPool::mapTx, which is a boost multi_index. | // Helpers for modifying CTxMemPool::mapTx, which is a boost multi_index. | ||||
struct update_descendant_state { | struct update_descendant_state { | ||||
update_descendant_state(int64_t _modifySize, Amount _modifyFee, | update_descendant_state(int64_t _modifySize, Amount _modifyFee, | ||||
int64_t _modifyCount) | int64_t _modifyCount, int64_t _modifySigOpCount) | ||||
: modifySize(_modifySize), modifyFee(_modifyFee), | : modifySize(_modifySize), modifyFee(_modifyFee), | ||||
modifyCount(_modifyCount) {} | modifyCount(_modifyCount), modifySigOpCount(_modifySigOpCount) {} | ||||
void operator()(CTxMemPoolEntry &e) { | void operator()(CTxMemPoolEntry &e) { | ||||
e.UpdateDescendantState(modifySize, modifyFee, modifyCount); | e.UpdateDescendantState(modifySize, modifyFee, modifyCount, | ||||
modifySigOpCount); | |||||
} | } | ||||
private: | private: | ||||
int64_t modifySize; | int64_t modifySize; | ||||
Amount modifyFee; | Amount modifyFee; | ||||
int64_t modifyCount; | int64_t modifyCount; | ||||
int64_t modifySigOpCount; | |||||
}; | }; | ||||
struct update_ancestor_state { | struct update_ancestor_state { | ||||
update_ancestor_state(int64_t _modifySize, Amount _modifyFee, | update_ancestor_state(int64_t _modifySize, Amount _modifyFee, | ||||
int64_t _modifyCount, int64_t _modifySigOpCount) | int64_t _modifyCount, int64_t _modifySigOpCount) | ||||
: modifySize(_modifySize), modifyFee(_modifyFee), | : modifySize(_modifySize), modifyFee(_modifyFee), | ||||
modifyCount(_modifyCount), modifySigOpCount(_modifySigOpCount) {} | modifyCount(_modifyCount), modifySigOpCount(_modifySigOpCount) {} | ||||
▲ Show 20 Lines • Show All 795 Lines • Show Last 20 Lines |