Commit graph

69 commits

Author SHA1 Message Date
Jonas Schnelli 3df0411ad9 remove JSON Spirit UniValue wrapper 2015-06-04 09:16:06 +02:00
Jonas Schnelli 6c7bee0624 expicit set UniValue type to avoid empty values 2015-06-04 09:16:05 +02:00
Jeff Garzik 15982a8b69 Convert tree to using univalue. Eliminate all json_spirit uses. 2015-06-04 09:16:05 +02:00
Wladimir J. van der Laan 67a7949397 privacy: Stream isolation for Tor
According to Tor's extensions to the SOCKS protocol
(https://gitweb.torproject.org/torspec.git/tree/socks-extensions.txt)
it is possible to perform stream isolation by providing authentication
to the proxy. Each set of credentials will create a new circuit,
which makes it harder to correlate connections.

This patch adds an option, `-proxyrandomize` (on by default) that randomizes
credentials for every outgoing connection, thus creating a new circuit.

    2015-03-16 15:29:59 SOCKS5 Sending proxy authentication 3842137544:3256031132
2015-04-17 13:26:47 +02:00
Eric Lombrozo 4401b2d7c5 Removed main.h dependency from rpcserver.cpp
Rebased by @laanwj:

- update for RPC methods added since 84d13ee: setmocktime,
  invalidateblock, reconsiderblock. Only the first, setmocktime, required a change,
  the other two are thread safe.
2015-01-28 07:41:54 +01:00
Wladimir J. van der Laan c986972ad7
Merge pull request #5476
73caf47 Display time offset in the debug window's Peers tab (Pavel Janík)
26a6bae Add time offset to getpeerinfo output (Pavel Janík)
2015-01-02 17:54:21 +01:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Pavel Janík 26a6bae753 Add time offset to getpeerinfo output 2014-12-15 11:06:15 +01:00
Michael Ford 72fb3d295a Update comments in src/rpc* to be doxygen compatible 2014-11-20 10:19:39 +08:00
Cory Fields 71697f97d3 Separate protocol versioning from clientversion 2014-10-29 00:24:40 -04:00
Pieter Wuille ad6e601712 RPC additions after headers-first 2014-10-14 15:42:01 -07:00
Pieter Wuille 341735eb8f Headers-first synchronization
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-14 15:42:01 -07:00
Philip Kaufmann b5ec5fe0cb update getnetworkinfo help with subversion
- add missing subversion field to getnetworkinfo help
- fix style and format errors in help string
- remove unneeded int casts
2014-10-01 10:23:00 +02:00
Jeff Garzik ff36cbe8d0 RPC getnetworkinfo: export local node's client sub-version string 2014-09-25 10:09:21 +02:00
imharrywu c15e483f23 typo fix of booleamn to boolean 2014-09-18 08:15:09 +08:00
Philip Kaufmann ee304b6e35 minor changes for help message of getpeerinfo 2014-09-16 09:00:36 +02:00
Philip Kaufmann 611116d4e3 header include cleanup
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-14 12:43:56 +02:00
Wladimir J. van der Laan aa8279513b
Add detailed network info to getnetworkinfo RPC
This commit adds per-network information to the
getnetworkinfo RPC call:

- Is the network limited?
- Is the network reachable
- Which proxy is used for this network, if any

Inspired by #2575.
2014-08-18 13:36:10 +02:00
Philip Kaufmann 7de3f1cfd6 fix help message for RPC getpeerinfo 2014-07-17 15:10:29 +02:00
Gregory Maxwell c4a321f5c6 Add peerid to getpeerinfo to allow correlation with the logs.
This seems to have been missed in 3764.
2014-07-15 07:13:10 -07:00
Pieter Wuille dc942e6f27 Introduce whitelisted peers.
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-09 20:40:14 +02:00
Philip Kaufmann 0127a9be14 remove SOCKS4 support from core and GUI
- now we support SOCKS5 only
2014-07-07 08:15:14 +02:00
Gavin Andresen 13fc83c77b
Move fee policy out of core 2014-07-03 14:42:16 -04:00
Pieter Wuille aa81564700 Track peers' available blocks 2014-06-29 21:50:55 +02:00
Wladimir J. van der Laan 14f888ca80 Move network-time related functions to timedata.cpp/h
The network time-offset-mangement functions from util.cpp are moved to
timedata.(cpp|h). This breaks the dependency of util on netbase.
2014-06-25 09:24:50 +02:00
Peter Todd 99ddc6cb70 Add nLocalServices info to RPC getinfo
Also show full 64 bits of services. Previously service bits >32 that
were advertised just didn't show up at all.
2014-06-21 11:43:19 -04:00
Gavin Andresen c6cb21d17a Type-safe CFeeRate class
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.
2014-06-06 10:34:18 -04:00
Wladimir J. van der Laan 1b7bcba1c1
Merge pull request #4166
b641c9c Fix addnode "onetry": Connect with OpenNetworkConnection (Cozz Lovan)
2014-05-23 11:39:18 +02:00
Kamil Domanski d56e30ca89 removed a few unnecessary casts 2014-05-13 11:42:00 +02:00
Kamil Domanski 4b61a6a478 switch from boost int types to <stdint.h> 2014-05-13 11:41:59 +02:00
Cozz Lovan b641c9cd21 Fix addnode "onetry": Connect with OpenNetworkConnection 2014-05-10 00:39:49 +02:00
Wladimir J. van der Laan d387b8ec15 rpc: add getblockchaininfo and getnetworkinfo
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-06 09:34:54 +02:00
Wladimir J. van der Laan ab88ed93ef Organize RPCCommands table
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.
2014-03-31 08:41:45 +02:00
Wladimir J. van der Laan 77eaa6fc45
Merge pull request #3682
3e0753b always show syncnode in getpeerinfo (fixes #2717) (Philip Kaufmann)
2014-03-27 11:20:49 +01:00
Wladimir J. van der Laan f48742c2bf Get rid of C99 PRI?64 usage in source files
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-24 09:08:56 +01:00
Wladimir J. van der Laan d5f1e727a8 Don't use PRIx64 formatting derives from inttypes.h
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)
2014-02-22 11:36:37 +01:00
Philip Kaufmann 3e0753b0f5 always show syncnode in getpeerinfo (fixes #2717) 2014-02-16 18:44:49 +01:00
Wladimir J. van der Laan b8d9058a4d
Merge pull request #3646
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)
2014-02-16 11:44:48 +01:00
gubatron 57702541a2 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.
2014-02-09 21:06:06 -05:00
Philip Kaufmann 6943cb9b4f small changes to rpc command help message strings 2014-01-30 14:13:30 +01:00
Wladimir J. van der Laan 4412c5a759 Fix getaddednodeinfo RPC call with dns=false
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.
2014-01-29 14:46:06 +01:00
Wladimir J. van der Laan 16bc9aaf8a Move getinfo from rpcnet to rpcmisc
`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.
2013-12-13 16:03:57 +01:00
Philip Kaufmann fdbdb7f345 cleanup includes in rpcnet.cpp 2013-12-09 14:02:38 +01:00
Pieter Wuille b2864d2fb3 Add main-specific node state 2013-12-08 14:51:37 +01:00
Wladimir J. van der Laan 05e27c6641
Merge pull request #3332
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)
2013-12-08 13:52:48 +01:00
Philip Kaufmann 38cbeab1ff fix typo in rpcnet.cpp 2013-12-05 08:46:50 +01:00
Wladimir J. van der Laan 48ba56cdfd Delimit code with #ifdef ENABLE_WALLET
Delimit all code that uses the wallet functions
in implementation files that conditionally use the wallet.
2013-12-04 12:46:13 +01:00
Wladimir J. van der Laan 991685d3dc Move getinfo to rpcnet.cpp
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.
2013-12-04 12:46:13 +01:00
Wladimir J. van der Laan 5f083afde1
Merge pull request #3284
fb78cc2 Split up bitcoinrpc (code movement only) (Wladimir J. van der Laan)
2013-11-27 14:16:36 +01:00
Wladimir J. van der Laan fb78cc2378 Split up bitcoinrpc (code movement only)
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.
2013-11-27 06:00:29 +01:00