aboutsummaryrefslogtreecommitdiff
path: root/src/rpcnet.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce whitelisted peers.Pieter Wuille2014-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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).
* remove SOCKS4 support from core and GUIPhilip Kaufmann2014-07-071-1/+1
| | | | - now we support SOCKS5 only
* Move fee policy out of coreGavin Andresen2014-07-031-1/+1
|
* Track peers' available blocksPieter Wuille2014-06-291-0/+1
|
* Move network-time related functions to timedata.cpp/hWladimir J. van der Laan2014-06-251-0/+1
| | | | | The network time-offset-mangement functions from util.cpp are moved to timedata.(cpp|h). This breaks the dependency of util on netbase.
* Add nLocalServices info to RPC getinfoPeter Todd2014-06-211-2/+4
| | | | | Also show full 64 bits of services. Previously service bits >32 that were advertised just didn't show up at all.
* Type-safe CFeeRate classGavin Andresen2014-06-061-1/+1
| | | | | | | | Use CFeeRate instead of an int64_t for quantities that are fee-per-size. Helps prevent unit-conversion mismatches between the wallet, relaying, and mining code.
* Merge pull request #4166Wladimir J. van der Laan2014-05-231-1/+1
|\ | | | | | | b641c9c Fix addnode "onetry": Connect with OpenNetworkConnection (Cozz Lovan)
| * Fix addnode "onetry": Connect with OpenNetworkConnectionCozz Lovan2014-05-101-1/+1
| |
* | removed a few unnecessary castsKamil Domanski2014-05-131-9/+9
| |
* | switch from boost int types to <stdint.h>Kamil Domanski2014-05-131-8/+8
|/
* rpc: add `getblockchaininfo` and `getnetworkinfo`Wladimir J. van der Laan2014-05-061-0/+51
| | | | | | | | | | | | | 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)
* Organize RPCCommands tableWladimir J. van der Laan2014-03-311-4/+0
| | | | | | | | | Use sensible categories (overall control, P2P, blockchain/UTXO and mining, wallet, wallet-enabled mining) and sort within each. Also remove unnecessary #ifdef ENABLE_WALLET from `rpcnet.cpp`. Functionality-neutral change.
* Merge pull request #3682Wladimir J. van der Laan2014-03-271-2/+1
|\ | | | | | | 3e0753b always show syncnode in getpeerinfo (fixes #2717) (Philip Kaufmann)
| * always show syncnode in getpeerinfo (fixes #2717)Philip Kaufmann2014-02-161-2/+1
| |
* | Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan2014-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Don't use PRIx64 formatting derives from inttypes.hWladimir J. van der Laan2014-02-221-2/+0
|/ | | | | | | | | | | | As the tinyformat-based formatting system (introduced in b77dfdc) is type-safe, no special format characters are needed to specify sizes. Tinyformat can support (ignore) the C99 prefixes such as "ll" but chokes on MSVC's inttypes.h defines prefixes such as "I64X". So don't include inttypes.h and define our own for compatibility. (an alternative would be to sweep the entire codebase using sed -i to get rid of the size specifiers but this has less diff impact)
* Merge pull request #3646Wladimir J. van der Laan2014-02-161-1/+1
|\ | | | | | | 5770254 Copyright header updates s/2013/2014 on files whose last git commit was done 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. (gubatron)
| * Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron2014-02-091-1/+1
| | | | | | | | | | | | 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.
* | small changes to rpc command help message stringsPhilip Kaufmann2014-01-301-1/+1
|/
* Fix `getaddednodeinfo` RPC call with dns=falseWladimir J. van der Laan2014-01-291-4/+6
| | | | | | | | | | The getaddednodeinfo RPC call, when invoked with the dns flag set to false, returns a malformed JSON object with duplicate keys. Change this to return an array of objects with one key as shown in the help message. Fixes #3581.
* Move `getinfo` from rpcnet to rpcmiscWladimir J. van der Laan2013-12-131-62/+0
| | | | | | `getinfo` is a general info method which shows information from multiple sources, it doesn't belong in rpcnet.cpp or any of the other current RPC implementation files.
* cleanup includes in rpcnet.cppPhilip Kaufmann2013-12-091-3/+2
|
* Add main-specific node statePieter Wuille2013-12-081-2/+8
|
* Merge pull request #3332Wladimir J. van der Laan2013-12-081-1/+67
|\ | | | | | | | | | | | | | | | | | | | | 5094f8d Split off rpc_wallet_tests (Wladimir J. van der Laan) 829c920 Move CCryptoKeyStore to crypter.cpp (Wladimir J. van der Laan) ae6ea5a Update build-unix.md to mention --disable-wallet (Wladimir J. van der Laan) 4f9e993 Add --disable-wallet option to build system (Wladimir J. van der Laan) d004d72 Move CAddrDB frrom db to net (Wladimir J. van der Laan) 48ba56c Delimit code with #ifdef ENABLE_WALLET (Wladimir J. van der Laan) 991685d Move getinfo to rpcnet.cpp (Wladimir J. van der Laan) bbb0936 Move HelpExample* from rpcwallet to rpcserver (Wladimir J. van der Laan)
| * Delimit code with #ifdef ENABLE_WALLETWladimir J. van der Laan2013-12-041-1/+8
| | | | | | | | | | Delimit all code that uses the wallet functions in implementation files that conditionally use the wallet.
| * Move getinfo to rpcnet.cppWladimir J. van der Laan2013-12-041-0/+59
| | | | | | | | | | | | | | | | Where to place `getinfo` is a difficult issue as it shows information from the wallet, net and block chain. However, I moved it out of rpcwallet as the command needs also to be available without wallet.
* | fix typo in rpcnet.cppPhilip Kaufmann2013-12-051-1/+1
|/
* Merge pull request #3284Wladimir J. van der Laan2013-11-271-3/+1
|\ | | | | | | fb78cc2 Split up bitcoinrpc (code movement only) (Wladimir J. van der Laan)
| * Split up bitcoinrpc (code movement only)Wladimir J. van der Laan2013-11-271-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Split bitcoinrpc up into - rpcserver: bitcoind RPC server - rpcclient: bitcoin-cli RPC client - rpcprotocol: shared common HTTP/JSON-RPC protocol code One step towards making bitcoin-cli independent from the rest of the code, and thus a smaller executable that doesn't have to be linked against leveldb. This commit only does code movement, there are no functional changes.
* | Store and use a sanitized subVerMike Hearn2013-11-261-1/+4
|/
* Issue #1865 - Clean up RPC help messagessje2013-11-131-11/+89
| | | | | | | | | | | | | | | | | | | Based on the proposal, update the help message of rpc methods - strings arguments are in double quotes rather than square brackets - numeric arguments have no quotes (and no default value) - optional parameters are surrounded by round brackets - json arguments are strings but don't use double quotes Added 3 sections for the details - Arguments: lists each argument, it's type, required or not, a default, and a description - Result: The method result, with json format if applicable, type, and a description - Examples: examples calls using bitcoin-cli and curl for json rpc call Problems - maybe this is too verbose - lines might be too long - description are not good or complete - examples may be too much
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-2/+13
| | | | | | | | | 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.
* RPC: error code changes and prevent crash with walletpassphrasePhilip Kaufmann2013-10-241-4/+4
| | | | | | | | | | - fix crash with walletpassphrase by checking if RPC server is running and give a friendly error message how to fix this (fixes #3100) - add 3 new RPCErrorCodes RPC_SERVER_NOT_STARTED, RPC_NODE_ALREADY_ADDED and RCP_NODE_NOT_ADDED (I checked the source to not use a number already in use for RPC_SERVER_NOT_STARTED) - use the new codes where needed / missing - add missing use of RPC_INVALID_PARAMETER
* Adding new "addrlocal" field to RPC getpeerinfo.Josh Lehan2013-10-211-0/+2
| | | | | | | 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.
* 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
| |
* | Add network traffic graphScott Ellis2013-10-141-0/+14
| |
* | Added ping time measurement.Josh Lehan2013-10-041-0/+21
|/ | | | | | | 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.
* Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-1/+1
| | | | | | | | | | | | | 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.
* Merge pull request #2461 from sipa/syncnodeGavin Andresen2013-04-091-0/+4
|\ | | | | Make sure we always have a node to do IBD from
| * Add bytessent, bytesrecv and syncnode to getpeerinfoPieter Wuille2013-04-071-0/+4
| |
* | Drop release times for CNodePieter Wuille2013-04-041-1/+0
|/ | | | | | | | | | | | | | 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.
* Add a getaddednodeinfo RPC.Matt Corallo2013-01-271-0/+92
|
* Add addnode RPC command.Matt Corallo2013-01-271-0/+42
|
* Trim trailing whitespace for src/*.{h,cpp}Jeff Garzik2012-09-181-1/+1
|
* RPC getpeerinfo: s/height/startingheight/ for returned nStartingHeight valueJeff Garzik2012-06-301-1/+1
|
* RPC: add 'getpeerinfo', returning easy-to-retrieve per-CNode dataJeff Garzik2012-06-291-0/+46
|
* Create new rpcnet module, and move 'getconnectioncount' RPC to itJeff Garzik2012-06-281-0/+21