From 272b25a6a99057fdcd5db5bce70b49625e973080 Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Thu, 19 Jan 2017 13:58:42 -0500 Subject: [mining] Remove -blockprioritysize. Remove ability of mining code to fill part of a block with transactions sorted by coin age. --- src/txmempool.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/txmempool.h') diff --git a/src/txmempool.h b/src/txmempool.h index a7ecb64390..4cba024307 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -720,17 +720,4 @@ public: bool HaveCoins(const uint256 &txid) const; }; -// We want to sort transactions by coin age priority -typedef std::pair TxCoinAgePriority; - -struct TxCoinAgePriorityCompare -{ - bool operator()(const TxCoinAgePriority& a, const TxCoinAgePriority& b) - { - if (a.first == b.first) - return CompareTxMemPoolEntryByScore()(*(b.second), *(a.second)); //Reverse order to make sort less than - return a.first < b.first; - } -}; - #endif // BITCOIN_TXMEMPOOL_H -- cgit v1.2.3 From fe282acd7604b5265762b24e531bdf1ebb1f009b Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Thu, 19 Jan 2017 15:17:33 -0500 Subject: [cleanup] Remove estimatePriority and estimateSmartPriority Unused everywhere now except one test. --- src/txmempool.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/txmempool.h') diff --git a/src/txmempool.h b/src/txmempool.h index 4cba024307..4af85195c8 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -648,15 +648,6 @@ public: /** Estimate fee rate needed to get into the next nBlocks */ CFeeRate estimateFee(int nBlocks) const; - /** Estimate priority needed to get into the next nBlocks - * If no answer can be given at nBlocks, return an estimate - * at the lowest number of blocks where one can be given - */ - double estimateSmartPriority(int nBlocks, int *answerFoundAtBlocks = NULL) const; - - /** Estimate priority needed to get into the next nBlocks */ - double estimatePriority(int nBlocks) const; - /** Write/Read estimates to disk */ bool WriteFeeEstimates(CAutoFile& fileout) const; bool ReadFeeEstimates(CAutoFile& filein); -- cgit v1.2.3 From f8380054442d8aca4999277fe7617067edf231b9 Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Thu, 19 Jan 2017 22:07:56 -0500 Subject: No longer allow "free" transactions Remove -limitfreerelay and always enforce minRelayTxFee in the mempool (except from disconnected blocks) Remove -relaypriority, the option was only used for the ability to allow free transactions to be relayed regardless of their priority. Both notions no longer apply. --- src/txmempool.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/txmempool.h') diff --git a/src/txmempool.h b/src/txmempool.h index 4af85195c8..9af65bd077 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -30,18 +30,6 @@ class CAutoFile; class CBlockIndex; -inline double AllowFreeThreshold() -{ - return COIN * 144 / 250; -} - -inline bool AllowFree(double dPriority) -{ - // Large (in bytes) low-priority (new, small-coin) transactions - // need a fee. - return dPriority > AllowFreeThreshold(); -} - /** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */ static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF; -- cgit v1.2.3 From f9b9371c6027905f73a2558d6bcaca8a355c28a6 Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Thu, 19 Jan 2017 23:37:15 -0500 Subject: [rpc] Remove priorityDelta from prioritisetransaction This a breaking API change to the prioritisetransaction RPC call which previously required exactly three arguments and now requires exactly two (hash and feeDelta). The function prioritiseTransaction is also updated. --- src/txmempool.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/txmempool.h') diff --git a/src/txmempool.h b/src/txmempool.h index 9af65bd077..6b2e680305 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -501,7 +501,7 @@ private: public: indirectmap mapNextTx; - std::map > mapDeltas; + std::map mapDeltas; /** Create a new CTxMemPool. */ @@ -543,8 +543,8 @@ public: bool HasNoInputsOf(const CTransaction& tx) const; /** Affect CreateNewBlock prioritisation of transactions */ - void PrioritiseTransaction(const uint256& hash, double dPriorityDelta, const CAmount& nFeeDelta); - void ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) const; + void PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta); + void ApplyDelta(const uint256 hash, CAmount &nFeeDelta) const; void ClearPrioritisation(const uint256 hash); public: -- cgit v1.2.3 From 359e8a03d1667dca3e8375695131b8b5e6c54f0a Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Fri, 20 Jan 2017 09:24:35 -0500 Subject: [cleanup] Remove coin age priority completely. Remove GetPriority and ComputePriority. Remove internal machinery for tracking priority in CTxMemPoolEntry. --- src/txmempool.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/txmempool.h') diff --git a/src/txmempool.h b/src/txmempool.h index 6b2e680305..5d82e3016c 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -73,12 +73,9 @@ private: CTransactionRef tx; CAmount nFee; //!< Cached to avoid expensive parent-transaction lookups size_t nTxWeight; //!< ... and avoid recomputing tx weight (also used for GetTxSize()) - size_t nModSize; //!< ... and modified size for priority size_t nUsageSize; //!< ... and total memory usage int64_t nTime; //!< Local time when entering the mempool - double entryPriority; //!< Priority when entering the mempool unsigned int entryHeight; //!< Chain height when entering the mempool - CAmount inChainInputValue; //!< Sum of all txin values that are already in blockchain bool spendsCoinbase; //!< keep track of transactions that spend a coinbase int64_t sigOpCost; //!< Total sigop cost int64_t feeDelta; //!< Used for determining the priority of the transaction for mining in a block @@ -101,19 +98,14 @@ private: public: CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee, - int64_t _nTime, double _entryPriority, unsigned int _entryHeight, - CAmount _inChainInputValue, bool spendsCoinbase, + int64_t _nTime, unsigned int _entryHeight, + bool spendsCoinbase, int64_t nSigOpsCost, LockPoints lp); CTxMemPoolEntry(const CTxMemPoolEntry& other); const CTransaction& GetTx() const { return *this->tx; } CTransactionRef GetSharedTx() const { return this->tx; } - /** - * Fast calculation of lower bound of current priority as update - * from entry priority. Only inputs that were originally in-chain will age. - */ - double GetPriority(unsigned int currentHeight) const; const CAmount& GetFee() const { return nFee; } size_t GetTxSize() const; size_t GetTxWeight() const { return nTxWeight; } -- cgit v1.2.3