aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2015-10-29 14:06:13 -0400
committerSuhas Daftuar <sdaftuar@gmail.com>2015-11-30 13:12:53 -0500
commit7e49f5f8b4e237d7212d027a7bea4bbd52c9e7b6 (patch)
tree43ad2997b024e53c22b81c7d585e0a752c134167 /src/txmempool.h
parentbb8ea1f6304d7ed3f5fe0a01c060ac9f94629349 (diff)
Track coinbase spends in CTxMemPoolEntry
This allows us to optimize CTxMemPool::removeForReorg.
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 f45d5a2084..4c35f4ca08 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -67,6 +67,7 @@ private:
unsigned int entryHeight; //! Chain height when entering the mempool
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
// Information about descendants of this transaction that are in the
// mempool; if we remove this transaction we must remove all of these
@@ -80,7 +81,7 @@ private:
public:
CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee,
int64_t _nTime, double _entryPriority, unsigned int _entryHeight,
- bool poolHasNoInputsOf, CAmount _inChainInputValue);
+ bool poolHasNoInputsOf, CAmount _inChainInputValue, bool spendsCoinbase);
CTxMemPoolEntry(const CTxMemPoolEntry& other);
const CTransaction& GetTx() const { return this->tx; }
@@ -109,6 +110,8 @@ public:
uint64_t GetCountWithDescendants() const { return nCountWithDescendants; }
uint64_t GetSizeWithDescendants() const { return nSizeWithDescendants; }
CAmount GetFeesWithDescendants() const { return nFeesWithDescendants; }
+
+ bool GetSpendsCoinbase() const { return spendsCoinbase; }
};
// Helpers for modifying CTxMemPool::mapTx, which is a boost multi_index.