aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Get the set of now-uncacheable-txn from CTxMemPool::TrimToSizeMatt Corallo2015-12-011-2/+20
|
* Add a score index to the mempool.Alex Morcos2015-12-011-2/+22
| | | | 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.
* Store the total sig op count of a tx.Alex Morcos2015-12-011-2/+2
| | | | 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.
* Fix removeForReorg to use MedianTimePastSuhas Daftuar2015-11-301-2/+2
|
* Track coinbase spends in CTxMemPoolEntrySuhas Daftuar2015-11-301-3/+5
| | | | This allows us to optimize CTxMemPool::removeForReorg.
* Fix comment in removeForReorgMatt Corallo2015-11-301-1/+1
|
* Fix removal of time-locked transactions during reorgMatt Corallo2015-11-301-10/+15
|
* Change GetPriority calculation.Alex Morcos2015-11-191-5/+8
| | | | 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.
* Modify variable names for entry height and priorityAlex Morcos2015-11-191-5/+5
|
* Pass reference to estimateSmartFee and cleanup whitespaceSuhas Daftuar2015-11-241-2/+2
|
* EstimateSmart functions consider mempool min feeAlex Morcos2015-11-161-2/+2
|
* Add smart fee estimation functionsAlex Morcos2015-11-161-0/+10
| | | | 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.
* Merge pull request #6776Pieter Wuille2015-10-281-3/+6
|\ | | | | | | ab1f560 Support -checkmempool=N, which runs checks on average once every N transactions (Pieter Wuille)
| * Support -checkmempool=N, which runs checks on average once every N transactionsPieter Wuille2015-10-201-3/+6
| |
* | Merge pull request #6464Wladimir J. van der Laan2015-10-271-0/+1
|\ \ | | | | | | | | | 2d8c49d Clean up tx prioritization when conflict mined (Casey Rodarmor)
| * | Clean up tx prioritization when conflict minedCasey Rodarmor2015-08-031-0/+1
| | |
* | | fix locking issue with new mempool limitingJonas Schnelli2015-10-261-3/+8
| | | | | | | | | | | | Current master crashes on OSX with an exception: "boost: mutex lock failed in pthread_mutex_lock: Invalid argument"
* | | Fix stale comment in CTxMemPool::TrimToSize.Matt Corallo2015-10-191-4/+4
| | |
* | | Undo GetMinFee-requires-extra-call-to-hit-0Matt Corallo2015-10-141-1/+3
| | |
* | | Implement on-the-fly mempool size limitation.Matt Corallo2015-10-131-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Track (and define) ::minRelayTxFee in CTxMemPoolMatt Corallo2015-10-131-2/+3
| | |
* | | Fix calling mempool directly, instead of pool, in ATMPMatt Corallo2015-10-131-2/+2
| | |
* | | Add Mempool Expire function to remove old transactionsPieter Wuille2015-10-131-0/+16
| |/ |/| | | | | | | | | (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)
* | Fix mempool package tracking edge caseSuhas Daftuar2015-09-231-15/+36
| | | | | | | | | | | | | | | | | | | | 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).
* | Track transaction packages in CTxMemPoolEntrySuhas Daftuar2015-09-191-42/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | TxMemPool: Change mapTx to a boost::multi_index_containerAshley Holman2015-09-191-24/+28
| | | | | | | | | | | | Indexes on: - Tx Hash - Fee Rate (fee-per-kb)
* | Make sure LogPrintf strings are line-terminatedWladimir J. van der Laan2015-08-031-2/+2
|/ | | | | | | Fix the cases where LogPrint[f] was accidentally called without line terminator, which resulted in concatenated log lines. (see e.g. #6492)
* Separate core memory usage computation in core_memusage.hPieter Wuille2015-07-201-1/+1
|
* Implement accurate memory accounting for mempoolPieter Wuille2015-07-101-1/+13
|
* Fix various warningsLuke Dashjr2015-06-231-1/+1
| | | | Found while building on Debian 7
* Consensus: MOVEONLY: Move CValidationState from main consensus/validationjtimon2015-05-151-0/+1
|
* Merge pull request #5159Wladimir J. van der Laan2015-05-131-353/+29
|\ | | | | | | b649e03 Create new BlockPolicyEstimator for fee estimates (Alex Morcos)
| * Create new BlockPolicyEstimator for fee estimatesAlex Morcos2015-05-131-353/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Consensus: Create consensus/consensus.h with some constantsjtimon2015-04-201-0/+1
|/
* Keep mempool consistent during block-reorgsGavin Andresen2015-03-261-0/+12
| | | | | | | | | | | | | | | | This fixes a subtle bug involving block re-orgs and non-standard transactions. Start with a block containing a non-standard transaction, and one or more transactions spending it in the memory pool. Then re-org away from that block to another chain that does not contain the non-standard transaction. Result before this fix: the dependent transactions get stuck in the mempool without their parent, putting the mempool in an inconsistent state. Tested with a new unit test.
* src/txmempool.cpp: make numEntries a uint32_tWladimir J. van der Laan2015-03-061-2/+2
| | | | | Don't ever serialize a size_t or long, their sizes are platform dependent.
* Remove whitespaces before double colon in errors and logsPavel Janík2015-01-311-4/+4
|
* Decouple miner.o and txmempool.o from CTxUndojtimon2014-12-271-4/+3
|
* Merge pull request #5481Wladimir J. van der Laan2014-12-231-8/+18
|\ | | | | | | 6484930 Apply AreSane() checks to the fees from the network. (Gregory Maxwell)
| * Apply AreSane() checks to the fees from the network.Gregory Maxwell2014-12-151-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'Sane' was already defined by this code as: fee.GetFeePerK() > minRelayFee.GetFeePerK() * 10000 But sanity was only enforced for data loaded from disk. Note that this is a pretty expansive definition of 'sane': A 10 BTC fee is still passes the test if its on a 100kb transaction. This prevents a single insane fee on the network from making us reject our stored fee data at start. We still may reject valid saved fee state if minRelayFee is changed between executions. This also reduces the risk and limits the damage from a cascading failure where one party pays a bunch of insane fees which cases others to pay insane fees.
* | Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | | | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* | make all catch() arguments constPhilip Kaufmann2014-12-171-2/+2
| | | | | | | | | | | | | | - I saw this on http://en.cppreference.com/w/cpp/language/try_catch and thought it would be a good idea - also unify used format to better be able to search for exception uses in our codebase
* | Fix small typos in comments and error messagesPavel Janík2014-12-161-2/+2
|/ | | | | Rebased-From: 67b2d819cdf6181e7f016e5366ce7479830893bd Github-Pull: #5404
* Make CTxMemPool::remove more effecient by avoiding recursionMatt Corallo2014-12-081-12/+18
|
* Make CTxMemPool::check more thourough by using CheckInputsMatt Corallo2014-12-081-1/+29
|
* Remove txn which are invalidated by coinbase maturity during reorgMatt Corallo2014-12-081-0/+26
|
* Update comments in txmempool to be doxygen compatibleMichael Ford2014-11-171-14/+24
| | | | Fix typo in Read() error message
* minor cleanup: include orders, end comments etc.Philip Kaufmann2014-10-311-3/+3
| | | | - no code changes
* Separate protocol versioning from clientversionCory Fields2014-10-291-0/+1
|
* MOVEONLY: Separate CTransaction and dependencies from corejtimon2014-10-271-1/+0
|