aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
AgeCommit message (Collapse)Author
2014-10-29Separate protocol versioning from clientversionCory Fields
2014-10-27MOVEONLY: Separate CTransaction and dependencies from corejtimon
2014-10-22CAutoFile: Explicit Get() and remove unused methodsWladimir J. van der Laan
Also add documentation to some methods.
2014-10-20Add IsNull() to class CAutoFile and remove operator !Ruben Dario Ponticeli
2014-10-14Headers-first synchronizationPieter Wuille
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.
2014-10-14Merge pull request #4942Wladimir J. van der Laan
9406471 Write fee estimate and peers files only when initialized (Wladimir J. van der Laan)
2014-09-25autofile: don't copy CAutoFile by valueCory Fields
2014-09-18Write fee estimate and peers files only when initializedWladimir J. van der Laan
Fixes #4669. Move the loading of addresses to StartNode() to make it more self-contained.
2014-09-16Merge pull request #4911Pieter Wuille
611116d header include cleanup (Philip Kaufmann)
2014-09-15Merge pull request #4869Wladimir J. van der Laan
6050ab6 netbase: Make SOCKS5 negotiation interruptible (Wladimir J. van der Laan)
2014-09-15Fixing compiler warning C4101ENikS
Github-Pull: #4856
2014-09-14header include cleanupPhilip Kaufmann
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-10Merge pull request #4878Wladimir J. van der Laan
540ac45 Avoid returning many "inv" orphans (Jeff Garzik) d4168c8 Limit CNode::mapAskFor (Wladimir J. van der Laan)
2014-09-10netbase: Make SOCKS5 negotiation interruptibleWladimir J. van der Laan
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.
2014-09-09Remove some unnecessary c_strs() in logging and the GUIPhilip Kaufmann
Includes `core: remove unneeded c_str() / Qt: replace c_str() with Qt code` by P. Kaufmann.
2014-09-09Limit CNode::mapAskForWladimir J. van der Laan
Tighten resource constraints on CNode.
2014-09-04Merge pull request #4833Wladimir J. van der Laan
bbda402 net: Remove MilliSleep from StopNode (Wladimir J. van der Laan)
2014-09-03net: Remove MilliSleep from StopNodeWladimir J. van der Laan
I don't understand why it would be there in the first place. This looks like voodoo, not programming.
2014-09-02remove useless millisleepphantomcircuit
reduces time to service requests improving performance
2014-08-27Revert "Add a getutxos command to the p2p protocol. It allows querying of ↵Wladimir J. van der Laan
the UTXO set" This reverts commit da2ec100f3681176f60dec6dc675fc64147ade3a.
2014-08-26Split up util.cpp/hWladimir J. van der Laan
Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
2014-08-26move functions in main and net to implementation filesWladimir J. van der Laan
2014-08-25Merge pull request #4351Wladimir J. van der Laan
da2ec10 Add a getutxos command to the p2p protocol. It allows querying of the UTXO set given a set of outpoints. (Mike Hearn)
2014-08-18Merge pull request #4605Wladimir J. van der Laan
aa82795 Add detailed network info to getnetworkinfo RPC (Wladimir J. van der Laan) 075cf49 Add GetNetworkName function (Wladimir J. van der Laan) c91a947 Add IsReachable(net) function (Wladimir J. van der Laan) 60dc8e4 Allow -onlynet=onion to be used (Wladimir J. van der Laan)
2014-08-13Don't poll showmyip.com, it doesn't exist anymoreWladimir J. van der Laan
Fixes #4679. This leaves us with only one candidate, checkip.dyndns.org. GetMyExternalIP should be phased out as soon as possible.
2014-08-11Add a getutxos command to the p2p protocol. It allows querying of the UTXO setMike Hearn
given a set of outpoints.
2014-07-30Add IsReachable(net) functionWladimir J. van der Laan
Allows other parts of the program to query for reachable status of a network. Similar to IsLimited(net).
2014-07-29Avoid querying DNS seeds, if we have open connections.Jeff Garzik
The goal is to increase independence and privacy.
2014-07-28Merge pull request #4491Wladimir J. van der Laan
eaedb59 net: add SetSocketNonBlocking() as OS independent wrapper (Philip Kaufmann)
2014-07-25Merge pull request #4584Wladimir J. van der Laan
0430c30 Add missing FindNode prototype to net.h (Wladimir J. van der Laan)
2014-07-24Add missing FindNode prototype to net.hWladimir J. van der Laan
Also make the argument a const std::string & instead of pass-by-value.
2014-07-21remove an unneded .c_str() in OpenNetworkConnection()Philip Kaufmann
2014-07-17prevent SOCKET leak in BindListenPort()Philip Kaufmann
- the call to CloseSocket() is placed after the WSAGetLastError(), because a CloseSocket() can trigger an error also, which we don't want for the logging in this two cases
2014-07-17net: add SetSocketNonBlocking() as OS independent wrapperPhilip Kaufmann
2014-07-17Convert closesocket 'compat wrapper' to function in netbaseWladimir J. van der Laan
Simpler alternative to #4348. The current setup with closesocket() is strange. It poses as a compatibility wrapper but adds functionality. Rename it and make it a documented utility function in netbase. Code movement only, zero effect on the functionality.
2014-07-14Merge pull request #4400Wladimir J. van der Laan
4eedf4f make RandAddSeed() use OPENSSL_cleanse() (Philip Kaufmann) 6354935 move rand functions from util to new random.h/.cpp (Philip Kaufmann) 001a53d add GetRandBytes() as wrapper for RAND_bytes() (Philip Kaufmann)
2014-07-09Introduce whitelisted peers.Pieter Wuille
This adds a -whitelist option to specify subnet ranges from which peers that connect are whitelisted. In addition, there is a -whitebind option which works like -bind, except peers connecting to it are also whitelisted (allowing a separate listen port for trusted connections). Being whitelisted has two effects (for now): * They are immune to DoS disconnection/banning. * Transactions they broadcast (which are valid) are always relayed, even if they were already in the mempool. This means that a node can function as a gateway for a local network, and that rebroadcasts from the local network will work as expected. Whitelisting replaces the magic exemption localhost had for DoS disconnection (local addresses are still never banned, though), which implied hidden service connects (from a localhost Tor node) were incorrectly immune to DoS disconnection as well. This old behaviour is removed for that reason, but can be restored using -whitelist=127.0.0.1 or -whitelist=::1 can be specified. -whitebind is safer to use in case non-trusted localhost connections are expected (like hidden services).
2014-07-09add GetRandBytes() as wrapper for RAND_bytes()Philip Kaufmann
- add a small wrapper in util around RAND_bytes() and replace with GetRandBytes() in the code to log errors from calling RAND_bytes() - remove OpenSSL header rand.h where no longer needed
2014-07-07Merge pull request #4472Wladimir J. van der Laan
9f4da19 Use pong receive time rather than processing time (Pieter Wuille)
2014-07-06Use pong receive time rather than processing timePieter Wuille
2014-07-04Show nodeid instead of addresses (for anonymity) unless otherwise requested.R E Broadley
2014-06-26add missing BOOST_FOREACH indentation in ThreadSocketHandler()Philip Kaufmann
2014-06-26small cleanup of #ifdefs in BindListenPort()Philip Kaufmann
- SO_NOSIGPIPE isn't available on WIN32 so merge the 2 non-WIN32 blocks - use predefined names from header for IPV6_PROTECTION_LEVEL and PROTECTION_LEVEL_UNRESTRICTED
2014-06-23build: fix build weirdness after 54372482.Cory Fields
bitcoin-config.h moved, but the old file is likely to still exist when reconfiguring or switching branches. This would've caused files to not rebuild correctly, and other strange problems. Make the path explicit so that the old one cannot be found. Core libs use config/bitcoin-config.h. Libs (like crypto) which don't want access to bitcoin's headers continue to use -Iconfig and #include bitcoin-config.h.
2014-06-23Merge pull request #4388Wladimir J. van der Laan
3dc1464 add missing vhListenSocket.clear(); to CNetCleanup() (Philip Kaufmann) 2831a03 remove unused CNode::Cleanup() (Philip Kaufmann)
2014-06-22Merge pull request #4309Pieter Wuille
d38da59 Code simplifications after CTransaction::GetHash() caching (Pieter Wuille) 4949004 Add CMutableTransaction and make CTransaction immutable. (Pieter Wuille)
2014-06-22add missing vhListenSocket.clear(); to CNetCleanup()Philip Kaufmann
2014-06-22remove unused CNode::Cleanup()Philip Kaufmann
2014-06-22Code simplifications after CTransaction::GetHash() cachingPieter Wuille
2014-06-21Allocate receive buffers in on the flyPieter Wuille