Commit graph

6140 commits

Author SHA1 Message Date
Philip Kaufmann 65abe91ce4 [Qt] add sorting for bantable 2015-09-16 16:50:19 +02:00
Philip Kaufmann 51654deff2 [Qt] bantable polish
- add missing NULL pointer checks
- add better comments and reorder some code in rpcconsole.cpp
- remove unneeded leftovers in bantable.cpp
- update bantable column sizes to prevent cutting of banned until
2015-09-16 16:50:19 +02:00
Philip Kaufmann cdd72cd5fb [Qt] simplify ban list signal handling
- remove banListChanged signal from client model
- directly call clientModel->getBanTableModel()->refresh() without the way
  over clientModel->updateBanlist()

- also fix clearing peer detail window, when selecting (clicking)
  peers in the ban list
2015-09-16 16:50:19 +02:00
Jonas Schnelli 43c1f5b8d7 [Qt] remove unused timer-code from banlistmodel.cpp 2015-09-16 16:50:19 +02:00
Wladimir J. van der Laan e2b8028e4c net: Fix CIDR notation in ToString()
Only use CIDR notation if the netmask can be represented as such.
2015-09-16 16:50:19 +02:00
Philip Kaufmann 9e521c1735 [Qt] polish ban table 2015-09-16 16:50:19 +02:00
Jonas Schnelli 607809f037 net: use CIDR notation in CSubNet::ToString() 2015-09-16 16:50:19 +02:00
Jonas Schnelli 53caec66cc [Qt] bantable overhaul
- some code cleanups
- fix date formatting
- reduce header includes
2015-09-16 16:50:19 +02:00
Jonas Schnelli f0bcbc4c8a [Qt] bantable fix timestamp 64bit issue 2015-09-16 16:50:19 +02:00
Jonas Schnelli 6135309816 [Qt] banlist, UI optimizing and better signal handling 2015-09-16 16:50:19 +02:00
Jonas Schnelli 770ca79aa0 [Qt] add context menu with unban option to ban table 2015-09-16 16:50:19 +02:00
Jonas Schnelli 5f42132950 [Qt] add ui signal for banlist changes 2015-09-16 16:50:19 +02:00
Jonas Schnelli ad204df1a9 [Qt] add banlist table below peers table 2015-09-16 16:50:19 +02:00
Jonas Schnelli 50f090884c [Qt] add ban functions to peers window
add ban option for peer context menu (1h, 24h, 7d, 1y).
2015-09-16 16:50:19 +02:00
Jeff Garzik ca5e2a1864
Merge pull request #6317 2015-09-16 09:40:53 -04:00
Jeff Garzik e6a14b64d6 Add ZeroMQ support. Notify blocks and transactions via ZeroMQ
Continues Johnathan Corgan's work.
Publishing multipart messages

Bugfix: Add missing zmq header includes

Bugfix: Adjust build system to link ZeroMQ code for Qt binaries
2015-09-16 11:01:35 +01:00
João Barbosa 5624e055b3 Add UpdatedBlockTip signal to CMainSignals and CValidationInterface 2015-09-16 10:59:32 +01:00
Jeff Garzik 6f55cddf6b
Merge pull request #5665 2015-09-15 12:30:32 -04:00
Wladimir J. van der Laan 0c27795140
Merge pull request #6579
afb0cca Add NODE_BLOOM service bit and bump protocol version (Matt Corallo)
2015-09-08 17:10:36 +02:00
Wladimir J. van der Laan 878ea69491
Merge pull request #6594
5ffaaba Disallow duplicate windows. (Casey Rodarmor)
2015-09-08 17:02:00 +02:00
Wladimir J. van der Laan 1d133d9573
Merge pull request #6640
eb3002b [TRIVIAL] Fix typo: exactmath -> exactmatch (paveljanik)
2015-09-08 16:43:26 +02:00
Wladimir J. van der Laan 6f6fb188b5
Merge pull request #6644
7a7e68d Prune the -prune help to reflect that the wallet is no longer disabled. (Gregory Maxwell)
2015-09-08 16:24:08 +02:00
Gregory Maxwell 7a7e68d1e2 Prune the -prune help to reflect that the wallet is no longer disabled.
The wallet hasn't been disabled since 3201035f22.
2015-09-07 18:49:12 +00:00
Daniel Kraft 9cdc3353c5 Simplify logic of REST request suffix parsing.
This patch changes the way the suffix (giving the requested data format) is
parsed for REST requests.  Before, the string was split at '.'
characters and it was assumed that the second part was the suffix.

