aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2840 from sipa/nosendlockGavin Andresen2013-10-201-1/+2
|\ | | | | Allow SendMessages to run partially without cs_main
| * Run node deletions outside of cs_vNodesPieter Wuille2013-10-151-1/+2
| |
* | Merge pull request #3119Pieter Wuille2013-10-201-1/+1
|\ \ | |/ |/| | | db0e8cc Bump Year Number to 2013 (super3)
| * Bump Year Number to 2013super32013-10-201-1/+1
| |
* | Merge pull request #2924 from sje397/TrafficGraphWladimir J. van der Laan2013-10-151-5/+32
|\ \ | | | | | | [QT] Add network traffic graph to debug window
| * | Add network traffic graphScott Ellis2013-10-141-5/+32
| | |
* | | Merge pull request #3077 from sipa/chainGavin Andresen2013-10-141-0/+4
|\ \ \ | |/ / |/| | Refactor/encapsulate chain globals into a CChain class
| * | Refactor/encapsulate chain globals into a CChain classPieter Wuille2013-10-111-0/+4
| |/
* / Added ping time measurement.Josh Lehan2013-10-041-0/+15
|/ | | | | | | New RPC "ping" command to request ping. Implemented "pong" message handler. New "pingtime" field in getpeerinfo, to provide results to user. New "pingwait" field, to show pings still in flight, to better see newly lagging peers.
* Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-48/+47
|
* autotools: switch to autotools buildsystemCory Fields2013-09-051-0/+7
|
* Merge pull request #2618 from fcicq/solaris-supportJeff Garzik2013-08-241-0/+4
|\ | | | | Partial solaris support
| * Fix fcntl include in net.cpp & netbase.cppfcicq2013-07-171-0/+4
| |
* | Remove #define loop from util.hGavin Andresen2013-07-311-6/+6
| | | | | | | | | | Replace the loop macro with while (true). The #define caused problems for Qt.
* | fix invalid conversion error with MinGW 4.8.1 in net.cppPhilip Kaufmann2013-07-131-0/+4
|/ | | | | | - fixes src\net.cpp:1601: Error:invalid conversion from 'void*' to 'const char*' [-fpermissive] in a setsockopt() call on Win32 that was found by using MinGW 4.8.1 compiler suite
* Dump addresses every 15 minutes instead of 10 secondsPieter Wuille2013-06-241-1/+4
|
* Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-130/+20
| | | | | | | | | | | | | The new class is accessed via the Params() method and holds most things that vary between main, test and regtest networks. The regtest mode has two purposes, one is to run the bitcoind/bitcoinj comparison tool which compares two separate implementations of the Bitcoin protocol looking for divergence. The other is that when run, you get a local node which can mine a single block instantly, which is highly convenient for testing apps during development as there's no need to wait 10 minutes for a block on the testnet.
* send tx relay flag with versionbitsofproof2013-06-111-1/+1
|
* changes to thread code (directly use boost::thread)Philip Kaufmann2013-06-101-7/+4
| | | | | | | - removes our NewThread() function an replaces remaining calls with boost::thread with our TraceThread template - remove ExitThread() function - fix THREAD_PRIORITY_ABOVE_NORMAL for non Windows OSes
* Removed the main.h include from net.cpp.Eric Lombrozo2013-06-061-7/+1
|
* Using boost::signals2 to message main from net.cpp.Eric Lombrozo2013-06-051-24/+6
|
* Removed net.cpp's dependency on init.h.Eric Lombrozo2013-06-051-3/+25
| | | | | | | | | | Added explicit include of main.h in init.cpp, changed include of init.h to include of main.h in net.cpp. Added function registration for net.cpp in init.cpp's network initialization. Removed protocol.cpp's dependency on main.h. TODO: Remove main.h include in net.cpp.
* Moved unrelated-to-network calls in StartNode and StopNode into init.cppEric Lombrozo2013-06-051-1/+0
|
* Moved PushGetBlocks to main.cpp to eliminate dependence of net.cpp on ↵Eric Lombrozo2013-06-051-11/+0
| | | | CBlockLocator.
* Do not kill connections on recv buffer overflowPieter Wuille2013-05-011-15/+30
| | | | | | | | Instead of killing a connection when the receive buffer overflows, just temporarily halt receiving before that happens. Also, no matter what, always allow at least one full message in the receive buffer (otherwise blocks larger than the configured buffer size would pause indefinitely).
* Try to increase file descriptor rlimit if necessaryPieter Wuille2013-04-291-2/+3
| | | | As the default can be too low, especially on OSX.
* move WSAStartup to initWladimir J. van der Laan2013-04-281-12/+0
| | | | | | | WSAStartup should be called before using any other socket functions. BindListenPort is not called if not listening. Closes #2585.
* Merge pull request #2461 from sipa/syncnodeGavin Andresen2013-04-091-7/+57
|\ | | | | Make sure we always have a node to do IBD from
| * Add bytessent, bytesrecv and syncnode to getpeerinfoPieter Wuille2013-04-071-0/+5
| |
| * Make sure we always have a node to do IBD fromPieter Wuille2013-04-071-7/+52
| | | | | | | | | | | | | | | | | | This introduces the concept of the 'sync node', which is the one we asked for missing blocks. In case the sync node goes away, a new one will be selected. For now, the heuristic is very simple, but it can easily be extended later to add better policies.
* | net.cpp: Do not change primary process name from (default) to "bitcoin-start"Jeff Garzik2013-04-081-3/+0
| | | | | | | | Discussed a bit on IRC.
* | Merge pull request #2419 from sipa/noreltimePieter Wuille2013-04-081-11/+3
|\ \ | |/ |/| Drop release times for CNode
| * Drop release times for CNodePieter Wuille2013-04-041-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems there were two mechanisms for assessing whether a CNode was still in use: a refcount and a release timestamp. The latter seems to have been there for a long time, as a safety mechanism. However, this timer also keeps CNode objects alive for far longer than necessary after disconnects, potentially opening up a DoS window. This commit removes the timestamp-based mechanism, and replaces it with an assert(nRefCount >= 0), to verify that the refcounting is indeed correctly working.
* | small indentation, space, formatting fixes (no code changes)Philip Kaufmann2013-04-061-14/+10
|/
* Merge pull request #2423 from TheBlueMatt/limitedmapalreadyaskedforGavin Andresen2013-04-031-1/+1
|\ | | | | Limited mapAlreadyAskedFor
| * Move mapAlreadyAskedFor to limitedmapMatt Corallo2013-04-011-1/+1
| | | | | | | | | | | | This will result in re-requesting invs if we are under heavy inv load, however as long as we get no more than 16,000 invs in two minutes, this should have no effect on runtime behavior.
* | Clean up shutdown processGavin Andresen2013-04-031-25/+10
| |
* | Port Thread* methods to boost::thread_groupGavin Andresen2013-04-031-297/+57
| |
* | Rename util.h Sleep --> MilliSleepGavin Andresen2013-04-031-17/+17
| | | | | | | | | | | | | | | | Two reasons for this change: 1. Need to always use boost::thread's sleep, even on Windows, so the sleeps can be interrupted (prior code used Windows' built-in Sleep). 2. I always forgot what units the old Sleep took.
* | Shutdown cleanup prep-workGavin Andresen2013-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Create a boost::thread_group object at the qt/bitcoind main-loop level that will hold pointers to all the main-loop threads. This will replace the vnThreadsRunning[] array. For testing, ported the BitcoinMiner threads to use its own boost::thread_group.
* | Merge pull request #2420 from sipa/globcleanGavin Andresen2013-04-021-2/+15
|\ \ | | | | | | Global cleanups
| * | Clean up global datastructures at shutdown.Pieter Wuille2013-03-291-2/+15
| | | | | | | | | | | | This should make detecting leaks much easier.
* | | Move GenerateBitcoins() call out of net.cpp's StartNode()Jeff Garzik2013-03-311-3/+0
| |/ |/| | | | | | | The internal miner is closely bound to the wallet engine, not the blockchain engine.
* | Use per-message send buffer, rather than per connectionPieter Wuille2013-03-291-21/+38
| |
* | Some fixes to CNetMessage processingPieter Wuille2013-03-291-2/+9
| | | | | | | | | | | | * Change CNode::vRecvMsg to be a deque instead of a vector (less copying) * Make sure to acquire cs_vRecvMsg in CNode::CloseSocketDisconnect (as it may be called without that lock).
* | P2P: improve RX/TX flow controlJeff Garzik2013-03-291-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) "optimistic write": Push each message to kernel socket buffer immediately. 2) If there is write data at select time, that implies send() blocked during optimistic write. Drain write queue, before receiving any more messages. This avoids needlessly queueing received data, if the remote peer is not themselves receiving data. Result: write buffer (and thus memory usage) is kept small, DoS potential is slightly lower, and TCP flow control signalling is properly utilized. The kernel will queue data into the socket buffer, then signal the remote peer to stop sending data, until we resume reading again.
* | P2P, cosmetic: break out buffer send(2) code into separate functionJeff Garzik2013-03-291-22/+25
| |
* | P2P: parse network datastream into header/data components in socket threadJeff Garzik2013-03-291-13/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces CNode::vRecv buffer with a vector of CNetMessage's. This simplifies ProcessMessages() and eliminates several redundant data copies. Overview: * socket thread now parses incoming message datastream into header/data components, as encapsulated by CNetMessage * socket thread adds each CNetMessage to a vector inside CNode * message thread (ProcessMessages) iterates through CNode's CNetMessage vector Message parsing is made more strict: * Socket is disconnected, if message larger than MAX_SIZE or if CMessageHeader deserialization fails (latter is impossible?). Previously, code would simply eat garbage data all day long. * Socket is disconnected, if we fail to find pchMessageStart. We do not search through garbage, to find pchMessageStart. Each message must begin precisely after the last message ends. ProcessMessages() always processes a complete message, and is more efficient: * buffer is always precisely sized, using CDataStream::resize(), rather than progressively sized in 64k chunks. More efficient for large messages like "block". * whole-buffer memory copy eliminated (vRecv -> vMsg) * other buffer-shifting memory copies eliminated (vRecv.insert, vRecv.erase)
* | Add a new testnet dnsseed (currently only static list, will update)Matt Corallo2013-03-241-0/+1
| |
* | (finally) Remove IRC Seed support now that lfnet is down.Matt Corallo2013-03-241-6/+0
|/