aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
AgeCommit message (Collapse)Author
2015-03-07Merge pull request #5151Pieter Wuille
eec3713 make CMessageHeader a dumb storage class (Cory Fields)
2015-03-06src/net.cpp: endian compatibility in EndMessageWladimir J. van der Laan
2015-03-06Limit message sizes before transferPieter Wuille
This introduces a fixed limit for the size of p2p messages, and enforces it before download.
2015-02-25make CMessageHeader a dumb storage classCory Fields
It shouldn't know or care about bitcoind's chain param selection
2015-02-08Sanitize command strings before logging them.Gregory Maxwell
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.
2015-01-31Remove whitespaces before double colon in errors and logsPavel Janík
2015-01-20Delete RecvLine functionWladimir J. van der Laan
No longer necessary since #5161 / 845c86d128fb97d55d125e63653def38729bd2ed.
2015-01-06Merge pull request #5513Wladimir J. van der Laan
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)
2015-01-05Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
2015-01-02namespace: remove boost namespace pollutionCory Fields
2015-01-02Merge pull request #5476Wladimir J. van der Laan
73caf47 Display time offset in the debug window's Peers tab (Pavel Janík) 26a6bae Add time offset to getpeerinfo output (Pavel Janík)
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19Merge pull request #5470Wladimir J. van der Laan
78253fc Remove references to X11 licence (Michael Ford)
2014-12-19Remove outdated comment about NTPWladimir J. van der Laan
The comment has been around since 0.1, but NTP inside the client isn't deemed necessary so remove the comment to avoid confusion.
2014-12-17make all catch() arguments constPhilip Kaufmann
- 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
2014-12-16Remove references to X11 licenceMichael Ford
2014-12-15Add time offset to getpeerinfo outputPavel Janík
2014-12-05Merge pull request #5408Wladimir J. van der Laan
35e408f Regard connection failures as attempt for addrman (Wladimir J. van der Laan)
2014-12-03MOVEONLY: core/ -> primitives/Luke Dashjr
2014-12-02Regard connection failures as attempt for addrmanWladimir J. van der Laan
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.
2014-11-13Win32: change buffer size for gethotsname in Discover()Philip Kaufmann
- 256 byte is the maximum, as per http://msdn.microsoft.com/en-us/library/windows/desktop/ms738527%28v=vs.85%29.aspx
2014-11-13Win32: log addresses found in Discover() callsPhilip Kaufmann
2014-11-07Do not use third party services for IP detection.Gregory Maxwell
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.
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).