Now, we look for the last dot and use that to determine the suffix.
This allows for strings that contain dots (not used now, though), and
seems, in general, to be clearer and more intuitive.
2015-09-07 20:38:03 +02:00
Matt Corallo afb0ccaf9c Add NODE_BLOOM service bit and bump protocol version
Lets nodes advertise that they offer bloom filter support explicitly.
The protocol version bump allows SPV nodes to assume that NODE_BLOOM is
set if NODE_NETWORK is set for pre-70011 nodes.

Also adds an option to turn bloom filter support off for nodes which
advertise a version number >= 70011. Nodes attempting to use bloom
filters on such protocol versions are banned, and a later upgade
should drop nodes of an older version which attempt to use bloom
filters.

Much code stolen from Peter Todd.

Implements BIP 111
2015-09-05 23:29:13 -07:00
Casey Rodarmor 5ffaaba3a1 Disallow duplicate windows. 2015-09-04 15:25:42 -04:00
paveljanik eb3002bb71 [TRIVIAL] Fix typo: exactmath -> exactmatch
... but not yet in trivial tree
2015-09-04 19:22:48 +02:00
Wladimir J. van der Laan 93ff1b9041 net: correctly initialize nMinPingUsecTime
`nMinPingUsecTime` was left uninitialized in CNode.
The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that.
Thanks @MarcoFalke for noticing.
2015-09-04 16:27:38 +02:00
Wladimir J. van der Laan bbc2b39860
Merge pull request #6633
a6eb4ba Report minimum ping time in getpeerinfo (Matt Corallo)
2015-09-04 15:32:03 +02:00
Wladimir J. van der Laan 9aa90994ee
Merge pull request #5677
d528025 Revert "rpc-tests: re-enable rpc-tests for Windows" (Wladimir J. van der Laan)
1e700c9 doc: update deps in build-unix.md after libevent (Wladimir J. van der Laan)
26c9b83 Move windows socket init to utility function (Wladimir J. van der Laan)
4be0b08 libevent: Windows reuseaddr workaround in depends (Cory Fields)
3a174cd Fix race condition between starting HTTP server thread and setting EventBase() (Wladimir J. van der Laan)
6d2bc22 Document options for new HTTP/RPC server in --help (Wladimir J. van der Laan)
be33f3f Implement RPCTimerHandler for Qt RPC console (Wladimir J. van der Laan)
57d85d9 doc: mention SSL support dropped for RPC in release notes (Wladimir J. van der Laan)
40b556d evhttpd implementation (Wladimir J. van der Laan)
ee2a42b tests: GET requests cannot have request body, use POST in rest.py (Wladimir J. van der Laan)
6e996d3 tests: fix qt payment test (Cory Fields)
3140ef9 build: build-system changes for libevent (Wladimir J. van der Laan)
a9af234 libevent: add depends (Cory Fields)
6a21dd5 Remove rpc_boostasiotocnetaddr test (Wladimir J. van der Laan)
8f9301c qa: Remove -rpckeepalive tests from httpbasics (Wladimir J. van der Laan)
51fcfc0 doc: remove documentation for rpcssl (Wladimir J. van der Laan)
2015-09-04 13:06:32 +02:00
Wladimir J. van der Laan 4b437b227c
Merge pull request #6631
e83df07 Update RPC generate help for numblocks to include required (Ian T)
2015-09-04 10:45:27 +02:00
Matt Corallo a6eb4ba38b Report minimum ping time in getpeerinfo 2015-09-03 13:06:13 -07:00
Wladimir J. van der Laan 195942d58e
Merge pull request #6630
86270c8 Replace boost::reverse_lock with our own. (Casey Rodarmor)
2015-09-03 21:46:08 +02:00
Casey Rodarmor 86270c8164 Replace boost::reverse_lock with our own. 2015-09-03 15:13:40 -04:00
Ian T e83df075f9 Update RPC generate help for numblocks to include required
The `generate` RPC has no default `numblocks` and a numeric value is required.
2015-09-03 13:29:10 -04:00
Wladimir J. van der Laan 69dc5b51a0
Merge pull request #6374
027de94 Use network group instead of CNetAddr in final pass to select node to disconnect (Patrick Strateman)
000c18a Fix comment (Patrick Strateman)
fed3094 Acquire cs_vNodes before changing refrence counts (Patrick Strateman)
69ee1aa CNodeRef copy constructor and assignment operator (Patrick Strateman)
dc81dd0 Return false early if vEvictionCandidates is empty (Patrick Strateman)
17f3533 Better support for nodes with non-standard nMaxConnections (Patrick Strateman)
1317cd1 RAII wrapper for CNode* (Patrick Strateman)
df23937 Add comments to AttemptToEvictConnection (Patrick Strateman)
a8f6e45 Remove redundant whiteconnections option (Patrick Strateman)
b105ba3 Prefer to disconnect peers in favor of whitelisted peers (Patrick Strateman)
2c70153 AttemptToEvictConnection (Patrick Strateman)
4bac601 Record nMinPingUsecTime (Patrick Strateman)
ae037b7 Refactor: Move failure conditions to the top of AcceptConnection (Patrick Strateman)
1ef4817 Refactor: Bail early in AcceptConnection (Patrick Strateman)
541a1dd Refactor: AcceptConnection (Patrick Strateman)
2015-09-03 18:27:24 +02:00
Wladimir J. van der Laan 26c9b83677 Move windows socket init to utility function 2015-09-03 10:59:19 +02:00
Wladimir J. van der Laan 3a174cd400 Fix race condition between starting HTTP server thread and setting EventBase()
Split StartHTTPServer into InitHTTPServer and StartHTTPServer to give
clients a window to register their handlers without race conditions.

