aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
AgeCommit message (Collapse)Author
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
2014-06-12Merge pull request #2784Wladimir J. van der Laan
f1920e8 Ping automatically every 2 minutes (unconditionally) (Pieter Wuille)
2014-06-11convert an if into an else if in OpenNetworkConnection()Philip Kaufmann
2014-06-11small cleanup of netPhilip Kaufmann
- remove an unneded else in ConnectNode() - make 0 a double and change to 0.0 in ConnectNode() - rename strDest to pszDest in OpenNetworkConnection() - remove an unneded call to our REF() macro in BindListenPort() - small style cleanups and removal of unneeded new-lines
2014-06-09Ping automatically every 2 minutes (unconditionally)Pieter Wuille
... instead of after 30 minutes of no sending, for latency measurement and keep-alive. Also, disconnect if no reply arrives within 20 minutes, instead of 90 of inactivity (for peers supporting the 'pong' message).
2014-06-04Merge pull request #4247 from Diapolo/listenJeff Garzik
rename fNoListen to fListen and move to net
2014-05-30Use pnode->nLastRecv as sync score directlyHuang Le
NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong. Also change the return value type to int64_t. Signed-off-by: Huang Le <4tarhl@gmail.com>
2014-05-29rename fNoListen to fListen and move to netPhilip Kaufmann
- better code readability and it belongs to net - this is a prerequisite for a pull to add -listen to the GUI
2014-05-29Merge pull request #4132Wladimir J. van der Laan
d4e1c61 add DEFAULT_UPNP constant in net (Philip Kaufmann)
2014-05-23Merge pull request #4152Wladimir J. van der Laan
3e8ac6a Replace non-threadsafe gmtime and setlocale (Wladimir J. van der Laan) a60838d Replace non-threadsafe strerror (Wladimir J. van der Laan)
2014-05-23Replace non-threadsafe strerrorWladimir J. van der Laan
Log the name of the error as well as the error code if a network problem happens. This makes network troubleshooting more convenient. Use thread-safe strerror_r and the WIN32 equivalent FormatMessage.
2014-05-20add DEFAULT_UPNP constant in netPhilip Kaufmann
- as this is a shared Core/GUI setting, this makes it easier to keep them in sync (also no new includes are needed)
2014-05-10Fix addnode "onetry": Connect with OpenNetworkConnectionCozz Lovan
2014-05-06rpc: add `getblockchaininfo` and `getnetworkinfo`Wladimir J. van der Laan
Adds two new info query commands that take over information from hodge-podge `getinfo`. Also some new information is added: - `getblockchaininfo` - `chain`: (string) current chain (main, testnet3, regtest) - `verificationprogress: (numeric) estimated verification progress - `chainwork` - `getnetworkinfo` - `localaddresses`: (array) local addresses, from mapLocalHost (fixes #1734)
2014-05-02better std::exception logging for CAddrDbPhilip Kaufmann
- also small logging text changes
2014-05-01Remove build-time no-IPv6 settingWladimir J. van der Laan
The year is 2014. All supported operating systems have IPv6 support, most certainly at build time (this doesn't mean that IPv6 is configured, of course). If noone is exercising the functionality to disable it, that means it doesn't get tested, and IMO it's better to get rid of it. (it's also not used consistently in RPC/boost and Net code...)
2014-04-09Prevent socket leak in ThreadSocketHandler.Gregory Maxwell
When we are over our outbound limit ThreadSocketHandler would try to keep the connection if the peer was addnoded. This didn't actually work for two reasons: It didn't actually run the accept code due to mistaken code flow, and because we have a limited number of outbound semaphores it couldn't actually use the connection. Instead it leaked the socket, which might have caused issue #4034. This patch just takes out the non-functioning white-listing for now.
2014-03-27Merge pull request #3603Wladimir J. van der Laan
a486abd replace custom GetFilesize() with boost::filesystem::file_size() (Philip Kaufmann)
2014-03-05Slightly tweak error when unable to bind portMichagogo
A slight improvement over 2d2d8fae3d8bc4e82dc631d93c6e19f954bbee04 -- we don't know that it's the daemon, it could be the GUI.
2014-03-05Clarify the error message when unable to bind to portpaveljanik
2014-03-05Bitcoin is running fine...paveljanik
When bitcoind can't bind, bitcoin server (or Bitcoin Core Daemon) is probably already running. Add the missing word "server". Bitcoin itself is definitely running ;-) Add _(...) so the string can be localized. I apologize for such trivial changes, learning github interface.
2014-03-03replace custom GetFilesize() with boost::filesystem::file_size()Philip Kaufmann
2014-02-24Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan
Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h indirectly, so we cannot fix this with just macros. Trivial commit: apply the following script to all .cpp and .h files: # Middle sed -i 's/"PRIx64"/x/g' "$1" sed -i 's/"PRIu64"/u/g' "$1" sed -i 's/"PRId64"/d/g' "$1" # Initial sed -i 's/PRIx64"/"x/g' "$1" sed -i 's/PRIu64"/"u/g' "$1" sed -i 's/PRId64"/"d/g' "$1" # Trailing sed -i 's/"PRIx64/x"/g' "$1" sed -i 's/"PRIu64/u"/g' "$1" sed -i 's/"PRId64/d"/g' "$1" After this commit, `git grep` for PRI.64 should turn up nothing except the defines in util.h.
2014-02-09Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron
in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
2014-01-23Remove redundant .c_str()sWladimir J. van der Laan
After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
2013-12-19Make bitcoin compile without wallet if "db_cxx.h" is not presentThomas Holenstein
Moved includes of "db.h" into #ifdef ENABLE_WALLET blocks or remove them.
2013-12-09Merge pull request #3373Wladimir J. van der Laan
80ecf67 Add ThreadGetMyExternalIP to net thread group (Gavin Andresen)
2013-12-09Add ThreadGetMyExternalIP to net thread groupGavin Andresen
Fixes #3372 -- crash at shutdown.
2013-12-08Add main-specific node statePieter Wuille
2013-12-04Move CAddrDB frrom db to netWladimir J. van der Laan
This was a leftover from the times in which peers.dat depended in BDB. Other functions in db.cpp still depend on BerkelyDB, to be able to compile without BDB this (small) functionality needs to be moved to another file.
2013-11-26Store and use a sanitized subVerMike Hearn
2013-11-20Merge pull request #3257Wladimir J. van der Laan
379778b core: remove includes in .cpp, if header is already in .h (Philip Kaufmann)
2013-11-15orphan spaces cleanup ;-)Philip Kaufmann
2013-11-15core: remove includes in .cpp, if header is already in .hPhilip Kaufmann
- example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
2013-11-10Cleanup code using forward declarations.Brandon Dahler
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
2013-11-03process received messages one at a time without sleeping between messagesPatrick Strateman
2013-10-29-fuzzmessagestest=N : randomly corrupt 1-of-N sent messagesGavin Andresen
I needed this to test the new "reject" p2p message, but it should be generally useful for fuzz-testing network message handling code.
2013-10-21Adding new "addrlocal" field to RPC getpeerinfo.Josh Lehan
The existing CNode::addrLocal member is revealed to the user, as an address string, similar to the existing "addr" field. Instead of showing garbage or empty string, it simply will not appear in the output if local address not known yet.
2013-10-20Merge pull request #2840 from sipa/nosendlockGavin Andresen
Allow SendMessages to run partially without cs_main
2013-10-20Merge pull request #3119Pieter Wuille
db0e8cc Bump Year Number to 2013 (super3)
2013-10-20Bump Year Number to 2013super3
2013-10-15Run node deletions outside of cs_vNodesPieter Wuille