aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
AgeCommit message (Collapse)Author
2015-10-22Set TCP_NODELAY on P2P sockets.Gregory Maxwell
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.
2015-09-04net: correctly initialize nMinPingUsecTimeWladimir J. van der Laan
`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.
2015-09-03Report minimum ping time in getpeerinfoMatt Corallo
2015-09-03Merge pull request #6374Wladimir J. van der Laan
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)
2015-08-31Merge pull request #6583Wladimir J. van der Laan
9f3e48e add support for miniupnpc api version 14 (Pavel Vasin)
2015-08-30Use network group instead of CNetAddr in final pass to select node to disconnectPatrick Strateman
2015-08-29Make sure LogPrint strings are line-terminatedJ Ross Nicoll
2015-08-25Fix commentPatrick Strateman
2015-08-25Acquire cs_vNodes before changing refrence countsPatrick Strateman
2015-08-25CNodeRef copy constructor and assignment operatorPatrick Strateman
2015-08-25net: Set SO_REUSEADDR for Windows tooCory Fields
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.
2015-08-23add support for miniupnpc api version 14Pavel Vasin
The value of new arg ttl is set to 2 as it's recommended default.
2015-08-22Return false early if vEvictionCandidates is emptyPatrick Strateman
2015-08-22Better support for nodes with non-standard nMaxConnectionsPatrick Strateman
2015-08-22RAII wrapper for CNode*Patrick Strateman
2015-08-22Add comments to AttemptToEvictConnectionPatrick Strateman
2015-08-22Remove redundant whiteconnections optionPatrick Strateman
2015-08-22Prefer to disconnect peers in favor of whitelisted peersPatrick Strateman
2015-08-22AttemptToEvictConnectionPatrick Strateman
2015-08-22Refactor: Move failure conditions to the top of AcceptConnectionPatrick Strateman
2015-08-22Refactor: Bail early in AcceptConnectionPatrick Strateman
2015-08-22Refactor: AcceptConnectionPatrick Strateman
2015-08-10typofixes (found by misspell_fixer)Veres Lajos
2015-08-05Merge pull request #6462Wladimir J. van der Laan
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)
2015-08-05limit total length of user agent commentsPavol Rusnak
Reworked-By: Wladimir J. van der Laan <laanwj@gmail.com>
2015-08-03Consolidate individual references to the current maximum peer connectionMatt Quinn
value of 125 into a single constant declaration.
2015-07-31implement uacomment config parameterPavol Rusnak
which can add comments to user agent as per BIP-0014
2015-07-27Make CRollingBloomFilter set nTweak for youPeter Todd
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.
2015-07-27Merge pull request #5697Wladimir J. van der Laan
60c8bac Includes: Cleanup around net main and wallet (Jorge Timón) 9dd793f TRIVIAL: Missing includes (Jorge Timón)
2015-07-23Includes: Cleanup around net main and walletJorge Timón
-Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes
2015-07-23Merge pull request #6287Wladimir J. van der Laan
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)
2015-07-10Test whether created sockets are select()ablePieter Wuille
2015-07-10Merge pull request #5288Wladimir J. van der Laan
e3cae52 Added -whiteconnections=<n> option (Josh Lehan)
2015-07-02Adding CSubNet constructor over a single CNetAddrJonas Schnelli
2015-07-02use CBanEntry as object container for banned nodesJonas Schnelli
- added a reason enum for a ban - added creation time for a ban Using CBanEntry as container will keep banlist.dat extenable.
2015-07-02CAddrDB/CBanDB: change filesize variables from int to uint64_tJonas Schnelli
2015-07-02banlist.dat: store banlist on diskJonas Schnelli
2015-06-19fix missing lock in CNode::ClearBanned()Jonas Schnelli
2015-06-17setban: rewrite to UniValue, allow absolute bantimeJonas Schnelli
2015-06-17[RPC] extend setban to allow subnetsJonas Schnelli
2015-06-17[net] remove unused return type bool from CNode::Ban()Jonas Schnelli
2015-06-17[net] extend core functionallity for ban/unban/listbanJonas Schnelli
2015-06-16locking: fix a few small issues uncovered by -Wthread-safetyCory Fields
- 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.
2015-06-14Added -whiteconnections=<n> optionJosh Lehan
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.
2015-06-04use const references where appropriatePhilip Kaufmann
2015-05-31[net, trivial] explicitly use std::string for FindNodePhilip Kaufmann
- in OpenNetworkConnection we have a FindNode call, which gets a const char*, wheras we only have defined a FindNode for std::string
2015-05-14Use CScheduler for net's DumpAddressesGavin Andresen
Instead of starting Yet Another Thread to dump addresses, use CScheduler to do it.
2015-04-30Use ring buffer of set iterators instead of deque of copies in mrusetPieter Wuille
2015-04-30Replace mruset setAddrKnown with CRollingBloomFilter addrKnownGavin Andresen
Use a probabilistic bloom filter to keep track of which addresses we think we have given our peers, instead of a list. This uses much less memory, at the cost of sometimes failing to relay an address to a peer-- worst case if the bloom filter happens to be as full as it gets, 1-in-1,000. Measured memory usage of a full mruset setAddrKnown: 650Kbytes Constant memory usage of CRollingBloomFilter addrKnown: 37Kbytes. This will also help heap fragmentation, because the 37K of storage is allocated when a CNode is created (when a connection to a peer is established) and then there is no per-item-remembered memory allocation. I plan on testing by restarting a full node with an empty peers.dat, running a while with -debug=addrman and -debug=net, and making sure that the 'addr' message traffic out is reasonable. (suggestions for better tests welcome)
2015-04-30Merge pull request #6059Wladimir J. van der Laan
739d615 chainparams: use SeedSpec6's rather than CAddress's for fixed seeds (Cory Fields)