aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | 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
| | | | |
* | | | | Version 2 transactions remain non-standard until CSV activatesSuhas Daftuar2016-04-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Before activation, such transactions might not be mined, so don't allow into the mempool.
* | | | | Merge #7804: Track block download times per individual blockWladimir J. van der Laan2016-04-071-31/+36
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 0e24bbf Self check after the last peer is removed (Pieter Wuille) 2d1d658 Track block download times per individual block (Pieter Wuille)
| * | | | | Self check after the last peer is removedPieter Wuille2016-04-071-0/+7
| | | | | |
| * | | | | Track block download times per individual blockPieter Wuille2016-04-071-31/+29
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we're keeping a timeout for each requested block, starting from when it is requested, with a correction factor for the number of blocks in the queue. That's unnecessarily complicated and inaccurate. As peers process block requests in order, we can make the timeout for each block start counting only when all previous ones have been received, and have a correction based on the number of peers, rather than the total number of blocks.
* / / / / init: allow shutdown during 'Activating best chain...'Wladimir J. van der Laan2016-04-061-0/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two-line patch to make it possible to shut down bitcoind cleanly during the initial ActivateBestChain. Fixes #6459 (among other complaints). To reproduce: - shutdown bitcoind - copy chainstate - start bitcoind - let the chain sync a bit - shutdown bitcoind - copy back old chainstate - start bitcoind - bitcoind will catch up with all blocks during Init() (the `boost::this_thread::interruption_point` / `ShutdownRequested()` dance is ugly, this should be refactored all over bitcoind at some point when moving from boost::threads to c++11 threads, but it works...)
* | / / [doc] Fix doxygen comments for membersMarcoFalke2016-04-031-4/+4
| |/ / |/| |
* | | Merge #7763: Put hex-encoded version in UpdateTipWladimir J. van der Laan2016-03-311-4/+4
|\ \ \ | | | | | | | | | | | | eff736e Reformat version in UpdateTip and other messages (Pieter Wuille)
| * | | Reformat version in UpdateTip and other messagesPieter Wuille2016-03-311-4/+4
| | | | | | | | | | | | | | | | Also remove the hardly-readable nBits from UpdateTip's log message.
* | | | Merge #7648: BIP9 versionbits softfork for BIP68, BIP112 and BIP113Wladimir J. van der Laan2016-03-301-5/+17
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| | | | | | | | | | | | | 71527a0 Test of BIP9 fork activation of mtp, csv, sequence_lock (NicolasDorier) 19d73d5 Add RPC test for BIP 68/112/113 soft fork. (Alex Morcos) 12c89c9 Policy: allow transaction version 2 relay policy. (BtcDrak) 02c2435 Soft fork logic for BIP68 (BtcDrak) 478fba6 Soft fork logic for BIP113 (BtcDrak) 65751a3 Add CHECKSEQUENCEVERIFY softfork through BIP9 (Pieter Wuille)
| * | Soft fork logic for BIP68BtcDrak2016-03-181-2/+3
| | |
| * | Soft fork logic for BIP113BtcDrak2016-03-181-4/+10
| | |