aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Fix compact block handling to not ban if block is invalidSuhas Daftuar2016-11-031-14/+32
| | | | |
* | | | | Merge #9045: Hash P2P messages as they are received instead of at process-timePieter Wuille2016-11-071-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | fe1dc62 Hash P2P messages as they are received instead of at process-time (Matt Corallo)
| * | | | Hash P2P messages as they are received instead of at process-timeMatt Corallo2016-10-301-1/+1
| | |/ / | |/| |
* | | | Merge #8709: Allow filterclear messages for enabling TX relay only.Wladimir J. van der Laan2016-11-071-4/+5
|\ \ \ \ | | | | | | | | | | | | | | | 1f951c6 Allow filterclear messages for enabling TX relay only. (R E Broadley)
| * | | | Allow filterclear messages for enabling TX relay only.R E Broadley2016-09-131-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An example of where this might be useful is allowing a node to connect blocksonly during IBD but then becoming a full-node once caught up with the latest block. This might also even want to be the default behaviour since during IBD most TXs appear to be orphans, and are routinely dropped (for example when a node disconnects). Therefore, this can waste a lot of bandwidth. Additionally, another pull could be written to stop relaying of TXs to nodes that are clearly far behind the latest block and are running a node that doesn't store many orphan TXs, such as recent versions of Bitcoin Core.
* | | | | net: handle version push in InitializeNodeCory Fields2016-11-031-4/+30
| | | | |
* | | | | net: construct CNodeStates in placeCory Fields2016-11-031-6/+6
| | | | |
* | | | | net: switch all callers to connman for pushing messagesCory Fields2016-11-031-49/+49
| | | | | | | | | | | | | | | | | | | | Drop all of the old stuff.
* | | | | connman is in charge of pushing messagesCory Fields2016-11-031-7/+7
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes here are dense and subtle, but hopefully all is more explicit than before. - CConnman is now in charge of sending data rather than the nodes themselves. This is necessary because many decisions need to be made with all nodes in mind, and a model that requires the nodes calling up to their manager quickly turns to spaghetti. - The per-node-serializer (ssSend) has been replaced with a (quasi-)const send-version. Since the send version for serialization can only change once per connection, we now explicitly tag messages with INIT_PROTO_VERSION if they are sent before the handshake. With this done, there's no need to lock for access to nSendVersion. Also, a new stream is used for each message, so there's no need to lock during the serialization process. - This takes care of accounting for optimistic sends, so the nOptimisticBytesWritten hack can be removed. - -dropmessagestest and -fuzzmessagestest have not been preserved, as I suspect they haven't been used in years.
* | | | Merge #8969: Decouple peer-processing-logic from block-connection-logic (#2)Wladimir J. van der Laan2016-11-031-28/+44
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | f5b960b Move nTimeBestReceived updating into net processing code (Matt Corallo) d8670fb Move all calls to CheckBlockIndex out of net-processing logic (Matt Corallo) d6ea737 Remove network state wipe from UnloadBlockIndex. (Matt Corallo) fc0c24f Move MarkBlockAsReceived out of ProcessNewMessage (Matt Corallo) 65f35eb Move FlushStateToDisk call out of ProcessMessages::TX into ATMP (Matt Corallo)
| * | | Move nTimeBestReceived updating into net processing codeMatt Corallo2016-10-311-2/+3
| | | |
| * | | Move all calls to CheckBlockIndex out of net-processing logicMatt Corallo2016-10-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will result in many more calls to CheckBlockIndex when connecting a list of headers (eg in ::HEADERS messages processing) but its only enabled in debug mode, and that should mostly just be during IBD, so it should be OK.
| * | | Remove network state wipe from UnloadBlockIndex.Matt Corallo2016-10-311-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UnloadBlockIndex is only used during init if we end up reindexing to clear our block state so that we can start over. However, at that time no connections have been brought up as CConnman hasn't been started yet, so all of the network processing state logic is empty when its called. Additionally, the initialization of the recentRejects set is moved to InitPeerLogic.
| * | | Move MarkBlockAsReceived out of ProcessNewMessageMatt Corallo2016-10-311-5/+18
| | | |
| * | | Move FlushStateToDisk call out of ProcessMessages::TX into ATMPMatt Corallo2016-10-311-8/+13
| | |/ | |/|
* | | Merge #9053: IBD using chainwork instead of height and not using header ↵Pieter Wuille2016-11-031-7/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | timestamps e141beb IsInitialBlockDownload no longer uses header-only timestamps. (Gregory Maxwell) 2082b55 Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. (Gregory Maxwell) fd46136 IBD check uses minimumchain work instead of checkpoints. (Gregory Maxwell)
| * | | IsInitialBlockDownload no longer uses header-only timestamps.Gregory Maxwell2016-11-021-5/+4
| | | | | | | | | | | | | | | | | | | | This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload.
| * | | IBD check uses minimumchain work instead of checkpoints.Gregory Maxwell2016-11-021-2/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count.
* | | Merge #9013: Trivial: Explicitly pass const CChainParams& to LoadBlockIndexDB()Wladimir J. van der Laan2016-11-021-4/+3
|\ \ \ | | | | | | | | | | | | d0b01f3 Explicitly pass const CChainParams& to LoadBlockIndexDB() (Geoffrey Tsui)
| * | | Explicitly pass const CChainParams& to LoadBlockIndexDB()Geoffrey Tsui2016-10-251-4/+3
| |/ /
* | | Add DumpMempool and LoadMempoolPieter Wuille2016-10-311-0/+113
| | |
* | | Add AcceptToMemoryPoolWithTime functionPieter Wuille2016-10-301-5/+11
|/ /
* | Merge #8515: A few mempool removal optimizationsWladimir J. van der Laan2016-10-251-8/+7
|\ \ | | | | | | | | | | | | | | | | | | 0334430 Add some missing includes (Pieter Wuille) 4100499 Return shared_ptr<CTransaction> from mempool removes (Pieter Wuille) 51f2783 Make removed and conflicted arguments optional to remove (Pieter Wuille) f48211b Bypass removeRecursive in removeForReorg (Pieter Wuille)
| * | Return shared_ptr<CTransaction> from mempool removesPieter Wuille2016-10-211-5/+5
| | |
| * | Make removed and conflicted arguments optional to removePieter Wuille2016-10-211-3/+2
| | |
* | | Merge #8995: Add missing cs_main lock to ::GETBLOCKTXN processingWladimir J. van der Laan2016-10-241-0/+2
|\ \ \ | | | | | | | | | | | | dfe7906 Add missing cs_main lock to ::GETBLOCKTXN processing (Matt Corallo)
| * | | Add missing cs_main lock to ::GETBLOCKTXN processingMatt Corallo2016-10-211-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | Note that this is not a major issue as, in order for the missing lock to cause issues, you have to receive a GETBLOCKTXN message while reindexing, adding a block header via RPC, etc, which results in either a table rehash or an insert into the bucket which you are currently looking at.
* / / Fix doxygen comment: the transaction is returned in txOutPavel Janík2016-10-211-1/+1
|/ /
* | Merge #8968: Don't hold cs_main when calling ProcessNewBlock from a cmpctblockWladimir J. van der Laan2016-10-211-21/+26
|\ \ | | | | | | | | | 72ca7d9 Don't hold cs_main when calling ProcessNewBlock from a cmpctblock (Matt Corallo)
| * | Don't hold cs_main when calling ProcessNewBlock from a cmpctblockMatt Corallo2016-10-181-21/+26
| | |
* | | Use pindexBestHeader instead of setBlockIndexCandidates for NotifyHeaderTip()Jonas Schnelli2016-10-201-3/+2
| | |
* | | RPC: augment getblockchaininfo bip9_softforks datamruddy2016-10-191-0/+6
| | |
* | | Merge #8936: Report NodeId in misbehaving debugWladimir J. van der Laan2016-10-191-2/+2
|\ \ \ | | | | | | | | | | | | a1919ad Report NodeId in misbehaving debug (R E Broadley)
| * | | Report NodeId in misbehaving debugR E Broadley2016-10-181-2/+2
| | | |
* | | | Merge #8865: Decouple peer-processing-logic from block-connection-logicWladimir J. van der Laan2016-10-181-57/+65
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a9aec5c Use BlockChecked signal to send reject messages from mapBlockSource (Matt Corallo) 7565e03 Remove SyncWithWallets wrapper function (Matt Corallo) 12ee1fe Always call UpdatedBlockTip, even if blocks were only disconnected (Matt Corallo) f5efa28 Remove CConnman parameter from ProcessNewBlock/ActivateBestChain (Matt Corallo) fef1010 Use CValidationInterface from chain logic to notify peer logic (Matt Corallo) aefcb7b Move net-processing logic definitions together in main.h (Matt Corallo) 0278fb5 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) (Matt Corallo) 87e7d72 Make validationinterface.UpdatedBlockTip more verbose (Matt Corallo)
| * | | | Use BlockChecked signal to send reject messages from mapBlockSourceMatt Corallo2016-10-041-12/+20
| | | | |
| * | | | Remove SyncWithWallets wrapper functionMatt Corallo2016-10-041-4/+4
| | | | |
| * | | | Always call UpdatedBlockTip, even if blocks were only disconnectedMatt Corallo2016-10-041-7/+4
| | | | |
| * | | | Remove CConnman parameter from ProcessNewBlock/ActivateBestChainMatt Corallo2016-10-041-5/+5
| | | | |
| * | | | Use CValidationInterface from chain logic to notify peer logicMatt Corallo2016-10-041-24/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new CValidationInterface subclass, defined in main.h, to receive notifications of UpdatedBlockTip and use that to push blocks to peers, instead of doing it directly from ActivateBestChain.
| * | | | Remove duplicate nBlocksEstimate cmp (we already checked IsIBD())Matt Corallo2016-10-041-5/+2
| | | | |
| * | | | Make validationinterface.UpdatedBlockTip more verboseMatt Corallo2016-10-041-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In anticipation of making all the callbacks out of block processing flow through it. Note that vHashes will always have something in it since pindexFork != pindexNewTip.
* | | | | Merge #6996: Add preciousblock RPCWladimir J. van der Laan2016-10-181-2/+36
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | 5805ac8 Add preciousblock tests (Pieter Wuille) 5127c4f Add preciousblock RPC (Pieter Wuille)
| * | | | Add preciousblock RPCPieter Wuille2016-08-261-2/+36
| | | | | | | | | | | | | | | | | | | | Includes a bugfix by Luke-Jr.
* | | | | Merge #8637: Compact Block Tweaks (rebase of #8235)Wladimir J. van der Laan2016-10-181-5/+15
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3ac6de0 Align constant names for maximum compact block / blocktxn depth (Pieter Wuille) b2e93a3 Add cmpctblock to debug help list (instagibbs) fe998e9 More agressively filter compact block requests (Matt Corallo) 02a337d Dont remove a "preferred" cmpctblock peer if they provide a block (Matt Corallo)
| * | | | | Align constant names for maximum compact block / blocktxn depthPieter Wuille2016-10-171-3/+3
| | | | | |
| * | | | | More agressively filter compact block requestsMatt Corallo2016-10-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Unit test adaptations by Pieter Wuille.
| * | | | | Dont remove a "preferred" cmpctblock peer if they provide a blockMatt Corallo2016-10-171-2/+12
| | | | | |
* | | | | | Merge #8914: Kill insecure_random and associated global stateWladimir J. van der Laan2016-10-181-6/+9
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | 5eaaa83 Kill insecure_random and associated global state (Wladimir J. van der Laan)
| * | | | | Kill insecure_random and associated global stateWladimir J. van der Laan2016-10-171-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are only a few uses of `insecure_random` outside the tests. This PR replaces uses of insecure_random (and its accompanying global state) in the core code with an FastRandomContext that is automatically seeded on creation. This is meant to be used for inner loops. The FastRandomContext can be in the outer scope, or the class itself, then rand32() is used inside the loop. Useful e.g. for pushing addresses in CNode or the fee rounding, or randomization for coin selection. As a context is created per purpose, thus it gets rid of cross-thread unprotected shared usage of a single set of globals, this should also get rid of the potential race conditions. - I'd say TxMempool::check is not called enough to warrant using a special fast random context, this is switched to GetRand() (open for discussion...) - The use of `insecure_rand` in ConnectThroughProxy has been replaced by an atomic integer counter. The only goal here is to have a different credentials pair for each connection to go on a different Tor circuit, it does not need to be random nor unpredictable. - To avoid having a FastRandomContext on every CNode, the context is passed into PushAddress as appropriate. There remains an insecure_random for test usage in `test_random.h`.