aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | Do not use mempool for GETDATA for tx accepted after the last mempool req.Gregory Maxwell2016-05-251-1/+5
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | Always require OS randomness when generating secret keysPieter Wuille2016-05-291-1/+0
| |_|_|_|_|/ |/| | | | |
* | | | | | Merge #8049: Expose information on whether transaction relay is enabled in ↵Pieter Wuille2016-05-261-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `getnetwork` 1ab1dc3 rpc: Add `relaytxes` flag to `getnetworkinfo` (Wladimir J. van der Laan) 581ddff net: Add fRelayTxes flag (Wladimir J. van der Laan)
| * | | | | | net: Add fRelayTxes flagWladimir J. van der Laan2016-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a fRelayTxes to keep track of the relay transaction flag we send to other peers.
* | | | | | | Merge #7795: UpdateTip: log only one line at most per blockPieter Wuille2016-05-251-9/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | f20d42e UpdateTip: log only one line at most per block (Wladimir J. van der Laan)
| * | | | | | | UpdateTip: log only one line at most per blockWladimir J. van der Laan2016-04-051-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid logging two or more lines per block in UpdateTip by adding the warning into the UpdateTip log message.
* | | | | | | | VerifyDB: don't check blocks that have been prunedSuhas Daftuar2016-05-221-0/+5
| |_|/ / / / / |/| | | | | |
* | | | | | | Merge #7917: Optimize reindexWladimir J. van der Laan2016-05-181-11/+59
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | | | | | | Report reindexing progress in GUIPieter Wuille2016-05-171-0/+39
| | | | | | | |
| * | | | | | | Optimize ActivateBestChain for long chainsPieter Wuille2016-05-171-4/+10
| | | | | | | |
| * | | | | | | Switch reindexing to AcceptBlock in-loop and ActivateBestChain afterwardsPieter Wuille2016-05-171-5/+8
| | | | | | | |
| * | | | | | | Make ProcessNewBlock dbp const and update commentPieter Wuille2016-05-171-2/+2
| | | | | | | |
* | | | | | | | Merge #8054: net: Avoid duplicate getheaders requests.Wladimir J. van der Laan2016-05-181-1/+8
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | f93c2a1 net: Avoid duplicate getheaders requests. (Daniel Kraft)
| * | | | | | | | net: Avoid duplicate getheaders requests.Daniel Kraft2016-05-151-1/+8
| | |_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | Use SipHash-2-4 for address relay selectionPieter Wuille2016-05-171-11/+9
| |/ / / / / / |/| | | | | |
* | | | | | | Remove unneeded feerate param from RelayTransaction/AcceptToMemoryPool.Gregory Maxwell2016-05-161-14/+9
|/ / / / / /
* | | | | | Merge #8019: Remove state arg from ReconsiderBlock, rename to ↵Wladimir J. van der Laan2016-05-101-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ResetBlockFailureFlags 657e07e Rename ReconsiderBlock func to reflect real behavior (instagibbs) addb9d2 Remove state arg from ReconsiderBlock (instagibbs)
| * | | | | | Rename ReconsiderBlock func to reflect real behaviorinstagibbs2016-05-091-1/+1
| | | | | | |
| * | | | | | Remove state arg from ReconsiderBlockinstagibbs2016-05-061-1/+1
| | | | | | |
* | | | | | | Merge #7958: Remove useless argument to AlertNotify.Wladimir J. van der Laan2016-05-091-9/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | b02119e Remove useless argument to AlertNotify. (Pavel Janík)
| * | | | | | | Remove useless argument to AlertNotify.Pavel Janík2016-04-271-9/+6
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | It is always 'true', so useless.
* | | | | | | Merge #7976: Remove obsolete reference to CValidationState from UpdateCoins.Wladimir J. van der Laan2016-05-091-4/+4
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | | | | | | | | c8b9248 Remove obsolete reference to CValidationState from UpdateCoins. (21E14)
| * | | | | | Remove obsolete reference to CValidationState from UpdateCoins.21E142016-04-301-4/+4
| | |_|/ / / | |/| | | |
* | | | | | Merge #7815: Break circular dependency main ↔ txdbWladimir J. van der Laan2016-05-061-1/+1
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | | | | | | | 99e7075 Break circular dependency main ↔ txdb (Wladimir J. van der Laan)
| * | | | | Break circular dependency main ↔ txdbWladimir J. van der Laan2016-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge #7840: Several performance and privacy improvements to inv/mempool ↵Wladimir J. van der Laan2016-05-051-62/+136
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | | | | | Move bloom and feerate filtering to just prior to tx sending.Gregory Maxwell2016-04-211-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will avoid sending more pointless INVs around updates, and prevents using filter updates to timetag transactions. Also adds locking for fRelayTxes.
| * | | | | | Handle mempool requests in send loop, subject to tricklePieter Wuille2016-04-211-28/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | Split up and optimize transaction and block inv queuesPieter Wuille2016-04-211-31/+45
| | | | | | |
| * | | | | | Eliminate TX trickle bypass, sort TX invs for privacy and priority.Gregory Maxwell2016-04-201-24/+36
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge #7952: Log invalid block hash to make debugging easier.Wladimir J. van der Laan2016-04-281-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 61c0170 Log invalid block hash to make debugging easier. (Pavel Janík)
| * | | | | Log invalid block hash to make debugging easier.Pavel Janík2016-04-261-1/+1
| | |/ / / | |/| | |
* | | | | Merge #7514: Fix IsInitialBlockDownload for testnetWladimir J. van der Laan2016-04-281-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | 8aa7226 Fix IsInitialBlockDownload to play nice with testnet (jmacwhyte)
| * | | | Fix IsInitialBlockDownload to play nice with testnetjmacwhyte2016-02-111-1/+1
| | | | |
* | | | | Merge #7919: Fix headers announcements edge caseWladimir J. van der Laan2016-04-221-1/+15
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 3a99fb2 Fix headers announcements edge case (Suhas Daftuar)
| * | | | | Fix headers announcements edge caseSuhas Daftuar2016-04-201-1/+15
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Explicitly pass CChainParams to ConnectBlockface2016-04-201-5/+5
| | | | |
* | | | | Pass CChainParams to DisconnectTip()face2016-04-191-6/+5
| | | | |
* | | | | Globals: Explicitly pass const CChainParams& to UpdateTip()Jorge Timón2016-04-191-4/+4
|/ / / /
* | | | Merge #7856: Only send one GetAddr response per connection.Wladimir J. van der Laan2016-04-151-0/+8
|\ \ \ \ | | | | | | | | | | | | | | | 66b0724 Only send one GetAddr response per connection. (Gregory Maxwell)
| * | | | Only send one GetAddr response per connection.Gregory Maxwell2016-04-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This conserves resources from abusive peers that just send getaddr in a loop. Also makes correlating addr messages against INVs less effective.
* | | | | Merge #7877: Change mapRelay to store CTransactionsWladimir J. van der Laan2016-04-151-5/+2
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 38c3102 Change mapRelay to store CTransactions (Pieter Wuille)
| * | | | | Change mapRelay to store CTransactionsPieter Wuille2016-04-141-5/+2
| | | | | |
* | | | | | Merge #7874: Improve AlreadyHaveWladimir J. van der Laan2016-04-141-1/+3
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | c6cb6f7 Avoid unnecessary database access for unknown transactions (Alex Morcos)
| * | | | | Avoid unnecessary database access for unknown transactionsAlex Morcos2016-04-131-1/+3
| | | | | |
* | | | | | Merge #7862: Use txid as key in mapAlreadyAskedForWladimir J. van der Laan2016-04-141-1/+1
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | 7e91f63 Use txid as key in mapAlreadyAskedFor (Suhas Daftuar)
| * | | | | Use txid as key in mapAlreadyAskedForSuhas Daftuar2016-04-111-1/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we used the CInv that would be sent to the peer announcing the transaction as the key, but using the txid instead allows us to decouple the p2p layer from the application logic (which relies on this map to avoid duplicate tx requests).
* | | | | Merge #7828: Trivial: Globals: Explicitly pass const CChainParams& to ↵Pieter Wuille2016-04-121-3/+2
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | ProcessMessage() bf477bc Trivial: Globals: Explicitly pass const CChainParams& to ProcessMessage() (Jorge Timón)
| * | | | Trivial: Globals: Explicitly pass const CChainParams& to ProcessMessage()Jorge Timón2016-04-061-3/+2
| | | | |