aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Hash P2P messages as they are received instead of at process-timeMatt Corallo2016-10-301-0/+5
| | |
* | | net: handle version push in InitializeNodeCory Fields2016-11-031-4/+5
| | |
* | | net: remove now-unused ssSend and FuzzCory Fields2016-11-031-4/+0
| | |
* | | drop the optimistic write counter hackCory Fields2016-11-031-1/+0
| | | | | | | | | | | | This is now handled properly in realtime.
* | | net: switch all callers to connman for pushing messagesCory Fields2016-11-031-184/+0
| | | | | | | | | | | | Drop all of the old stuff.
* | | connman is in charge of pushing messagesCory Fields2016-11-031-3/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | net: Use deterministic randomness for CNode's nonce, and make it constCory Fields2016-10-311-2/+2
| | |
* | | net: constify a few CNode vars to indicate that they're threadsafeCory Fields2016-10-311-4/+4
|/ /
* | Merge #8914: Kill insecure_random and associated global stateWladimir J. van der Laan2016-10-181-2/+2
|\ \ | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | | Display minimum ping in debug window.R E Broadley2016-10-151-1/+1
|/ /
* / gui: fix ban from qt consoleCory Fields2016-10-041-0/+1
|/ | | | | | | Rather than doing a circle and re-resolving the node's IP, just use the one from nodestats directly. This requires syncing the addr field from CNode.
* Comment on CConnman::nLocalServices meaninginstagibbs2016-09-221-0/+1
|
* Merge #8688: Move static global randomizer seeds into CConnmanWladimir J. van der Laan2016-09-191-3/+10
|\ | | | | | | d9ff591 Move static global randomizer seeds into CConnman (Pieter Wuille)
| * Move static global randomizer seeds into CConnmanPieter Wuille2016-09-191-3/+10
| |
* | net: fix maxuploadtarget settingCory Fields2016-09-141-0/+4
|/ | | | | | | | | This was broken by 63cafa6329e1a. Note that while this fixes the settings, it doesn't fix the actual usage of -maxuploadtarget completely, as there is currently a bug in the nOptimisticBytesWritten accounting that causes a delayed response if the target is reached. That bug will be addressed separately.
* net: move MAX_FEELER_CONNECTIONS into connmanCory Fields2016-09-081-0/+2
|
* Convert ForEachNode* functions to take a templated function argument rather ↵Jeremy Rubin2016-09-081-8/+82
| | | | than a std::function to eliminate std::function overhead
* Made the ForEachNode* functions in src/net.cpp more pragmatic and self ↵Jeremy Rubin2016-09-081-4/+8
| | | | documenting
* net: move vNodesDisconnected into CConnmanCory Fields2016-09-081-0/+1
|
* net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::OptionsCory Fields2016-09-081-0/+2
|
* net: Introduce CConnection::Options to avoid passing so many paramsCory Fields2016-09-081-1/+10
|
* net: Drop StartNode/StopNode and use CConnman directlyCory Fields2016-09-081-2/+1
|
* net: pass CClientUIInterface into CConnmanCory Fields2016-09-081-2/+5
|
* net: Pass best block known height into CConnmanCory Fields2016-09-081-4/+9
| | | | | | | | | | | | | | | | | | | | CConnman then passes the current best height into CNode at creation time. This way CConnman/CNode have no dependency on main for height, and the signals only move in one direction. This also helps to prevent identity leakage a tiny bit. Before this change, an attacker could theoretically make 2 connections on different interfaces. They would connect fully on one, and only establish the initial connection on the other. Once they receive a new block, they would relay it to your first connection, and immediately commence the version handshake on the second. Since the new block height is reflected immediately, they could attempt to learn whether the two connections were correlated. This is, of course, incredibly unlikely to work due to the small timings involved and receipt from other senders. But it doesn't hurt to lock-in nBestHeight at the time of connection, rather than letting the remote choose the time.
* net: move max/max-outbound to CConnmanCory Fields2016-09-081-5/+6
|
* net: move semOutbound to CConnmanCory Fields2016-09-081-0/+2
|
* net: move nLocalServices/nRelevantServices to CConnmanCory Fields2016-09-081-6/+18
| | | | | These are in-turn passed to CNode at connection time. This allows us to offer different services to different peers (or test the effects of doing so).
* net: move SendBufferSize/ReceiveFloodSize to CConnmanCory Fields2016-09-081-3/+7
|
* net: move send/recv statistics to CConnmanCory Fields2016-09-081-40/+42
|
* net: SocketSendData returns written sizeCory Fields2016-09-081-1/+1
|
* net: move messageHandlerCondition to CConnmanCory Fields2016-09-081-1/+2
|
* net: move nLocalHostNonce to CConnmanCory Fields2016-09-081-1/+6
| | | | | | | | This behavior seems to have been quite racy and broken. Move nLocalHostNonce into CNode, and check received nonces against all non-fully-connected nodes. If there's a match, assume we've connected to ourself.
* net: move nLastNodeId to CConnmanCory Fields2016-09-081-4/+5
|
* net: move whitelist functions into CConnmanCory Fields2016-09-081-8/+8
|
* net: create generic functor accessors and move vNodes to CConnmanCory Fields2016-09-081-10/+17
|
* net: Add most functions needed for vNodes to CConnmanCory Fields2016-09-081-0/+16
|
* net: move added node functions to CConnmanCory Fields2016-09-081-13/+15
|
* net: Add oneshot functions to CConnmanCory Fields2016-09-081-1/+3
|
* net: move ban and addrman functions into CConnmanCory Fields2016-09-081-40/+49
|
* net: handle nodesignals in CConnmanCory Fields2016-09-081-1/+2
|
* net: move OpenNetworkConnection into CConnmanCory Fields2016-09-081-1/+3
|
* net: Move socket binding into CConnmanCory Fields2016-09-081-7/+11
|
* net: Pass CConnman around as neededCory Fields2016-09-081-2/+2
|
* net: Create CConnman to encapsulate p2p connectionsCory Fields2016-09-081-2/+28
|
* net: move CBanDB and CAddrDB out of net.h/cppCory Fields2016-09-081-83/+1
| | | | This will eventually solve a circular dependency
* Merge #8466: [Trivial] Do not shadow variables in networking codeWladimir J. van der Laan2016-09-021-6/+6
|\ | | | | | | b7c349d Do not shadow variables in networking code (Pavel Janík)
| * Do not shadow variables in networking codePavel Janík2016-08-151-6/+6
| |
* | Added feeler connections increasing good addrs in the tried table.Ethan Heilman2016-08-231-1/+4
|/ | | | | | | | | Tests if addresses are online or offline by briefly connecting to them. These short lived connections are referred to as feeler connections. Feeler connections are designed to increase the number of fresh online addresses in tried by selecting and connecting to addresses in new. One feeler connection is attempted on average once every two minutes. This change was suggested as Countermeasure 4 in Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman, Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report 2015/263. March 2015.
* net: narrow include scope after moving to netaddressCory Fields2016-07-311-1/+1
| | | | | Net functionality is no longer needed for CAddress/CAddrman/etc. now that CNetAddr/CService/CSubNet are dumb storage classes.