aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | [net] remove unused return type bool from CNode::Ban()Jonas Schnelli2015-06-171-3/+1
| |
* | [net] extend core functionallity for ban/unban/listbanJonas Schnelli2015-06-171-6/+21
|/
* use const references where appropriatePhilip Kaufmann2015-06-041-11/+10
|
* [net, trivial] explicitly use std::string for FindNodePhilip Kaufmann2015-05-311-2/+2
| | | | | - in OpenNetworkConnection we have a FindNode call, which gets a const char*, wheras we only have defined a FindNode for std::string
* Use CScheduler for net's DumpAddressesGavin Andresen2015-05-141-2/+3
| | | | | Instead of starting Yet Another Thread to dump addresses, use CScheduler to do it.
* Use ring buffer of set iterators instead of deque of copies in mrusetPieter Wuille2015-04-301-2/+4
|
* Replace mruset setAddrKnown with CRollingBloomFilter addrKnownGavin Andresen2015-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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)
* Merge pull request #6059Wladimir J. van der Laan2015-04-301-1/+22
|\ | | | | | | 739d615 chainparams: use SeedSpec6's rather than CAddress's for fixed seeds (Cory Fields)
| * chainparams: use SeedSpec6's rather than CAddress's for fixed seedsCory Fields2015-04-241-1/+22
| | | | | | | | This negates the need for CAddress here at all
* | replace absolute sleep with conditional waitpstratem2015-04-271-2/+8
|/
* nLastTry is only used for addrman entriesPieter Wuille2015-04-191-1/+1
| | | | No need to define it for every CAddress, as it's memory only anyway.
* Merge pull request #5941Wladimir J. van der Laan2015-04-011-2/+1
|\ | | | | | | | | | | | | | | | | 1d21ba2 Scale up addrman (Pieter Wuille) c6a63ce Always use a 50% chance to choose between tried and new entries (Pieter Wuille) f68ba3f Do not bias outgoing connections towards fresh addresses (Pieter Wuille) a8ff7c6 Simplify hashing code (Pieter Wuille) e6b343d Make addrman's bucket placement deterministic. (Pieter Wuille) b23add5 Switch addrman key from vector to uint256 (Pieter Wuille)
| * Always use a 50% chance to choose between tried and new entriesPieter Wuille2015-03-231-2/+1
| | | | | | | | | | | | | | This change was suggested as Countermeasure 2 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.
* | don't trickle for whitelisted nodesRuben de Vries2015-03-241-1/+1
|/
* Merge pull request #5151Pieter Wuille2015-03-071-2/+2
|\ | | | | | | eec3713 make CMessageHeader a dumb storage class (Cory Fields)
| * make CMessageHeader a dumb storage classCory Fields2015-02-251-2/+2
| | | | | | | | It shouldn't know or care about bitcoind's chain param selection
* | src/net.cpp: endian compatibility in EndMessageWladimir J. van der Laan2015-03-061-1/+2
| |
* | Limit message sizes before transferPieter Wuille2015-03-061-0/+5
|/ | | | | This introduces a fixed limit for the size of p2p messages, and enforces it before download.
* Sanitize command strings before logging them.Gregory Maxwell2015-02-081-1/+1
| | | | | | | | | | Normally bitcoin core does not display any network originated strings without sanitizing or hex encoding. This wasn't done for strcommand in many places. This could be used to play havoc with a terminal displaying the logs, especially with printtoconsole in use. Thanks to Evil-Knievel for reporting this issue.
* Remove whitespaces before double colon in errors and logsPavel Janík2015-01-311-9/+9
|
* Delete RecvLine functionWladimir J. van der Laan2015-01-201-50/+0
| | | | No longer necessary since #5161 / 845c86d128fb97d55d125e63653def38729bd2ed.
* Merge pull request #5513Wladimir J. van der Laan2015-01-061-1/+0
|\ | | | | | | | | | | 856e862 namespace: drop most boost namespaces and a few header cleanups (Cory Fields) 9b1ab86 namespace: drop boost::assign altogether here (Cory Fields) a324199 namespace: remove boost namespace pollution (Cory Fields)
| * namespace: remove boost namespace pollutionCory Fields2015-01-021-1/+0
| |
* | Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan2015-01-051-1/+1
|/ | | | | | Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
* Merge pull request #5476Wladimir J. van der Laan2015-01-021-0/+2
|\ | | | | | | | | 73caf47 Display time offset in the debug window's Peers tab (Pavel Janík) 26a6bae Add time offset to getpeerinfo output (Pavel Janík)
| * Add time offset to getpeerinfo outputPavel Janík2014-12-151-0/+2
| |
* | Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | | | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* | Merge pull request #5470Wladimir J. van der Laan2014-12-191-1/+1
|\ \ | | | | | | | | | 78253fc Remove references to X11 licence (Michael Ford)
| * | Remove references to X11 licenceMichael Ford2014-12-161-1/+1
| |/
* | Remove outdated comment about NTPWladimir J. van der Laan2014-12-191-1/+0
| | | | | | | | | | The comment has been around since 0.1, but NTP inside the client isn't deemed necessary so remove the comment to avoid confusion.
* | make all catch() arguments constPhilip Kaufmann2014-12-171-5/+5
|/ | | | | | | - I saw this on http://en.cppreference.com/w/cpp/language/try_catch and thought it would be a good idea - also unify used format to better be able to search for exception uses in our codebase
* Merge pull request #5408Wladimir J. van der Laan2014-12-051-1/+7
|\ | | | | | | 35e408f Regard connection failures as attempt for addrman (Wladimir J. van der Laan)
| * Regard connection failures as attempt for addrmanWladimir J. van der Laan2014-12-021-1/+7
| | | | | | | | | | | | | | This avoids connecting to them again too soon in ThreadOpenConnections. Make an exception for connection failures to the proxy as these shouldn't affect the status of specific nodes.
* | MOVEONLY: core/ -> primitives/Luke Dashjr2014-12-031-1/+1
|/
* Win32: change buffer size for gethotsname in Discover()Philip Kaufmann2014-11-131-1/+1
| | | | | - 256 byte is the maximum, as per http://msdn.microsoft.com/en-us/library/windows/desktop/ms738527%28v=vs.85%29.aspx
* Win32: log addresses found in Discover() callsPhilip Kaufmann2014-11-131-4/+4
|
* Do not use third party services for IP detection.Gregory Maxwell2014-11-071-125/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a simplified re-do of closed pull #3088. This patch eliminates the privacy and reliability problematic use of centralized web services for discovering the node's addresses for advertisement. The Bitcoin protocol already allows your peers to tell you what IP they think you have, but this data isn't trustworthy since they could lie. So the challenge is using it without creating a DOS vector. To accomplish this we adopt an approach similar to the one used by P2Pool: If we're announcing and don't have a better address discovered (e.g. via UPNP) or configured we just announce to each peer the address that peer told us. Since peers could already replace, forge, or drop our address messages this cannot create a new vulnerability... but if even one of our peers is giving us a good address we'll eventually make a useful advertisement. We also may randomly use the peer-provided address for the daily rebroadcast even if we otherwise have a seemingly routable address, just in case we've been misconfigured (e.g. by UPNP). To avoid privacy problems, we only do these things if discovery is enabled.
* Separate protocol versioning from clientversionCory Fields2014-10-291-0/+1
|
* MOVEONLY: Separate CTransaction and dependencies from corejtimon2014-10-271-1/+1
|
* CAutoFile: Explicit Get() and remove unused methodsWladimir J. van der Laan2014-10-221-1/+1
| | | | Also add documentation to some methods.
* Add IsNull() to class CAutoFile and remove operator !Ruben Dario Ponticeli2014-10-201-2/+2
|
* Headers-first synchronizationPieter Wuille2014-10-141-50/+0
| | | | | | | | | | | | | | | Many changes: * Do not use 'getblocks', but 'getheaders', and use it to build a headers tree. * Blocks are fetched in parallel from all available outbound peers, using a limited moving window. When one peer stalls the movement of the window, it is disconnected. * No more orphan blocks. At all. We only ever request a block for which we have verified the headers, and store it to disk immediately. This means that a disk-fill attack would require PoW. * Require protocol version 31800 for every peer (released in december 2010). * No more syncnode (we sync from everyone we can, though limited to 1 during initial *headers* sync). * Introduce some extra named constants, comments and asserts.
* Merge pull request #4942Wladimir J. van der Laan2014-10-141-1/+19
|\ | | | | | | 9406471 Write fee estimate and peers files only when initialized (Wladimir J. van der Laan)
| * Write fee estimate and peers files only when initializedWladimir J. van der Laan2014-09-181-1/+19
| | | | | | | | | | | | | | Fixes #4669. Move the loading of addresses to StartNode() to make it more self-contained.
* | autofile: don't copy CAutoFile by valueCory Fields2014-09-251-2/+2
|/
* Merge pull request #4911Pieter Wuille2014-09-161-1/+1
|\ | | | | | | 611116d header include cleanup (Philip Kaufmann)
| * header include cleanupPhilip Kaufmann2014-09-141-1/+1
| | | | | | | | - ensures alphabetical ordering for includes etc. in source file headers
* | Merge pull request #4869Wladimir J. van der Laan2014-09-151-4/+0
|\ \ | | | | | | | | | 6050ab6 netbase: Make SOCKS5 negotiation interruptible (Wladimir J. van der Laan)
| * | netbase: Make SOCKS5 negotiation interruptibleWladimir J. van der Laan2014-09-101-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoids that SOCKS5 negotiation will hold up the shutdown process. - Sockets can stay in non-blocking mode, no need to switch it on/off anymore - Adds a timeout (20 seconds) on SOCK5 negotiation. This should be enough for even Tor to get a connection to a hidden service, and avoids blocking the opencon thread indefinitely on a hanging proxy. Fixes #2954.
* | | Fixing compiler warning C4101ENikS2014-09-151-1/+1
| |/ |/| | | | | Github-Pull: #4856