aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2016-06-03comment nit: miners don't voteinstagibbs
2016-06-03Merge #7942: locking for Misbehave() and other cs_main locking fixesWladimir J. van der Laan
719de56 lock cs_main for chainActive (Kaz Wesley) efb54ba lock cs_main for State/Misbehaving (Kaz Wesley)
2016-06-03Merge #7997: replace mapNextTx with slimmer setSpendsPieter Wuille
9805f4a mapNextTx: use pointer as key, simplify value (Kaz Wesley)
2016-06-02mapNextTx: use pointer as key, simplify valueKaz Wesley
Saves about 10% of application memory usage once the mempool warms up. Since the mempool is DynamicUsage-regulated, this will translate to a larger mempool in the same amount of space. Map value type: eliminate the vin index; no users of the map need to know which input of the transaction is spending the prevout. Map key type: replace the COutPoint with a pointer to a COutPoint. A COutPoint is 36 bytes, but each COutPoint is accessible from the same map entry's value. A trivial DereferencingComparator functor allows indirect map keys, but the resulting syntax is misleading: `map.find(&outpoint)`. Implement an indirectmap that acts as a wrapper to a map that uses a DereferencingComparator, supporting a syntax that accurately reflect the container's semantics: inserts and iterators use pointers since they store pointers and need them to remain constant and dereferenceable, but lookup functions take const references.
2016-06-01Merge #8077: Consensus: Decouple from chainparams.o and timedata.oPieter Wuille
ee9f4a5 Consensus: Decouple from chainparams.o and timedata.o (Jorge Timón)
2016-06-01Merge #7960: Only use AddInventoryKnown for transactionsPieter Wuille
383fc10 Only use AddInventoryKnown for transactions (Suhas Daftuar)
2016-05-31Defer inserting into maprelay until just before relaying.Gregory Maxwell
This reduces the rate of not founds by better matching the far end expectations, it also improves privacy by removing the ability to use getdata to probe for a node having a txn before it has been relayed.
2016-05-31Merge #8080: Do not use mempool for GETDATA for tx accepted after the last ↵Wladimir J. van der Laan
mempool req. 7e908c7 Do not use mempool for GETDATA for tx accepted after the last mempool req. (Gregory Maxwell)
2016-05-29Always require OS randomness when generating secret keysPieter Wuille
2016-05-26Merge #8049: Expose information on whether transaction relay is enabled in ↵Pieter Wuille
`getnetwork` 1ab1dc3 rpc: Add `relaytxes` flag to `getnetworkinfo` (Wladimir J. van der Laan) 581ddff net: Add fRelayTxes flag (Wladimir J. van der Laan)
2016-05-25Do not use mempool for GETDATA for tx accepted after the last mempool req.Gregory Maxwell
The ability to GETDATA a transaction which has not (yet) been relayed is a privacy loss vector. The use of the mempool for this was added as part of the mempool p2p message and is only needed to fetch transactions returned by it.
2016-05-25Merge #7795: UpdateTip: log only one line at most per blockPieter Wuille
f20d42e UpdateTip: log only one line at most per block (Wladimir J. van der Laan)
2016-05-22VerifyDB: don't check blocks that have been prunedSuhas Daftuar
2016-05-20Consensus: Decouple from chainparams.o and timedata.oJorge Timón
Do it for the consensus-critical functions: - CheckBlockHeader - CheckBlock - ContextualCheckBlockHeader
2016-05-18Merge #7917: Optimize reindexWladimir J. van der Laan
b4d24e1 Report reindexing progress in GUI (Pieter Wuille) d3d7547 Add -reindex-chainstate that does not rebuild block index (Pieter Wuille) fb8fad1 Optimize ActivateBestChain for long chains (Pieter Wuille) 316623f Switch reindexing to AcceptBlock in-loop and ActivateBestChain afterwards (Pieter Wuille) d253ec4 Make ProcessNewBlock dbp const and update comment (Pieter Wuille)
2016-05-18Merge #8054: net: Avoid duplicate getheaders requests.Wladimir J. van der Laan
f93c2a1 net: Avoid duplicate getheaders requests. (Daniel Kraft)
2016-05-17Use SipHash-2-4 for address relay selectionPieter Wuille
2016-05-17Report reindexing progress in GUIPieter Wuille
2016-05-17Optimize ActivateBestChain for long chainsPieter Wuille
2016-05-17Switch reindexing to AcceptBlock in-loop and ActivateBestChain afterwardsPieter Wuille
2016-05-17Make ProcessNewBlock dbp const and update commentPieter Wuille
2016-05-16Remove unneeded feerate param from RelayTransaction/AcceptToMemoryPool.Gregory Maxwell
2016-05-15net: Avoid duplicate getheaders requests.Daniel Kraft
The current logic for syncing headers may lead to lots of duplicate getheaders requests being sent: If a new block arrives while the node is in headers sync, it will send getheaders in response to the block announcement. When the headers arrive, the message will be of maximum size and so a follow-up request will be sent---all of that in addition to the existing headers syncing. This will create a second "chain" of getheaders requests. If more blocks arrive, this may even lead to arbitrarily many parallel chains of redundant requests. This patch changes the behaviour to only request more headers after a maximum-sized message when it contained at least one unknown header. This avoids sustaining parallel chains of redundant requests. Note that this patch avoids the issues raised in the discussion of https://github.com/bitcoin/bitcoin/pull/6821: There is no risk of the node being permanently blocked. At the latest when a new block arrives this will trigger a new getheaders request and restart syncing.
2016-05-12net: Add fRelayTxes flagWladimir J. van der Laan
Add a fRelayTxes to keep track of the relay transaction flag we send to other peers.
2016-05-10Merge #8019: Remove state arg from ReconsiderBlock, rename to ↵Wladimir J. van der Laan
ResetBlockFailureFlags 657e07e Rename ReconsiderBlock func to reflect real behavior (instagibbs) addb9d2 Remove state arg from ReconsiderBlock (instagibbs)
2016-05-09Rename ReconsiderBlock func to reflect real behaviorinstagibbs
2016-05-09Merge #7958: Remove useless argument to AlertNotify.Wladimir J. van der Laan
b02119e Remove useless argument to AlertNotify. (Pavel Janík)
2016-05-09Merge #7976: Remove obsolete reference to CValidationState from UpdateCoins.Wladimir J. van der Laan
c8b9248 Remove obsolete reference to CValidationState from UpdateCoins. (21E14)
2016-05-06Remove state arg from ReconsiderBlockinstagibbs
2016-05-06Merge #7815: Break circular dependency main ↔ txdbWladimir J. van der Laan
99e7075 Break circular dependency main ↔ txdb (Wladimir J. van der Laan)
2016-05-05Merge #7840: Several performance and privacy improvements to inv/mempool ↵Wladimir J. van der Laan
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)
2016-04-30Remove obsolete reference to CValidationState from UpdateCoins.21E14
2016-04-30[trivial] Add missing const qualifiers.Daniel Kraft
Add some const qualifiers to references that are not modified and should be marked as const.
2016-04-28Merge #7952: Log invalid block hash to make debugging easier.Wladimir J. van der Laan
61c0170 Log invalid block hash to make debugging easier. (Pavel Janík)
2016-04-28Merge #7514: Fix IsInitialBlockDownload for testnetWladimir J. van der Laan
8aa7226 Fix IsInitialBlockDownload to play nice with testnet (jmacwhyte)
2016-04-27Remove useless argument to AlertNotify.Pavel Janík
It is always 'true', so useless.
2016-04-27Only use AddInventoryKnown for transactionsSuhas Daftuar
filterInventoryKnown is only used when relaying transactions, so stop adding block hashes to the filter.
2016-04-26Log invalid block hash to make debugging easier.Pavel Janík
2016-04-25lock cs_main for chainActiveKaz Wesley
ActivateBestChain uses chainActive after releasing the lock; reorder operations to move all access to synchronized object into existing LOCK(cs_main) block.
2016-04-25lock cs_main for State/MisbehavingKaz Wesley
ProcessMessage calls State(...) and Misbehaving(...) without holding the required lock; add LOCK(cs_main) blocks.
2016-04-22Merge #7919: Fix headers announcements edge caseWladimir J. van der Laan
3a99fb2 Fix headers announcements edge case (Suhas Daftuar)
2016-04-21Move bloom and feerate filtering to just prior to tx sending.Gregory Maxwell
This will avoid sending more pointless INVs around updates, and prevents using filter updates to timetag transactions. Also adds locking for fRelayTxes.
2016-04-21Handle mempool requests in send loop, subject to tricklePieter Wuille
By eliminating queued entries from the mempool response and responding only at trickle time, this makes the mempool no longer leak transaction arrival order information (as the mempool itself is also sorted)-- at least no more than relay itself leaks it.
2016-04-21Split up and optimize transaction and block inv queuesPieter Wuille
2016-04-20Fix headers announcements edge caseSuhas Daftuar
Previously we would assert that if every block in vBlockHashesToAnnounce is in chainActive, then the blocks to be announced must connect. However, there are edge cases where this assumption could be violated (eg using invalidateblock / reconsiderblock), so just check for this case and revert to inv-announcement instead.
2016-04-20Explicitly pass CChainParams to ConnectBlockface
2016-04-20Eliminate TX trickle bypass, sort TX invs for privacy and priority.Gregory Maxwell
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.
2016-04-19Pass CChainParams to DisconnectTip()face
2016-04-19Globals: Explicitly pass const CChainParams& to UpdateTip()Jorge Timón
2016-04-15Break circular dependency main ↔ txdbWladimir J. van der Laan
Break the circular dependency between main and txdb by: - Moving `CBlockFileInfo` from `main.h` to `chain.h`. I think this makes sense, as the other block-file stuff is there too. - Moving `CDiskTxPos` from `main.h` to `txdb.h`. This type seems specific to txdb. - Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves it up to the caller how to insert block indices.