aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
AgeCommit message (Collapse)Author
2016-01-05Bump copyright headers to 2015MarcoFalke
- Bump copyright headers to 2015 - [devtools] Rewrite fix-copyright-headers.py - [devtools] Use git pretty-format for year parsing Github-Pull: #7205 Rebased-From: fa6ad855e9159b2247da4fa0054f32fa181499ab fa24439ff3d8ab5b9efaf66ef4dae6713b88cb35 fa71669452e57039e4270fd2b33a0e0e1635b813
2015-12-21[Mempool] Fix mempool limiting and replace-by-fee for PrioritiseTransactionSuhas Daftuar
1) Fix mempool limiting for PrioritiseTransaction Redo the feerate index to be based on mining score, rather than fee. Update mempool_packages.py to test prioritisetransaction's effect on package scores. 2) Update replace-by-fee logic to use fee deltas 3) Use fee deltas for determining mempool acceptance 4) Remove GetMinRelayFee One test in AcceptToMemoryPool was to compare a transaction's fee agains the value returned by GetMinRelayFee. This value was zero for all small transactions. For larger transactions (between DEFAULT_BLOCK_PRIORITY_SIZE and MAX_STANDARD_TX_SIZE), this function was preventing low fee transactions from ever being accepted. With this function removed, we will now allow transactions in that range with fees (including modifications via PrioritiseTransaction) below the minRelayTxFee, provided that they have sufficient priority. Github-Pull: #7062 Rebased-From: eb306664e786ae43d539fde66f0fbe2a3e89d910 9ef2a25603c9ec4e44c4f45c6a5d4e4386ec86d3 27fae3484cdb21b0d24face833b966fce5926be5 901b01d674031f9aca717deeb372bafa160a24af
2015-12-01Get the set of now-uncacheable-txn from CTxMemPool::TrimToSizeMatt Corallo
2015-12-01Make accessing mempool parents and children publicAlex Morcos
2015-12-01Add TxPriority class and comparatorAlex Morcos
2015-12-01Add a score index to the mempool.Alex Morcos
The score index is meant to represent the order of priority for being included in a block for miners. Initially this is set to the transactions modified (by any feeDelta) fee rate. Index improvements and unit tests by sdaftuar.
2015-12-01Store the total sig op count of a tx.Alex Morcos
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.
2015-11-30Fix removeForReorg to use MedianTimePastSuhas Daftuar
2015-11-30Track coinbase spends in CTxMemPoolEntrySuhas Daftuar
This allows us to optimize CTxMemPool::removeForReorg.
2015-11-30Fix removal of time-locked transactions during reorgMatt Corallo
2015-11-19Change GetPriority calculation.Alex Morcos
Compute the value of inputs that already are in the chain at time of mempool entry and only increase priority due to aging for those inputs. This effectively changes the CTxMemPoolEntry's GetPriority calculation from an upper bound to a lower bound.
2015-11-19Modify variable names for entry height and priorityAlex Morcos
2015-11-19Remove default arguments for CTxMemPoolEntry()Alex Morcos
2015-11-27Merge pull request #6871Wladimir J. van der Laan
63b5840 Fix usage of local python-bitcoinlib (Peter Todd) 16a2f93 Fix incorrect locking of mempool during RBF replacement (Peter Todd) 97203f5 Port test to rpc-test framework (Suhas Daftuar) 20367d8 Add test for max replacement limit (Suhas Daftuar) 73d9040 Improve RBF replacement criteria (Suhas Daftuar) b272ecf Reject replacements that add new unconfirmed inputs (Peter Todd) fc8c19a Prevent low feerate txs from (directly) replacing high feerate txs (Peter Todd) 0137e6f Add tests for transaction replacement (Peter Todd) 5891f87 Add opt-in full-RBF to mempool (Peter Todd)
2015-11-16Add smart fee estimation functionsAlex Morcos
These are more useful fee and priority estimation functions. If there is no fee/pri high enough for the target you are aiming for, it will give you the estimate for the lowest target that you can reliably obtain. This is better than defaulting to the minimum. It will also pass back the target for which it returned an answer.
2015-11-10Improve RBF replacement criteriaSuhas Daftuar
Fix the calculation of conflicting size/conflicting fees.
2015-10-28Make -checkmempool=1 not fail through int32 overflowPieter Wuille
2015-10-28Merge pull request #6776Pieter Wuille
ab1f560 Support -checkmempool=N, which runs checks on average once every N transactions (Pieter Wuille)
2015-10-26fix locking issue with new mempool limitingJonas Schnelli
Current master crashes on OSX with an exception: "boost: mutex lock failed in pthread_mutex_lock: Invalid argument"
2015-10-20Support -checkmempool=N, which runs checks on average once every N transactionsPieter Wuille
2015-10-14Fix comment formatting tabsMatt Corallo
2015-10-13Add reasonable test case for mempool trimmingMatt Corallo
2015-10-13Implement on-the-fly mempool size limitation.Matt Corallo
After each transaction which is added to mempool, we first call Expire() to remove old transactions, then throwing away the lowest-feerate transactions. After throwing away transactions by feerate, we set the minimum relay fee to the maximum fee transaction-and-dependant-set we removed, plus the default minimum relay fee. After the next block is received, the minimum relay fee is allowed to decrease exponentially. Its halflife defaults to 12 hours, but is decreased to 6 hours if the mempool is smaller than half its maximum size, and 3 hours if the mempool is smaller than a quarter its maximum size. The minimum -maxmempool size is 40*-limitdescendantsize, as it is easy for an attacker to play games with the cheapest -limitdescendantsize transactions. -maxmempool defaults to 300MB. This disables high-priority transaction relay when the min relay fee adjustment is >0 (ie when the mempool is full). When the relay fee adjustment drops below the default minimum relay fee / 2 it is set to 0 (re-enabling priority-based free relay).
2015-10-13Track (and define) ::minRelayTxFee in CTxMemPoolMatt Corallo
2015-10-13Fix calling mempool directly, instead of pool, in ATMPMatt Corallo
2015-10-13Add Mempool Expire function to remove old transactionsPieter Wuille
(note the 9x multiplier on (void*)'s for CTxMemPool::DynamicMemoryUsage was accidentally introduced in 5add7a7 but should have waited for this commit which adds the extra index)
2015-10-13Reverse the sort on the mempool's feerate indexSuhas Daftuar
2015-09-23Fix mempool package tracking edge caseSuhas Daftuar
CalculateMemPoolAncestors was always looping over a transaction's inputs to find in-mempool parents. When adding a new transaction, this is the correct behavior, but when removing a transaction, we want to use the ancestor set that would be calculated by walking mapLinks (which should in general be the same set, except during a reorg when the mempool is in an inconsistent state, and the mapLinks-based calculation would be the correct one).
2015-09-19Track transaction packages in CTxMemPoolEntrySuhas Daftuar
Associate with each CTxMemPoolEntry all the size/fees of descendant mempool transactions. Sort mempool by max(feerate of entry, feerate of descendants). Update statistics on-the-fly as transactions enter or leave the mempool. Also add ancestor and descendant limiting, so that transactions can be rejected if the number or size of unconfirmed ancestors exceeds a target, or if adding a transaction would cause some other mempool entry to have too many (or too large) a set of unconfirmed in- mempool descendants.
2015-09-19TxMemPool: Change mapTx to a boost::multi_index_containerAshley Holman
Indexes on: - Tx Hash - Fee Rate (fee-per-kb)
2015-07-10Implement accurate memory accounting for mempoolPieter Wuille
2015-05-13Create new BlockPolicyEstimator for fee estimatesAlex Morcos
This class groups transactions that have been confirmed in blocks into buckets, based on either their fee or their priority. Then for each bucket, the class calculates what percentage of the transactions were confirmed within various numbers of blocks. It does this by keeping an exponentially decaying moving history for each bucket and confirm block count of the percentage of transactions in that bucket that were confirmed within that number of blocks. -Eliminate txs which didn't have all inputs available at entry from fee/pri calcs -Add dynamic breakpoints and tracking of confirmation delays in mempool transactions -Remove old CMinerPolicyEstimator and CBlockAverage code -New smartfees.py -Pass a flag to the estimation code, using IsInitialBlockDownload as a proxy for when we are still catching up and we shouldn't be counting how many blocks it takes for transactions to be included. -Add a policyestimator unit test
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-08Remove txn which are invalidated by coinbase maturity during reorgMatt Corallo
2014-12-03MOVEONLY: core/ -> primitives/Luke Dashjr
2014-11-19[Qt] Add Smartfee to GUICozz Lovan
2014-11-17Update comments in txmempool to be doxygen compatibleMichael Ford
Fix typo in Read() error message
2014-10-27MOVEONLY: Separate CTransaction and dependencies from corejtimon
2014-10-27MOVEONLY: Move CFeeRate and Amount constants to amount.ojtimon
2014-10-22boost: split stream classes out of serialize.hCory Fields
serialization now has no dependencies.
2014-10-17MOVEONLY: CInPoint from core to txmempooljtimon
2014-10-08Merge pull request #4834Pieter Wuille
7c70438 Get rid of the dummy CCoinsViewCache constructor arg (Pieter Wuille) ed27e53 Add coins_tests with a large randomized CCoinViewCache test. (Pieter Wuille) 058b08c Do not keep fully spent but unwritten CCoins entries cached. (Pieter Wuille) c9d1a81 Get rid of CCoinsView's SetCoins and SetBestBlock. (Pieter Wuille) f28aec0 Use ModifyCoins instead of mutable GetCoins. (Pieter Wuille)
2014-09-26Use a typedef for monetary valuesMark Friedenbach
2014-09-24Get rid of the dummy CCoinsViewCache constructor argPieter Wuille
2014-09-08Track modified size in TxMemPoolEntry so that we can correctly compute priority.Alex Morcos
2014-08-28add missing header end commentsPhilip Kaufmann
- ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files
2014-08-26Use const CCoinsView's at some places.Daniel Kraft
At some places where it is possible (e. g., CheckInputs), use a const version of CCoinsView instead of a non-const one.
2014-08-26Make appropriate getter-routines "const" in CCoinsView.Daniel Kraft
Mark the "Get"/"Have" routines in CCoinsView and subclasses as "const".
2014-08-14Closely track mempool byte total. Add "getmempoolinfo" RPC.Jeff Garzik
Goal: Gain live insight into the mempool. Groundwork for future work that caps mempool size.
2014-07-03Move fee policy out of coreGavin Andresen