aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2015-10-26 11:08:46 -0400
committerAlex Morcos <morcos@chaincode.com>2015-12-01 10:10:25 -0500
commitc49d5bc9e6c97c47c0bd78604b2c393a7e4af097 (patch)
tree4018d21e32637d0acfda7fb88e24a21415baf6e4 /src/txmempool.h
parent16f4a6e0fe267e38d14f887e124ee9ca8894267a (diff)
Store the total sig op count of a tx.
Store sum of legacy and P2SH sig op counts. This is calculated in AcceptToMemory pool and storing it saves redoing the expensive calculation in block template creation.
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index c4ea51557c..334b547823 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -68,6 +68,7 @@ private:
bool hadNoDependencies; //! Not dependent on any other txs when it entered the mempool
CAmount inChainInputValue; //! Sum of all txin values that are already in blockchain
bool spendsCoinbase; //! keep track of transactions that spend a coinbase
+ unsigned int sigOpCount; //! Legacy sig ops plus P2SH sig op count
// Information about descendants of this transaction that are in the
// mempool; if we remove this transaction we must remove all of these
@@ -81,7 +82,8 @@ private:
public:
CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee,
int64_t _nTime, double _entryPriority, unsigned int _entryHeight,
- bool poolHasNoInputsOf, CAmount _inChainInputValue, bool spendsCoinbase);
+ bool poolHasNoInputsOf, CAmount _inChainInputValue, bool spendsCoinbase,
+ unsigned int nSigOps);
CTxMemPoolEntry(const CTxMemPoolEntry& other);
const CTransaction& GetTx() const { return this->tx; }
@@ -95,6 +97,7 @@ public:
int64_t GetTime() const { return nTime; }
unsigned int GetHeight() const { return entryHeight; }
bool WasClearAtEntry() const { return hadNoDependencies; }
+ unsigned int GetSigOpCount() const { return sigOpCount; }
size_t DynamicMemoryUsage() const { return nUsageSize; }
// Adjusts the descendant state, if this entry is not dirty.