aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #7133Wladimir J. van der Laan2015-12-031-1/+2
|\ | | | | | | | | | | | | | | | | aa4b0c2 When not filtering blocks, getdata sends more in one test (Pieter Wuille) d41e44c Actually only use filterInventoryKnown with MSG_TX inventory messages. (Gregory Maxwell) b6a0da4 Only use filterInventoryKnown with MSG_TX inventory messages. (Patick Strateman) 6b84935 Rename setInventoryKnown filterInventoryKnown (Patick Strateman) e206724 Remove mruset as it is no longer used. (Gregory Maxwell) ec73ef3 Replace setInventoryKnown with a rolling bloom filter. (Gregory Maxwell)
| * Rename setInventoryKnown filterInventoryKnownPatick Strateman2015-11-301-2/+2
| |
| * Replace setInventoryKnown with a rolling bloom filter.Gregory Maxwell2015-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Mruset setInventoryKnown was reduced to a remarkably small 1000 entries as a side effect of sendbuffer size reductions in 2012. This removes setInventoryKnown filtering from merkleBlock responses because false positives there are especially unattractive and also because I'm not sure if there aren't race conditions around the relay pool that would cause some transactions there to be suppressed. (Also, ProcessGetData was accessing setInventoryKnown without taking the required lock.)
* | Merge pull request #7079Wladimir J. van der Laan2015-12-011-1/+5
|\ \ | |/ |/| | | | | ebb25f4 Limit setAskFor and retire requested entries only when a getdata returns. (Gregory Maxwell) 5029698 prevent peer flooding request queue for an inv (kazcw)
| * Limit setAskFor and retire requested entries only when a getdata returns.Gregory Maxwell2015-11-231-2/+2
| | | | | | | | | | | | The setAskFor duplicate elimination was too eager and removed entries when we still had no getdata response, allowing the peer to keep INVing and not responding.
| * prevent peer flooding request queue for an invkazcw2015-11-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | mapAlreadyAskedFor does not keep track of which peer has a request queued for a particular tx. As a result, a peer can blind a node to a tx indefinitely by sending many invs for the same tx, and then never replying to getdatas for it. Each inv received will be placed 2 minutes farther back in mapAlreadyAskedFor, so a short message containing 10 invs would render that tx unavailable for 20 minutes. This is fixed by disallowing a peer from having more than one entry for a particular inv in mapAlreadyAskedFor at a time.
* | Constrain constant values to a single location in codeLuke Dashjr2015-11-281-5/+4
|/
* Add relaytxes status to getpeerinfoPeter Todd2015-11-201-0/+1
|
* Use DEFAULT_BLOCKSONLY and DEFAULT_WHITELISTALWAYSRELAY constantsPatick Strateman2015-11-141-1/+1
|
* Add blocksonly modePatick Strateman2015-11-141-1/+1
|
* [net] Cleanup maxuploadtargetMarcoFalke2015-11-121-2/+2
| | | | | | | * log: nMaxOutboundLimit is in bytes * log: Hide misleading -maxuploadtarget=0 warning * qa : Minor cleanup to maxuploadtarget rpc tests * net: Use DEFAULT_MAX_UPLOAD_TARGET = 0
* torcontrol improvements and fixesWladimir J. van der Laan2015-11-121-0/+8
| | | | | | | | | | | | | | - Force AUTHCOOKIE size to be 32 bytes: This provides protection against an attack where a process pretends to be Tor and uses the cookie authentication method to nab arbitrary files such as the wallet - torcontrol logging - fix cookie auth - add HASHEDPASSWORD auth, fix fd leak when fwrite() fails - better error reporting when cookie file is not ok - better init/shutdown flow - stop advertizing service when disconnected from tor control port - COOKIE->SAFECOOKIE auth
* net: Automatically create hidden service, listen on TorWladimir J. van der Laan2015-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket API, to create and destroy 'ephemeral' hidden services programmatically. https://stem.torproject.org/api/control.html#stem.control.Controller.create_ephemeral_hidden_service This means that if Tor is running (and proper authorization is available), bitcoin automatically creates a hidden service to listen on, without user manual configuration. This will positively affect the number of available .onion nodes. - When the node is started, connect to Tor through control socket - Send `ADD_ONION` command - First time: - Make it create a hidden service key - Save the key in the data directory for later usage - Make it redirect port 8333 to the local port 8333 (or whatever port we're listening on). - Keep control socket connection open for as long node is running. The hidden service will (by default) automatically go away when the connection is closed.
* Introduce -maxuploadtargetJonas Schnelli2015-10-261-0/+94
| | | | | | | * -maxuploadtarget can be set in MiB * if <limit> - ( time-left-in-24h-cycle / 600 * MAX_BLOCK_SIZE ) has reach, stop serve blocks older than one week and filtered blocks * no action if limit has reached, no guarantee that the target will not be surpassed * add outbound limit informations to rpc getnettotals
* Set TCP_NODELAY on P2P sockets.Gregory Maxwell2015-10-221-0/+12
| | | | | | | | Nagle appears to be a significant contributor to latency now that the static sleeps are gone. Most of our messages are relatively large compared to IP + TCP so I do not expect this to create enormous overhead. This may also reduce traffic burstyness somewhat.
* net: correctly initialize nMinPingUsecTimeWladimir J. van der Laan2015-09-041-0/+1
| | | | | | `nMinPingUsecTime` was left uninitialized in CNode. The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that. Thanks @MarcoFalke for noticing.
* Report minimum ping time in getpeerinfoMatt Corallo2015-09-031-0/+1
|
* Merge pull request #6374Wladimir J. van der Laan2015-09-031-59/+217
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 027de94 Use network group instead of CNetAddr in final pass to select node to disconnect (Patrick Strateman) 000c18a Fix comment (Patrick Strateman) fed3094 Acquire cs_vNodes before changing refrence counts (Patrick Strateman) 69ee1aa CNodeRef copy constructor and assignment operator (Patrick Strateman) dc81dd0 Return false early if vEvictionCandidates is empty (Patrick Strateman) 17f3533 Better support for nodes with non-standard nMaxConnections (Patrick Strateman) 1317cd1 RAII wrapper for CNode* (Patrick Strateman) df23937 Add comments to AttemptToEvictConnection (Patrick Strateman) a8f6e45 Remove redundant whiteconnections option (Patrick Strateman) b105ba3 Prefer to disconnect peers in favor of whitelisted peers (Patrick Strateman) 2c70153 AttemptToEvictConnection (Patrick Strateman) 4bac601 Record nMinPingUsecTime (Patrick Strateman) ae037b7 Refactor: Move failure conditions to the top of AcceptConnection (Patrick Strateman) 1ef4817 Refactor: Bail early in AcceptConnection (Patrick Strateman) 541a1dd Refactor: AcceptConnection (Patrick Strateman)
| * Use network group instead of CNetAddr in final pass to select node to disconnectPatrick Strateman2015-08-301-10/+10
| |
| * Fix commentPatrick Strateman2015-08-251-1/+1
| |
| * Acquire cs_vNodes before changing refrence countsPatrick Strateman2015-08-251-2/+12
| |
| * CNodeRef copy constructor and assignment operatorPatrick Strateman2015-08-251-0/+16
| |
| * Return false early if vEvictionCandidates is emptyPatrick Strateman2015-08-221-3/+8
| |
| * Better support for nodes with non-standard nMaxConnectionsPatrick Strateman2015-08-221-1/+1
| |
| * RAII wrapper for CNode*Patrick Strateman2015-08-221-7/+18
| |
| * Add comments to AttemptToEvictConnectionPatrick Strateman2015-08-221-0/+7
| |
| * Remove redundant whiteconnections optionPatrick Strateman2015-08-221-1/+0
| |
| * Prefer to disconnect peers in favor of whitelisted peersPatrick Strateman2015-08-221-3/+6
| |
| * AttemptToEvictConnectionPatrick Strateman2015-08-221-10/+106
| |
| * Refactor: Move failure conditions to the top of AcceptConnectionPatrick Strateman2015-08-221-6/+6
| |
| * Refactor: Bail early in AcceptConnectionPatrick Strateman2015-08-221-14/+21
| |
| * Refactor: AcceptConnectionPatrick Strateman2015-08-221-58/+62
| |
* | Merge pull request #6583Wladimir J. van der Laan2015-08-311-1/+5
|\ \ | | | | | | | | | 9f3e48e add support for miniupnpc api version 14 (Pavel Vasin)
| * | add support for miniupnpc api version 14Pavel Vasin2015-08-231-1/+5
| |/ | | | | | | The value of new arg ttl is set to 2 as it's recommended default.
* | Make sure LogPrint strings are line-terminatedJ Ross Nicoll2015-08-291-1/+1
| |
* | net: Set SO_REUSEADDR for Windows tooCory Fields2015-08-251-1/+3
|/ | | | | | When running the rpc tests in Wine, nodes often fail to listen on localhost due to a stale socket from a previous run. This aligns the behavior with other platforms.
* typofixes (found by misspell_fixer)Veres Lajos2015-08-101-1/+1
|
* Merge pull request #6462Wladimir J. van der Laan2015-08-051-1/+2
|\ | | | | | | | | 7b79cbd limit total length of user agent comments (Pavol Rusnak) 557f8ea implement uacomment config parameter which can add comments to user agent as per BIP-0014 (Pavol Rusnak)
| * limit total length of user agent commentsPavol Rusnak2015-08-051-1/+2
| | | | | | | | Reworked-By: Wladimir J. van der Laan <[email protected]>
| * implement uacomment config parameterPavol Rusnak2015-07-311-1/+1
| | | | | | | | which can add comments to user agent as per BIP-0014
* | Consolidate individual references to the current maximum peer connectionMatt Quinn2015-08-031-1/+1
| | | | | | | | value of 125 into a single constant declaration.
* | Make CRollingBloomFilter set nTweak for youPeter Todd2015-07-271-1/+1
|/ | | | | | | | | | | | While CBloomFilter is usually used with an explicitly set nTweak, CRollingBloomFilter is only used internally. Requiring every caller to set nTweak is error-prone and redundant; better to have the class handle that for you with a high-quality randomness source. Additionally when clearing the filter it makes sense to change nTweak as well to recover from a bad setting, e.g. due to insufficient randomness at initialization, so the clear() method is replaced by a reset() method that sets a new, random, nTweak value.
* Merge pull request #5697Wladimir J. van der Laan2015-07-271-1/+3
|\ | | | | | | | | 60c8bac Includes: Cleanup around net main and wallet (Jorge Timón) 9dd793f TRIVIAL: Missing includes (Jorge Timón)
| * Includes: Cleanup around net main and walletJorge Timón2015-07-231-1/+3
| | | | | | | | | | | | -Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes
* | Merge pull request #6287Wladimir J. van der Laan2015-07-231-1/+3
|\ \ | |/ |/| | | | | | | a794284 locking: add a quick example of GUARDED_BY (Cory Fields) 2b890dd locking: fix a few small issues uncovered by -Wthread-safety (Cory Fields) cd27bba locking: teach Clang's -Wthread-safety to cope with our scoped lock macros (Cory Fields)
| * locking: fix a few small issues uncovered by -Wthread-safetyCory Fields2015-06-161-1/+3
| | | | | | | | | | | | - rpcwallet: No need to lock twice here - openssl: Clang doesn't understand selective lock/unlock here. Ignore it. - CNode: Fix a legitimate (though very unlikely) locking bug.
* | Test whether created sockets are select()ablePieter Wuille2015-07-101-0/+18
| |
* | Merge pull request #5288Wladimir J. van der Laan2015-07-101-2/+12
|\ \ | | | | | | | | | e3cae52 Added -whiteconnections=<n> option (Josh Lehan)
| * | Added -whiteconnections=<n> optionJosh Lehan2015-06-141-1/+11
| |/ | | | | | | | | | | This sets aside a number of connection slots for whitelisted peers, useful for ensuring your local users and miners can always get in, even if your limit on inbound connections has already been reached.
* | Adding CSubNet constructor over a single CNetAddrJonas Schnelli2015-07-021-2/+2
| |