Thanks @ajweiss for figuring this out.
2015-09-03 10:59:19 +02:00
Wladimir J. van der Laan 6d2bc22146 Document options for new HTTP/RPC server in --help 2015-09-03 10:59:19 +02:00
Wladimir J. van der Laan be33f3f50b Implement RPCTimerHandler for Qt RPC console
Implement RPCTimerHandler for Qt RPC console, so that `walletpassphrase`
works with GUI and `-server=0`.

Also simplify HTTPEvent-related code by using boost::function directly.
2015-09-03 10:59:19 +02:00
Wladimir J. van der Laan 40b556d374 evhttpd implementation
- *Replace usage of boost::asio with [libevent2](http://libevent.org/)*.
boost::asio is not part of C++11, so unlike other boost there is no
forwards-compatibility reason to stick with it. Together with #4738 (convert
json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with
regard to compile-time slowness.

- *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling
is handled by libevent, a work queue (with configurable depth and parallelism)
is used to handle application requests.

- *Wrap HTTP request in C++ class*; this makes the application code mostly
HTTP-server-neutral

- *Refactor RPC to move all http-specific code to a separate file*.
Theoreticaly this can allow building without HTTP server but with another RPC
backend, e.g. Qt's debug console (currently not implemented) or future RPC
mechanisms people may want to use.

- *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL
paths they want to handle.

By using a proven, high-performance asynchronous networking library (also used
by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided.

What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests
pass. The aim for now is everything but SSL support.

Configuration options:

- `-rpcthreads`: repurposed as "number of  work handler threads". Still
defaults to 4.

- `-rpcworkqueue`: maximum depth of work queue. When this is reached, new
requests will return a 500 Internal Error.

- `-rpctimeout`: inactivity time, in seconds, after which to disconnect a
client.

- `-debug=http`: low-level http activity logging
2015-09-03 10:59:18 +02:00
Cory Fields 6e996d39da tests: fix qt payment test
Now that boost no longer automatically initializes openssl, we have to
do it ourselves.
2015-09-02 18:38:41 +02:00
Wladimir J. van der Laan 3140ef9249 build: build-system changes for libevent 2015-09-02 18:38:41 +02:00
Wladimir J. van der Laan 6a21dd598c Remove rpc_boostasiotocnetaddr test
Dropping all use of boost::asio.
2015-09-02 18:38:41 +02:00
Wladimir J. van der Laan af9305a7e8
Merge pull request #6583
9f3e48e add support for miniupnpc api version 14 (Pavel Vasin)
2015-08-31 17:38:07 +02:00
Patrick Strateman 027de94e1f
Use network group instead of CNetAddr in final pass to select node to disconnect 2015-08-30 22:09:14 -07:00
J Ross Nicoll 9bebf60698
Make sure LogPrint strings are line-terminated 2015-08-29 17:40:13 +01:00
Wladimir J. van der Laan ea19c2bc3f
Merge pull request #6530
c33c11e Improve addrman Select() performance when buckets are nearly empty (Pieter Wuille)
2015-08-26 17:58:40 +02:00
Pieter Wuille c33c11ebac Improve addrman Select() performance when buckets are nearly empty 2015-08-26 01:59:09 +02:00
Patrick Strateman 000c18aace Fix comment 2015-08-25 16:31:13 -07:00