aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge #7976: Remove obsolete reference to CValidationState from UpdateCoins.Wladimir J. van der Laan2016-05-091-2/+2
|\ \ | | | | | | | | | c8b9248 Remove obsolete reference to CValidationState from UpdateCoins. (21E14)
| * | Remove obsolete reference to CValidationState from UpdateCoins.21E142016-04-301-2/+2
| |/
* | Merge #7840: Several performance and privacy improvements to inv/mempool ↵Wladimir J. van der Laan2016-05-051-0/+27
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | handling b559914 Move bloom and feerate filtering to just prior to tx sending. (Gregory Maxwell) 4578215 Return mempool queries in dependency order (Pieter Wuille) ed70683 Handle mempool requests in send loop, subject to trickle (Pieter Wuille) dc13dcd Split up and optimize transaction and block inv queues (Pieter Wuille) f2d3ba7 Eliminate TX trickle bypass, sort TX invs for privacy and priority. (Gregory Maxwell)
| * | Return mempool queries in dependency orderPieter Wuille2016-04-211-0/+12
| | |
| * | Eliminate TX trickle bypass, sort TX invs for privacy and priority.Gregory Maxwell2016-04-201-0/+15
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously Bitcoin would send 1/4 of transactions out to all peers instantly. This causes high overhead because it makes >80% of INVs size 1. Doing so harms privacy, because it limits the amount of source obscurity a transaction can receive. These randomized broadcasts also disobeyed transaction dependencies and required use of the orphan pool. Because the orphan pool is so small this leads to poor propagation for dependent transactions. When the bypass wasn't in effect, transactions were sent in the order they were received. This avoided creating orphans but undermines privacy fairly significantly. This commit: Eliminates the bypass. The bypass is replaced by halving the average delay for outbound peers. Sorts candidate transactions for INV by their topological depth then by their feerate (then hash); removing the information leakage and providing priority service to higher fee transactions. Limits the amount of transactions sent in a single INV to 7tx/sec (and twice that for outbound); this limits the harm of low fee transaction floods, gives faster relay service to higher fee transactions. The 7 sounds lower than it really is because received advertisements need not be sent, and because the aggregate rate is multipled by the number of peers.
* / [trivial] Add missing const qualifiers.Daniel Kraft2016-04-301-1/+1
|/ | | | | Add some const qualifiers to references that are not modified and should be marked as const.
* Implement "feefilter" P2P message.Alex Morcos2016-03-211-0/+10
| | | | The "feefilter" p2p message is used to inform other nodes of your mempool min fee which is the feerate that any new transaction must meet to be accepted to your mempool. This will allow them to filter invs to you according to this feerate.
* Merge #7594: Mempool: Add tracking of ancestor packagesWladimir J. van der Laan2016-03-171-75/+113
|\ | | | | | | | | | | | | | | | | ce019bf Check all ancestor state in CTxMemPool::check() (Suhas Daftuar) e2eeb5d Add ancestor feerate index to mempool (Suhas Daftuar) 72abd2c Add ancestor tracking to mempool (Suhas Daftuar) 76a7632 Remove work limit in UpdateForDescendants() (Suhas Daftuar) 5de2baa Rename CTxMemPool::remove -> removeRecursive (Suhas Daftuar) 7659438 CTxMemPool::removeForBlock now uses RemoveStaged (Suhas Daftuar)
| * Check all ancestor state in CTxMemPool::check()Suhas Daftuar2016-03-141-5/+22
| |
| * Add ancestor feerate index to mempoolSuhas Daftuar2016-03-141-2/+2
| |
| * Add ancestor tracking to mempoolSuhas Daftuar2016-03-141-15/+73
| | | | | | | | | | | | | | This implements caching of ancestor state to each mempool entry, similar to descendant tracking, but also including caching sigops-with-ancestors (as that metric will be helpful to future code that implements better transaction selection in CreatenewBlock).
| * Remove work limit in UpdateForDescendants()Suhas Daftuar2016-03-141-48/+11
| | | | | | | | | | | | | | | | | | | | | | The work limit served to prevent the descendant walking algorithm from doing too much work by marking the parent transaction as dirty. However to implement ancestor tracking, it's not possible to similarly mark those descendant transactions as dirty without having to calculate them to begin with. This commit removes the work limit altogether. With appropriate chain limits (-limitdescendantcount) the concern about doing too much work inside this function should be mitigated.
| * Rename CTxMemPool::remove -> removeRecursiveSuhas Daftuar2016-03-141-11/+7
| | | | | | | | | | remove is no longer called non-recursively, so simplify the logic and eliminate an unnecessary parameter
| * CTxMemPool::removeForBlock now uses RemoveStagedSuhas Daftuar2016-03-141-2/+6
| |
* | Merge #7187: Keep reorgs fast for SequenceLocks checksWladimir J. van der Laan2016-03-161-3/+15
|\ \ | |/ |/| | | 982670c Add LockPoints (Alex Morcos)
| * Add LockPointsAlex Morcos2016-03-161-3/+15
| | | | | | | | Obtain LockPoints to store in CTxMemPoolEntry and during a reorg, evaluate whether they are still valid and if not, recalculate them.
* | Add tags to mempool's mapTx indicesSuhas Daftuar2016-02-161-3/+3
|/
* Merge #7184: Implement SequenceLocks functions for BIP 68Wladimir J. van der Laan2016-02-121-1/+1
|\ | | | | | | | | | | | | b043c4b fix sdaftuar's nits again (Alex Morcos) a51c79b Bug fix to RPC test (Alex Morcos) da6ad5f Add RPC test exercising BIP68 (mempool only) (Suhas Daftuar) c6c2f0f Implement SequenceLocks functions (Alex Morcos)
| * Implement SequenceLocks functionsAlex Morcos2016-02-101-1/+1
| | | | | | | | | | | | | | SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68. The majority of this code is copied from maaku in #6312 Further credit: btcdrak, sipa, NicolasDorier
* | Merge pull request #7205Wladimir J. van der Laan2016-01-051-1/+1
|\ \ | | | | | | | | | | | | | | | fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke) fa24439 Bump copyright headers to 2015 (MarcoFalke) fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
| * | Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
| |/
* / Fix mempool limiting for PrioritiseTransactionSuhas Daftuar2015-12-021-23/+30
|/ | | | | | | 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.
* 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
|