Commit graph

6335 commits

Author SHA1 Message Date
Jeff Garzik 6f55cddf6b
Merge pull request #5665 2015-09-15 12:30:32 -04:00
MarcoFalke d1acf938e6 [qt] [trivial] share/qt/make_spinner.py => src/qt/res/movies/makespinner.sh
* Merge make_spinner.py into makespinner.sh
* Also delete now unused imgs
* Actually use all 36 frames for the spinner animation
2015-09-13 17:57:12 +02:00
MarcoFalke 51ff777357 [trivial] Fix rpc message "help generate" 2015-09-12 18:19:53 +02:00
MarcoFalke 4c3cab14b7 [trivial] init cleanup 2015-09-12 13:28:00 +02:00
Gregory Maxwell 6ecaec395c [Trivial] [logging] Rm extraneous cleansubver in serveral debug messages.
We log the cleanSubVer as part of connect.  It is not uniquely more informative
 than any of the other data we have about a peer, often less.  It's also often
 long now as well.  There is no need to output it as part of mempoolrej,
 AcceptToMemoryPool, or pong entries.  Leaving it out makes our log entries
 more uniform and consistent.
2015-09-08 23:11:10 +00: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
Gregory Maxwell 77c6072473 Enable wallet key imports without rescan in pruned mode.
Complete rescan is incompatible with pruning, but rescan is optional on
 our wallet key import RPCs.  Import on use is very useful in some common
 situations in conjunction with pruning, e.g. merchant payment tracking.

This reenables importprivkey/importaddress/importpubkey when rescan
 is not used.

In the future we should consider changing the rescan argument to allow depth
 or date to allow limited rescanning when compatible with the retained
 block depth.
2015-09-07 01:28:32 +00: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
Tom Harding 9524c4d35c In (strCommand == "tx"), return if AlreadyHave()
The main effect is to exit processing for recently-rejected hashes,
in case they are pushed to us without prior advertisement.  This
behavior was seen in the wild.

An additional effect is to do early checks for mempool or mapOrphan
existence.  No logging or nDoS tracking is needed for failures of
these checks.
2015-09-03 10:16:59 -07: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
Patrick Strateman fed30940ef Acquire cs_vNodes before changing refrence counts 2015-08-25 16:30:02 -07:00
Patrick Strateman 69ee1aab00 CNodeRef copy constructor and assignment operator 2015-08-25 15:33:29 -07:00
Cory Fields a19338723d net: Set SO_REUSEADDR for Windows too
When running the rpc tests in Wine, nodes often fail to listen on localhost
due to a stale socket from a previous run. This aligns the behavior with other
platforms.
2015-08-25 11:31:06 -04:00
Wladimir J. van der Laan da9beb288d
Merge pull request #6576
e938122 Stop parsing JSON after first finished construct. (Daniel Kraft)
2015-08-24 13:44:05 +02:00
Pavel Vasin 9f3e48e521 add support for miniupnpc api version 14
The value of new arg ttl is set to 2 as it's recommended default.
2015-08-23 23:53:49 +03:00
Patrick Strateman dc81dd02a1 Return false early if vEvictionCandidates is empty 2015-08-22 15:38:24 -07:00
Patrick Strateman 17f3533c84 Better support for nodes with non-standard nMaxConnections 2015-08-22 15:38:24 -07:00
Patrick Strateman 1317cd1928 RAII wrapper for CNode* 2015-08-22 15:38:24 -07:00
Patrick Strateman df23937422 Add comments to AttemptToEvictConnection 2015-08-22 15:38:24 -07:00
Patrick Strateman a8f6e45249 Remove redundant whiteconnections option 2015-08-22 15:38:24 -07:00
Patrick Strateman b105ba398b Prefer to disconnect peers in favor of whitelisted peers 2015-08-22 15:38:24 -07:00
Patrick Strateman 2c701537c8 AttemptToEvictConnection 2015-08-22 15:38:24 -07:00
Patrick Strateman 4bac601610 Record nMinPingUsecTime 2015-08-22 15:38:23 -07:00
Patrick Strateman ae037b707c Refactor: Move failure conditions to the top of AcceptConnection 2015-08-22 15:38:23 -07:00
Patrick Strateman 1ef4817614 Refactor: Bail early in AcceptConnection 2015-08-22 15:38:23 -07:00
Patrick Strateman 541a1dd9e6 Refactor: AcceptConnection 2015-08-22 15:38:23 -07:00
Wladimir J. van der Laan 49793fbb09
Merge pull request #6541
e0862c0 Reformat validateaddress help, add missing iswatchonly description. (Pavel Janík)
2015-08-21 12:35:20 +02:00
Wladimir J. van der Laan e3f13ddc54
Merge pull request #6242
17221bf chainparams: don't use std namespace (Cory Fields)
f0deec5 chainparams: move CCheckpointData into chainparams.h (Cory Fields)
2015-08-20 18:26:26 +02:00
Wladimir J. van der Laan e128464bc5
Merge pull request #6545
8be371d Do not store more than 200 timedata samples. (Pavel Janík)
2015-08-20 17:13:52 +02:00
Wladimir J. van der Laan 70ec975ea6
Merge pull request #6556
1123cdb add unit test for CNetAddr::GetGroup. (Alex Morcos)
bba3db1 Fix masking of irrelevant bits in address groups. (Alex Morcos)
2015-08-20 16:45:46 +02:00
Wladimir J. van der Laan 5e6e0898a1
Merge pull request #6571
1d1073c consensus: cache the openssl EC_GROUP to avoid a race condition for each CECKey instantiation (Cory Fields)
2015-08-20 16:33:50 +02:00
Daniel Kraft e938122b7b Stop parsing JSON after first finished construct.
Fix https://github.com/bitcoin/bitcoin/issues/6558.  In particular, stop
parsing JSON after the first object or array is finished.  Check that no
other garbage follows, and fail the parser if it does.
2015-08-20 12:48:43 +02:00
Alex Morcos 1123cdbf4d add unit test for CNetAddr::GetGroup. 2015-08-19 17:06:42 -04:00
Cory Fields 1d1073c2d3 consensus: cache the openssl EC_GROUP to avoid a race condition for each CECKey instantiation 2015-08-19 14:25:01 -04:00
Wladimir J. van der Laan ef30389e2a
Merge pull request #6544
c5c1edf Fix spelling mistake in -> if. (Mark Friedenbach)
e846b2a Correct a possibly intentional pun that is nevertheless hard to read: "two times of nLockTime." What is meant is that there are two kinds, or categories of nLockTime. (Mark Friedenbach)
2015-08-19 17:37:52 +02:00
Wladimir J. van der Laan 80cddbbba9
Merge pull request #6539
9f68ed6 typofixes (found by misspell_fixer) (Veres Lajos)
2015-08-19 17:28:00 +02:00
Wladimir J. van der Laan a6f2affde8
Merge pull request #6565
fb08d92 Make sure we re-acquire lock if a task throws (Casey Rodarmor)
2015-08-19 16:27:40 +02:00
Wladimir J. van der Laan e08a7d9d40
Merge pull request #6561
7bd57bb Add limitedmap test (Casey Rodarmor)
8b06894 Disallow unlimited limited maps (Casey Rodarmor)
fd2d862 Make limited map actually respect max size (Casey Rodarmor)
2015-08-19 15:45:14 +02:00
Casey Rodarmor fb08d92312 Make sure we re-acquire lock if a task throws 2015-08-18 10:40:13 -04:00
Daniel Kraft 2016576998 Fix crash when mining with empty keypool.
Since the introduction of the ScriptForMining callback, the mining
functions (setgenerate and generate) crash with an assertion failure
(due to a NULL pointer script returned) if the keypool is empty.  Fix
this by giving a proper error.
2015-08-18 09:07:33 +02:00
Casey Rodarmor 7bd57bb1d7 Add limitedmap test 2015-08-17 12:15:32 -04:00
Casey Rodarmor 8b06894194 Disallow unlimited limited maps 2015-08-17 12:15:32 -04:00
Casey Rodarmor fd2d862fbc Make limited map actually respect max size 2015-08-17 12:15:32 -04:00
Wladimir J. van der Laan 39ddaeb8fe
Merge pull request #6551
243b80d Handle leveldb::DestroyDB() errors on wipe failure (Adam Weiss)
2015-08-17 16:52:57 +02:00
Jeff Garzik 6feeec1ec5
Merge pull request #6013 2015-08-15 16:09:06 -04:00
Alex Morcos bba3db1a40 Fix masking of irrelevant bits in address groups. 2015-08-14 14:25:19 -05:00
Wladimir J. van der Laan ddd8d80c63
Merge pull request #6415
d042854 SQUASH "Implement watchonly support in fundrawtransaction" (Matt Corallo)
428a898 SQUASH "Add have-pubkey distinction to ISMINE flags" (Matt Corallo)
6bdb474 Implement watchonly support in fundrawtransaction (Matt Corallo)
f5813bd Add logic to track pubkeys as watch-only, not just scripts (Matt Corallo)
d3354c5 Add have-pubkey distinction to ISMINE flags (Matt Corallo)
5c17059 Update importaddress help to push its use to script-only (Matt Corallo)
a1d7df3 Add importpubkey method to import a watch-only pubkey (Matt Corallo)
907a425 Add p2sh option to importaddress to import redeemScripts (Matt Corallo)
983d2d9 Split up importaddress into helper functions (Matt Corallo)
cfc3dd3 Also remove pay-2-pubkey from watch when adding a priv key (Matt Corallo)
2015-08-14 16:28:37 +02:00
Pavel Janík 70180b2e57 Implement REST mempool API, add test and documentation. 2015-08-14 07:01:03 +02:00
Adam Weiss 243b80d292 Handle leveldb::DestroyDB() errors on wipe failure
Add error checking to CLevelDBWrapper for errors from
leveldb::DestroyDB().  Without it, if unlink() or DeleteFileW() fail to
delete files, they will fail silent.  If they fail to delete any files,
CLevelDBWrapper will silently open and read the existing database.

Typically any permissions issues would be caught by leveldb as it churns
through many files as part of its compaction process, but it is
conceivable that this could cause problems on Windows with anti-virus
and indexing software.
2015-08-12 19:40:09 -04:00
Wladimir J. van der Laan 87f37e259d
Merge pull request #6519
7f1f8f5 Move mempool rejections to new debug category (Wladimir J. van der Laan)
66daed5 Add information to errors in ConnectBlock, CheckBlock (Wladimir J. van der Laan)
6cab808 Remove most logging from transaction validation (Wladimir J. van der Laan)
9003c7c Add function to convert CValidationState to a human-readable message (Wladimir J. van der Laan)
dc58258 Introduce REJECT_INTERNAL codes for local AcceptToMempool errors (Wladimir J. van der Laan)
fbf44e6 Add debug message to CValidationState for optional extra information (Wladimir J. van der Laan)
2015-08-11 17:36:50 +02:00
Wladimir J. van der Laan 7f1f8f5edf Move mempool rejections to new debug category
Move mempool rejections to debug category `mempoolrej`, to make it possible
to show them without enabling the entire category `mempool` which is
high volume.
2015-08-11 17:29:34 +02:00
Wladimir J. van der Laan 66daed5e1b Add information to errors in ConnectBlock, CheckBlock
Add detailed state information to the errors, as it is no longer being
logged downstream.

Also add the state information to mempool rejection debug message in
ProcessMessages.
2015-08-11 17:29:34 +02:00
Wladimir J. van der Laan 6cab808272 Remove most logging from transaction validation
Remove unnecessary direct logging in CheckTransaction,
AcceptToMemoryPool, CheckTxInputs, CScriptCheck::operator()

All status information should be returned in the CValidationState.
Relevant debug information is also added to the CValidationState using
the recently introduced debug message.

Do keep the "BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags"
error as it is meant to appear as bug in the log.
2015-08-11 17:29:34 +02:00
Wladimir J. van der Laan 9003c7cdd8 Add function to convert CValidationState to a human-readable message
It is necessary to be able to concisely log a validation state.
Convert CValidationState to a human-readable message for logging.
2015-08-11 17:29:33 +02:00
Wladimir J. van der Laan dc58258adf Introduce REJECT_INTERNAL codes for local AcceptToMempool errors
Add status codes specific to AcceptToMempool procession of transactions.
These can never happen due to block validation, and must never be sent
over the P2P network. Add assertions where appropriate.
2015-08-11 17:29:33 +02:00
Pavel Janík 8be371db34 Do not store more than 200 timedata samples. 2015-08-11 15:57:52 +02:00
Mark Friedenbach c5c1edfe60 Fix spelling mistake in -> if. 2015-08-10 18:09:59 -07:00
Mark Friedenbach e846b2a1e9 Correct a possibly intentional pun that is nevertheless hard to read: "two times of nLockTime." What is meant is that there are two kinds, or categories of nLockTime. 2015-08-10 18:08:30 -07:00
Veres Lajos 9f68ed6b6d typofixes (found by misspell_fixer) 2015-08-10 22:06:27 +01:00
Pavel Janík e0862c0933 Reformat validateaddress help, add missing iswatchonly description. 2015-08-10 20:10:56 +02:00
Tom Harding 212bcca920 Add optional locktime to createrawtransaction
A non-zero locktime also causes input sequences to be set to
non-max, activating the locktime.
2015-08-10 10:23:59 -07:00
Wladimir J. van der Laan 6bb28058d3
Merge pull request #6346
627468d Add support for data-based outputs (OP_RETURN) to bitcoin-tx. (Pavel Janík)
d707853 Add OP_RETURN support in createrawtransaction RPC call, add tests. (Pavel Janík)
2015-08-10 17:53:07 +02:00
Wladimir J. van der Laan 6c1c7fdfd6
Merge pull request #6534
9493803 Revert "Revert "Assert on probable deadlocks if the second lock isnt try_lock"" (Cory Fields)
605433f locks: don't lock cs_wallet before making rpc calls (Cory Fields)
2015-08-10 17:38:25 +02:00
Philip Kaufmann be942def4b [Qt] add verifySize() function to PaymentServer
- add static verifySize() function to PaymentServer and move the logging
  on error into the function
- also use the new function in the unit test
- the function checks if the size is allowed as per BIP70
2015-08-10 14:12:15 +02:00
Philip Kaufmann 92684bb872 [Qt] minor optimisations in peertablemodel
- remove an unneeded include of net.h in peertablemodel.cpp
- add const after size() in PeerTablePriv
- remove 2x unneeded else in functions
- replace a (int) typecast by (QVariant) to use Qt style
- remove unneeded include of peertablemodel.h from rpcconsole.cpp
2015-08-10 14:11:25 +02:00
Matt Corallo d04285430d SQUASH "Implement watchonly support in fundrawtransaction" 2015-08-08 09:30:53 -07:00
Matt Corallo 428a898acd SQUASH "Add have-pubkey distinction to ISMINE flags" 2015-08-08 09:30:53 -07:00
Daniel Kraft 69c3bde448 Add some const declarations where they are appropriate.
Declare some arguments of functions as "const" pointers where they are
not meant to be modified.
2015-08-08 18:18:41 +02:00
Cory Fields 9493803f4a Revert "Revert "Assert on probable deadlocks if the second lock isnt try_lock""
This reverts commit a4fe57da62.

The issue here should be fixed by the previous commit.
2015-08-07 16:18:16 -04:00
Cory Fields 605433ffb5 locks: don't lock cs_wallet before making rpc calls 2015-08-07 16:17:57 -04:00
Philip Kaufmann 54bd28fa75 [Qt] show client user agent in debug window 2015-08-07 14:01:49 +02:00
Wladimir J. van der Laan 0c465f5e60
Merge pull request #4587
ed166df [Qt] allow users to set -onion via GUI (Philip Kaufmann)
2015-08-07 13:43:13 +02:00
Wladimir J. van der Laan 100c9d3994
Merge pull request #6505
df9c2ee [Qt] replace wifi icon with network symbol (Marco)
9142867 [QT] cleanup icons (Marco)
2015-08-07 12:57:17 +02:00
Wladimir J. van der Laan e545371b77
Merge pull request #6377
c433828 Handle no chain tip available in InvalidChainFound() (Ross Nicoll)
2015-08-07 09:14:53 +02:00
Wladimir J. van der Laan 41d650ff92
Merge pull request #6527
231c560 Use unique name for AlertNotify tempfile (Casey Rodarmor)
2015-08-07 08:22:11 +02:00
Pavel Janík 627468d2ea Add support for data-based outputs (OP_RETURN) to bitcoin-tx. 2015-08-06 20:27:52 +02:00
Pavel Janík d7078533eb Add OP_RETURN support in createrawtransaction RPC call, add tests. 2015-08-06 20:27:52 +02:00
Wladimir J. van der Laan a4fe57da62
Revert "Assert on probable deadlocks if the second lock isnt try_lock"
Disabling this for now - too many intermittent Travis issues.

This reverts commit 0fcc4e1e04
(pull #5515).
2015-08-06 14:15:54 +02:00
Wladimir J. van der Laan 2f746c6e8a
Merge pull request #6177
ef8dfe4 Prevent block.nTime from decreasing (Mark Friedenbach)
2015-08-06 12:01:21 +02:00
Wladimir J. van der Laan fbf44e6f3e Add debug message to CValidationState for optional extra information
Add a field `strDebugMessage` which can be passed to DoS or Invalid,
and queried using GetDebugMessage() to add extra troubleshooting
information to the validation state.
2015-08-06 09:47:01 +02:00
Casey Rodarmor 231c5601a1 Use unique name for AlertNotify tempfile 2015-08-05 23:12:26 -04:00
Wladimir J. van der Laan a0625b8085
Merge pull request #5913
5922b67 Add assertion and cast before sending reject code (Wladimir J. van der Laan)
a651403 Add absurdly high fee message to validation state (for RPC propagation) (Shaul Kfir)
2015-08-05 19:12:48 +02:00
Wladimir J. van der Laan 5922b6774e Add assertion and cast before sending reject code
This gets rid of a warning. Add an assertion to make sure that the
reject code is in the correct range for the network protocol
(if it is outside the range it must be a bug)
2015-08-05 19:02:19 +02:00
Wladimir J. van der Laan c384800027
Merge pull request #6462
7b79cbd limit total length of user agent comments (Pavol Rusnak)
557f8ea implement uacomment config parameter which can add comments to user agent as per BIP-0014 (Pavol Rusnak)
2015-08-05 15:43:10 +02:00
Wladimir J. van der Laan c9c017adf6
Merge pull request #6489
f261f19 Give a better error message if system clock is bad (Casey Rodarmor)
2015-08-05 10:23:01 +02:00
Pavol Rusnak 7b79cbd722 limit total length of user agent comments
Reworked-By: Wladimir J. van der Laan <laanwj@gmail.com>
2015-08-05 09:38:20 +02:00
Pieter Wuille 586a29253d
Merge pull request #6503
19dd40a Consolidate individual references to the current maximum peer connection value of 125 into a single constant declaration. (Matt Quinn)
2015-08-04 19:43:30 +02:00
Marco df9c2ee1c9 [Qt] replace wifi icon with network symbol 2015-08-04 16:53:30 +02:00
Marco 9142867572 [QT] cleanup icons
* Cleanup SVG code
* Unify design ("Typicons" seem to have round edges)
* Fix transparency issue with clock5.png
2015-08-04 12:06:12 +02:00
Wladimir J. van der Laan b6fee6b7c7
Merge pull request #6504
9ca7857 Rationalize currency unit to "BTC" (Ross Nicoll)
2015-08-04 01:24:19 +02:00
Ross Nicoll 9ca7857df7 Rationalize currency unit to "BTC"
Previously various user-facing strings have used inconsistent currency units "BTC",
"btc" and "bitcoins". This adds a single constant and uses it for each reference to
the currency unit.

Also adds a description of the unit for --maxtxfee, and adds the missing "amount"
field description to the (deprecated) move RPC command.
2015-08-03 22:58:30 +01:00
Matt Quinn 19dd40a25f Consolidate individual references to the current maximum peer connection
value of 125 into a single constant declaration.
2015-08-03 14:37:00 -07:00
Casey Rodarmor 2d8c49d126 Clean up tx prioritization when conflict mined 2015-08-03 15:49:01 -04:00
Casey Rodarmor f261f19b4b Give a better error message if system clock is bad
Fixes #2007

This checks to see if the system clock appears to be bad and gives a
helpful error message. If the user's clock is set incorrectly, hopefully
they'll abort, fix it, and then save themselves a fruitless resync.
2015-08-03 15:11:52 -04:00
Wladimir J. van der Laan 219b916545
Merge pull request #6498
a8d0407 Move recentRejects initialization to top of InitBlockIndex (Wladimir J. van der Laan)
0847d9c Keep track of recently rejected transactions (Peter Todd)
d741371 Only use randomly created nonces in CRollingBloomFilter. (Pieter Wuille)
d2d7ee0 Make CRollingBloomFilter set nTweak for you (Peter Todd)
a3d65fe Reuse vector hashing code for uint256 (Pieter Wuille)
bbe4108 Add uint256 support to CRollingBloomFilter (Peter Todd)
2015-08-03 20:13:43 +02:00
Wladimir J. van der Laan 10ac38ed9f
Merge pull request #6284
c6455c7 doc: mention change to option parsing behavior in release notes (Wladimir J. van der Laan)
c38c49d Fix argument parsing oddity with -noX (Wladimir J. van der Laan)
2015-08-03 19:54:52 +02:00
Wladimir J. van der Laan 9e6c33b202
Merge pull request #6356
f0cba6f Delay initial pruning until after wallet init (Adam Weiss)
2015-08-03 19:34:50 +02:00
Wladimir J. van der Laan f18b8ec7cf Make sure LogPrintf strings are line-terminated
Fix the cases where LogPrint[f] was accidentally called without line
terminator, which resulted in concatenated log lines.

(see e.g. #6492)
2015-08-03 17:40:55 +02:00
Wladimir J. van der Laan a8d0407c4f Move recentRejects initialization to top of InitBlockIndex
This avoids that premature return in the condition that a new chain is initialized
results in NULL pointer errors due to recentReject not being constructed.

Also add assertions where it is used.
2015-07-31 17:58:12 +02:00
Pavol Rusnak 557f8eac7a implement uacomment config parameter
which can add comments to user agent as per BIP-0014
2015-07-31 16:19:23 +02:00
Wladimir J. van der Laan 86cfd23f68
Merge pull request #6473
5fb5c9b Clean up chainparams some more. (Daniel Kraft)
2015-07-31 10:10:55 +02:00
Wladimir J. van der Laan 9848d4297b
Merge pull request #6487
eec7757 qt: Introduce PlatformStyle (Wladimir J. van der Laan)
2015-07-31 10:06:49 +02:00
Wladimir J. van der Laan eec7757445 qt: Introduce PlatformStyle
Introduce a PlatformStyle to handle platform-specific customization of
the UI.

This replaces 'scicon', as well as #ifdefs to determine whether to place
icons on buttons.

The selected PlatformStyle defaults to the platform that the application
was compiled on, but can be overridden from the command line with
`-uiplatform=<x>`.

Also fixes the warning from #6328.
2015-07-31 09:35:18 +02:00
mruddy af3208bfa6 Resolve issue 3166.
These changes decode valid SIGHASH types on signatures in assembly (asm) representations of scriptSig scripts.
This squashed commit incorporates substantial helpful feedback from jtimon, laanwj, and sipa.
2015-07-30 19:56:00 -04:00
Daniel Kraft 5fb5c9b213 Clean up chainparams some more.
Clean up the code in chainparams a bit more after the recent
refactorings.  In particular, make sure the structure of the "RegTest"
params matches the structure of the other classes.  This makes the code
clearer to read.

Also remove redundant values of the genesis block in always-specified
optional arguments and mark variable/argument as "const".
2015-07-29 21:13:36 +02:00
Wladimir J. van der Laan 675d2feffa
Merge pull request #6224
59b49cd Eliminate signed/unsigned comparison warning (Suhas Daftuar)
04b5d23 Replace sleep with syncing using pings (Suhas Daftuar)
6b1066f Ignore whitelisting during IBD for unrequested blocks. (Suhas Daftuar)
bfc30b3 Ignore unrequested blocks too far ahead of tip (Suhas Daftuar)
2015-07-29 20:04:15 +02:00
Adam Weiss f0cba6f8eb Delay initial pruning until after wallet init
Don't prune until any wallet rescanning has taken place to avoid
potentially pruning blocks that the wallet rescan may need.
2015-07-29 14:00:25 -04:00
Wladimir J. van der Laan 7cbed7fa28
Merge pull request #6488
17ac0f4 Avoid leaking file descriptors in RegisterLoad (Casey Rodarmor)
2015-07-29 18:59:23 +02:00
Peter Todd 0847d9cb5f
Keep track of recently rejected transactions
Nodes can have divergent policies on which transactions they will accept
and relay.  This can cause you to repeatedly request and reject the same
tx after its inved to you from various peers which have accepted it.
Here we add rolling bloom filter to keep track of such rejections,
clearing the filter every time the chain tip changes.

Credit goes to Alex Morcos, who created the patch that this code is
based on.

Original code by Peter Todd. Refactored to not construct the
filter at startup time by Pieter Wuille.
2015-07-28 15:50:13 -04:00
Cory Fields 17221bf77e chainparams: don't use std namespace 2015-07-28 15:33:33 -04:00
Cory Fields f0deec572b chainparams: move CCheckpointData into chainparams.h
This unties CChainParams from its dependency on checkpoints. Instead, now it
only depends on the raw checkpoint data.
2015-07-28 15:26:50 -04:00
Pieter Wuille eddaba7b56
Revert "Cache transaction validation successes"
This reverts commit 17b11428c1.
2015-07-28 20:15:00 +02:00
Casey Rodarmor 17ac0f4025 Avoid leaking file descriptors in RegisterLoad
This is pretty trivial, but if there's an error here we'll leak a file
descriptor. Changed it to always close the file.
2015-07-28 14:01:00 -04:00
Pavel Vasin 5e56ef5152 qt: use CHashWriter also in SignVerifyMessageDialog
This eliminates unnecessary copying of data being hashed.
2015-07-28 10:59:16 +03:00
Pieter Wuille d741371d7d Only use randomly created nonces in CRollingBloomFilter. 2015-07-27 19:09:39 +02:00
Peter Todd d2d7ee0e86 Make CRollingBloomFilter set nTweak for you
While CBloomFilter is usually used with an explicitly set nTweak,
CRollingBloomFilter is only used internally. Requiring every caller to
set nTweak is error-prone and redundant; better to have the class handle
that for you with a high-quality randomness source.

Additionally when clearing the filter it makes sense to change nTweak as
well to recover from a bad setting, e.g. due to insufficient randomness
at initialization, so the clear() method is replaced by a reset() method
that sets a new, random, nTweak value.
2015-07-27 18:38:49 +02:00
Pieter Wuille a3d65fedaa Reuse vector hashing code for uint256 2015-07-27 18:38:45 +02:00
Peter Todd bbe41088c6 Add uint256 support to CRollingBloomFilter 2015-07-27 18:37:18 +02:00
Gavin Andresen 517e6dd256 Unit test doublespends in new blocks
As suggested by Greg Maxwell-- unit test to make sure a block
with a double-spend in it doesn't pass validation if half of
the double-spend is already in the memory pool (so full-blown
transaction validation is skipped) when the block is received.
2015-07-27 15:50:21 +02:00
Pieter Wuille 17b11428c1 Cache transaction validation successes 2015-07-27 15:28:43 +02:00
Wladimir J. van der Laan c38c49d0b7 Fix argument parsing oddity with -noX
`bitcoind -X -noX` ends up, unintuitively, with `X` set.
(for all boolean options X)

This result is due to the odd two-pass processing of arguments. This
patch fixes this oddity and simplifies the code at the same time.
2015-07-27 14:47:54 +02:00
Wladimir J. van der Laan ca37e0f339
Merge pull request #5697
60c8bac Includes: Cleanup around net main and wallet (Jorge Timón)
9dd793f TRIVIAL: Missing includes (Jorge Timón)
2015-07-27 14:40:29 +02:00
Wladimir J. van der Laan 614601be8f rpc: Accept strings in AmountFromValue
Accept strings containing decimal values, in addition to bare values.

Useful from JSON-RPC implementations where it's not possible to have
direct control over the text of numbers (e.g. where numbers are always
doubles), and it's still desired to send an exact value.

This would allow users to post JSON content with numbers encoded like
`{"value": "0.00000001"}` instead of `{"value": 0.00000001}` which some
php/python encoders wrap into 1e-8, or worse.
2015-07-27 13:55:46 +02:00
Wladimir J. van der Laan d43297c5ba
Merge pull request #6468
6f8b6d3 don't try to decode invalid encoded ext keys (Jonas Schnelli)
8d2af54 extend bip32 tests to cover Base58c/CExtKey decode (Jonas Schnelli)
7cb1f9f fix and extend CBitcoinExtKeyBase template (Jonas Schnelli)
2015-07-27 13:20:54 +02:00
Wladimir J. van der Laan f6850d58f7
Merge pull request #6471
060b3d3 fixup: qt 5.5 snuck in another module that needs path hand-holding (Cory Fields)
ecd6a89 depends: make more qt flags explicit (Cory Fields)
ab67dd7 depends: bump to qt 5.5 (Cory Fields)
5189fe3 depends: split qt config options to separate lines (Jacob Welsh)
fe997df build: fix building against qt5.4/5.5 (Cory Fields)
2015-07-27 12:28:42 +02:00
Jonas Schnelli 6f8b6d339b don't try to decode invalid encoded ext keys 2015-07-25 09:51:52 +02:00
Philip Kaufmann ed166dfa82 [Qt] allow users to set -onion via GUI
- also allow users to see, if the default proxy (-proxy) is used for
  reaching peers via IPv6 or Tor
2015-07-24 12:28:06 +02:00
Wladimir J. van der Laan bfd807ff32
Merge pull request #6456
ec249d4 util: use locale-independent parsing in ParseDouble (Wladimir J. van der Laan)
7650449 univalue: Avoid unnecessary roundtrip through double for numbers (Wladimir J. van der Laan)
e061e27 rpc: Make ValueFromAmount always return 8 decimals (Wladimir J. van der Laan)
2015-07-24 11:08:52 +02:00
Cory Fields fe997dfd12 build: fix building against qt5.4/5.5 2015-07-23 21:10:35 -04:00
Jorge Timón 60c8bac77c Includes: Cleanup around net main and wallet
-Move from .h to .cpp: in main, net and wallet
-Remove unnecessary #include "main.h"
-Cleanup some wallet files includes
2015-07-23 21:10:26 +02:00
Jorge Timón 9dd793f499 TRIVIAL: Missing includes 2015-07-23 21:10:22 +02:00
Wladimir J. van der Laan d2464dfee9
Merge pull request #6287
a794284 locking: add a quick example of GUARDED_BY (Cory Fields)
2b890dd locking: fix a few small issues uncovered by -Wthread-safety (Cory Fields)
cd27bba locking: teach Clang's -Wthread-safety to cope with our scoped lock macros (Cory Fields)
2015-07-23 18:45:26 +02:00
Wladimir J. van der Laan d946e9a848
Merge pull request #5515
0fcc4e1 Assert on probable deadlocks if the second lock isnt try_lock (Matt Corallo)
2015-07-23 18:34:35 +02:00
Jonas Schnelli 8d2af54ecc extend bip32 tests to cover Base58c/CExtKey decode 2015-07-23 16:32:31 +02:00
Jonas Schnelli 7cb1f9f7eb fix and extend CBitcoinExtKeyBase template
- fix Decode call (req. only one param)
- add constructor for base58c->CExtKey
2015-07-23 16:32:21 +02:00
Matt Corallo 0fcc4e1e04 Assert on probable deadlocks if the second lock isnt try_lock 2015-07-22 16:49:54 -07:00
Ross Nicoll c433828df9 Handle no chain tip available in InvalidChainFound()
Handle the case where no chain tip is available, in InvalidChainFound(). This fixes a null pointer deference when running unit tests, if the genesis block or block validation code is broken.
2015-07-22 21:10:09 +00:00
Wladimir J. van der Laan 633fe10869
Merge pull request #6149
27d7605 Buffer log messages and explicitly open logs (Adam Weiss)
2015-07-22 18:24:20 +02:00
Wladimir J. van der Laan 45d1f5932b
Merge pull request #6381
c4973aa Chainparams: CTestNetParams and CRegTestParams extend directly from CChainParams (Jorge Timón)
d3cf546 Chainparams: Introduce CreateGenesisBlock() static function (Jorge Timón)
2015-07-21 13:29:16 +02:00
Wladimir J. van der Laan 24f6928192
Merge pull request #6400
1327897 Reformat help text of estimatefee and estimatepriority to match other help texts. (Pavel Janík)
2015-07-21 12:49:41 +02:00
Wladimir J. van der Laan 24ce77d775
Merge pull request #6444
0aad1f1 Exempt unspendable transaction outputs from dust checks (zathras-crypto)
2015-07-21 11:47:57 +02:00
Matt Corallo 6bdb474dc9 Implement watchonly support in fundrawtransaction
Some code and test cases stolen from
Bryan Bishop <bryan@ledgerx.com> (pull #5524).
2015-07-20 16:01:38 -07:00
Matt Corallo f5813bdd3e Add logic to track pubkeys as watch-only, not just scripts 2015-07-20 16:01:37 -07:00
Matt Corallo d3354c52d7 Add have-pubkey distinction to ISMINE flags
This indicates that, eg, we have a public key for a key which may
be used as a pay-to-pubkey-hash. It generally means that we can
create a valid scriptSig except for missing private key(s) with
which to create signatures.
2015-07-20 16:01:37 -07:00
Matt Corallo 5c17059872 Update importaddress help to push its use to script-only 2015-07-20 16:01:37 -07:00
Matt Corallo a1d7df3236 Add importpubkey method to import a watch-only pubkey 2015-07-20 16:01:37 -07:00
Matt Corallo 907a425aa5 Add p2sh option to importaddress to import redeemScripts 2015-07-20 16:01:37 -07:00
Matt Corallo 983d2d90af Split up importaddress into helper functions 2015-07-20 16:01:37 -07:00
Matt Corallo cfc3dd3428 Also remove pay-2-pubkey from watch when adding a priv key 2015-07-20 16:01:37 -07:00
Pavel Janík 1327897aee Reformat help text of estimatefee and estimatepriority to match other help texts. 2015-07-20 19:32:38 +02:00
Wladimir J. van der Laan 6d6b11e793
Merge pull request #6408
dca6040 [Qt] remove std namespace polution from code (Philip Kaufmann)
2015-07-20 18:00:32 +02:00
Pieter Wuille 9e38d0f745 Separate core memory usage computation in core_memusage.h 2015-07-20 11:17:53 -04:00
Wladimir J. van der Laan 89289d875d
Fix warning introduced by #6412
SOCKET are defined as unsigned integers, thus always >=0.
2015-07-20 17:10:02 +02:00
Wladimir J. van der Laan 1a2de3237f
Merge pull request #6412
d422f9b Test whether created sockets are select()able (Pieter Wuille)
2015-07-20 16:54:28 +02:00
Wladimir J. van der Laan dc51608c9c
Merge pull request #6447
2cb8ee9 remove unused inv from ConnectTip() (Pavel Vasin)
2015-07-20 16:43:07 +02:00
Simon Males 0ef9858707 Documenting pruned, pruneheight and softforks in getblockchaininfo 2015-07-19 14:07:35 +02:00
zathras-crypto 0aad1f13b2
Exempt unspendable transaction outputs from dust checks
Since unspendable outputs can't be spent, there is no threshold at which it would be uneconomic to spend them.

This primarily targets transaction outputs with `OP_RETURN`.

---

Initially based on:

commit 9cf0ae26350033d43d5dd3c95054c0d1b1641eda
Author: zathras-crypto <zathrasc@gmail.com>
Date:   Wed Mar 25 02:04:02 2015 -0700

Changes:

- cherry-picked on top of bitcoin:master
- added RPC test for fundrawtransaction
2015-07-18 17:31:55 +02:00
Wladimir J. van der Laan ec249d4a1d util: use locale-independent parsing in ParseDouble
Use locale-indepent C++ based parsing instead of C's strtod,
which checks for different input based on the user's locale.
Fixes #6443.
2015-07-18 09:04:18 +02:00
Wladimir J. van der Laan 7650449a67 univalue: Avoid unnecessary roundtrip through double for numbers
JSON makes no distinction between numbers and reals, and our code
doesn't need to do so either.

This removes VREAL, as well as its specific post-processing in
`UniValue::write`. Non-monetary amounts do not need to be forcibly
formatted with 8 decimals, so the extra roundtrip was unnecessary
(and potentially loses precision).
2015-07-18 09:04:18 +02:00
Wladimir J. van der Laan e061e2778d rpc: Make ValueFromAmount always return 8 decimals
This is the format that was always returned to JSON clients.
The difference was not noticed before, because VREAL values
are post-processed by univalue.

By implementing the functionality directly it breaks the dependency
of rpcserver on utilmoneystr. FormatMoney is now only used for debugging
purposes.

To test, port over the formatting tests from util_tests.cpp to
rpc_tests.cpp.
2015-07-18 09:03:59 +02:00
Philip Kaufmann dca6040a86 [Qt] remove std namespace polution from code 2015-07-16 11:54:28 +02:00
Pavel Vasin 2cb8ee9ac7 remove unused inv from ConnectTip() 2015-07-16 12:31:36 +03:00
Wladimir J. van der Laan ed789ceade
Merge pull request #6438
d4b1d5a openssl: avoid config file load/race (Cory Fields)
2015-07-15 15:49:45 +02:00
Wladimir J. van der Laan ce183dce2e
qt: update forgotten emit to Q_EMIT in macdockiconhandler.mm
Leftover from #6433
2015-07-15 15:09:31 +02:00
Wladimir J. van der Laan d29ec6c230 qt: define QT_NO_KEYWORDS
QT_NO_KEYWORDS prevents Qt from defining the `foreach`, `signals`,
`slots` and `emit` macros.

Avoid overlap between Qt macros and boost - for example #undef hackiness
in #6421.
2015-07-15 07:30:23 +02:00
Cory Fields d4b1d5a8ba openssl: avoid config file load/race 2015-07-14 17:54:04 -04:00
Wladimir J. van der Laan 71cbeaad9a rpc: Implement random-cookie based authentication
When no `-rpcpassword` is specified, use a special 'cookie' file for
authentication. This file is generated with random content when the
daemon starts, and deleted when it exits. Read access to this file
controls who can access through RPC. By default this file is stored in
the data directory but it be overriden with `-rpccookiefile`.

This is similar to Tor CookieAuthentication: see
https://www.torproject.org/docs/tor-manual.html.en

Alternative to #6258. Like that pull, this allows running bitcoind
without any manual configuration. However, daemons should ideally never write to
their configuration files, so I prefer this solution.
2015-07-13 13:11:41 +02:00
Wladimir J. van der Laan 3d9362d5ac
Merge pull request #6398
85ee55b rpc: Remove chain-specific RequireRPCPassword (Wladimir J. van der Laan)
2015-07-13 12:55:06 +02:00
Jorge Timón c4973aaaf6 Chainparams: CTestNetParams and CRegTestParams extend directly from CChainParams
...instead of CMainParams and CTestNetParams respectively

Do the same for CBaseChainParams.
The inheritance was only reducing readibility in this case
2015-07-12 11:13:47 +02:00
Jorge Timón d3cf546ec2 Chainparams: Introduce CreateGenesisBlock() static function 2015-07-12 11:03:06 +02:00
Wladimir J. van der Laan 7cdefb927e
Merge pull request #6410
5098c47 Implement accurate memory accounting for mempool (Pieter Wuille)
2015-07-11 15:47:43 +02:00
Suhas Daftuar 59b49cd074 Eliminate signed/unsigned comparison warning 2015-07-11 07:05:18 -04:00
Pieter Wuille d422f9b1fd Test whether created sockets are select()able 2015-07-10 12:05:09 -04:00
Wladimir J. van der Laan fac21df5f0
Merge pull request #6370
6ebac07 Remove ChainParams::DefaultMinerThreads (Wladimir J. van der Laan)
2015-07-10 17:12:40 +02:00
Wladimir J. van der Laan c52e8b300a
Merge pull request #6379
9cc9152 rpc: Accept scientific notation for monetary amounts in JSON (Wladimir J. van der Laan)
2015-07-10 16:50:46 +02:00
Pieter Wuille 5098c47b24 Implement accurate memory accounting for mempool 2015-07-10 10:49:31 -04:00
Wladimir J. van der Laan 9cc91523db rpc: Accept scientific notation for monetary amounts in JSON
Add a function `ParseFixedPoint` that parses numbers according
to the JSON number specification and returns a 64-bit integer.

Then this in `AmountFromValue`, rather than `ParseMoney`.

Also add lots of tests (thanks to @jonasschnelli for some of them).

Fixes issue #6297.
2015-07-10 15:43:26 +02:00
Wladimir J. van der Laan 943b322d5d
Merge pull request #5486
c45c7ea [REST] add JSON support for /rest/headers/ (Jonas Schnelli)
2015-07-10 15:25:51 +02:00
Wladimir J. van der Laan 445220544e
Merge pull request #5288
e3cae52 Added -whiteconnections=<n> option (Josh Lehan)
2015-07-10 15:07:15 +02:00
Wladimir J. van der Laan 85ee55b5c3 rpc: Remove chain-specific RequireRPCPassword
I've never liked the chain-specific exception to having to set a
password. It gives issues with #6388 which makes it valid to
set no password in every case (as it enables random cookie authentication).

This pull removes the flag, so that all chains are regarded the same.

It also removes the username==password test, which doesn't provide any
substantial extra security.
2015-07-10 15:01:55 +02:00
Wladimir J. van der Laan 708037fcc7
Merge pull request #6384
15e26a6 qt: Force TLS1.0+ for SSL connections (Wladimir J. van der Laan)
2015-07-10 15:00:01 +02:00
Wladimir J. van der Laan 7fc25c2e5d
Merge pull request #6368
cb54d17 CLTV: Add more tests to improve coverage (Esteban Ordano)
2015-07-09 11:20:17 +02:00
Wladimir J. van der Laan aa565327ec
Merge pull request #6378
5e058e7 [Qt] constify foreach uses where possible (Philip Kaufmann)
2015-07-09 10:54:21 +02:00
Wladimir J. van der Laan 11576a57d2
Merge pull request #6387
65ce021 [bitcoin-cli] improve error output (Jonas Schnelli)
2015-07-08 13:39:57 +02:00
Wladimir J. van der Laan 133601f6a5 tests: Fix bitcoin-tx signing testcase
Fixes wrong scriptPubkey problem, which caused the transaction to
not actually be signed.
2015-07-07 18:26:38 +02:00
Jonas Schnelli 65ce0215a4 [bitcoin-cli] improve error output 2015-07-07 17:25:56 +02:00
Philip Kaufmann 5e058e7417 [Qt] constify foreach uses where possible
- this doesn't replace BOOST_FOREACH, it just makes used arguments const
  where possible
2015-07-07 06:53:43 +02:00
Adam Weiss 27d7605804 Buffer log messages and explicitly open logs
Prevents stomping on debug logs in datadirs that are locked by other
instances and lost parameter interaction messages that can get wiped by
ShrinkDebugFile().

The log is now opened explicitly and all emitted messages are buffered
until this open occurs.  The version message and log cut have also been
moved to the earliest possible sensible location.
2015-07-06 21:54:31 -04:00
Esteban Ordano cb54d17355 CLTV: Add more tests to improve coverage
Four cases included:

* The CLTV operand type mismatches the tx locktime. In the script it is
  1 (interpreted as block height), but in the tx is 500000000
  (interpreted as date)
* The stack is empty when executing OP_CLTV
* The tx is final by having only one input with MAX_INT sequence number
* The operand for CLTV is negative (after OP_0 OP_1 OP_SUB)
2015-07-06 13:09:37 -07:00
Wladimir J. van der Laan 15e26a6a9a qt: Force TLS1.0+ for SSL connections 2015-07-06 20:06:16 +02:00
Wladimir J. van der Laan 086cb336cd
Merge pull request #6365
5a7304b Move recently introduced CTransAction::IsEquivalentTo to CWalletTx (Wladimir J. van der Laan)
2015-07-06 19:11:14 +02:00
Wladimir J. van der Laan 9546a977d3
Merge pull request #6335
9238ecb Policy: MOVEONLY: 3 functions to policy.o: (Luke Dashjr)
627b9de Policy: MOVEONLY: Create policy/policy.h with some constants (Jorge Timón)
2015-07-06 18:54:20 +02:00
Jonas Schnelli c45c7ea0fa [REST] add JSON support for /rest/headers/ 2015-07-05 15:48:33 +02:00
Wladimir J. van der Laan 6ebac0782f Remove ChainParams::DefaultMinerThreads
No longer relevant after #5957. This hack existed because of another
hack where the numthreads parameter, on regtest, doubled as how many
blocks to generate.
2015-07-03 16:46:20 +02:00
Wladimir J. van der Laan d0a10c1959
Merge pull request #6329
0c37634 acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only (Luke Dashjr)
2015-07-03 14:00:06 +02:00
Luke Dashjr 0c376340a4 acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only 2015-07-03 08:29:16 +00:00
Wladimir J. van der Laan 5a7304b69d Move recently introduced CTransAction::IsEquivalentTo to CWalletTx
CTransAction::IsEquivalentTo was introduced in #5881.
This functionality is only useful to the wallet, and should never have
been added to the primitive transaction type.
2015-07-02 20:57:39 +02:00
Jonas Schnelli 177a0e4914 Adding CSubNet constructor over a single CNetAddr 2015-07-02 20:44:27 +02:00
Jonas Schnelli 409bccfbf5 use CBanEntry as object container for banned nodes
- added a reason enum for a ban
- added creation time for a ban

Using CBanEntry as container will keep banlist.dat extenable.
2015-07-02 20:29:36 +02:00
Jonas Schnelli dfa174c295 CAddrDB/CBanDB: change filesize variables from int to uint64_t 2015-07-02 20:29:36 +02:00
Jonas Schnelli f581d3d656 banlist.dat: store banlist on disk 2015-07-02 20:29:36 +02:00
Wladimir J. van der Laan d6db1157bc
Merge pull request #6362
72b9452 When processing RPC commands during warmup phase, parse the request object before returning an error so that id value can be used in the response. (Forrest Voight)
2015-07-02 20:09:28 +02:00
Wladimir J. van der Laan d7ada03b8a
Merge pull request #6361
4716267 Use real number of cores for default -par, ignore virtual cores (Wladimir J. van der Laan)
2015-07-02 20:01:04 +02:00
Wladimir J. van der Laan 3203a0832a
Merge pull request #5881
5d34e16 Add txn_clone.py test (Tom Harding)
defd2d5 Better txn_doublespend.py test (Tom Harding)
b2b3619 Implement CTransaction::IsEquivalentTo(...) (Tom Harding)
2015-07-02 19:59:50 +02:00
Wladimir J. van der Laan 987efae1fd
Merge pull request #6133
e617fe2 Fix various warnings (Luke Dashjr)
2015-07-02 19:54:12 +02:00
Wladimir J. van der Laan 726e28643c
Merge pull request #6247
076badb Add getblockheader RPC call (Peter Todd)
2015-07-02 18:53:18 +02:00
Forrest Voight 72b9452b1d When processing RPC commands during warmup phase, parse the
request object before returning an error so that id value can
be used in the response.

Prior to this commit, RPC commands sent during Bitcoin's
warmup/startup phase were responded to with a JSON-RPC error
with an id of null, which violated the JSON-RPC 2.0 spec:

id: This member is REQUIRED. It MUST be the same as the value
of the id member in the Request Object. If there was an error
in detecting the id in the Request object (e.g. Parse
error/Invalid Request), it MUST be Null.
2015-07-01 21:55:08 -04:00
Wladimir J. van der Laan 6bcb0a21c5
Merge pull request #6353
5ed1079 Show softfork status in getblockchaininfo (Wladimir J. van der Laan)
2015-07-01 19:37:24 +02:00
Wladimir J. van der Laan 5ed10793c2 Show softfork status in getblockchaininfo 2015-07-01 19:36:17 +02:00
Wladimir J. van der Laan 47162673c7 Use real number of cores for default -par, ignore virtual cores
To determine the default for `-par`, the number of script verification
threads, use [boost:🧵:physical_concurrency()](http://www.boost.org/doc/libs/1_58_0/doc/html/thread/thread_management.html#thread.thread_management.thread.physical_concurrency)
which counts only physical cores, not virtual cores.

Virtual cores are roughly a set of cached registers to avoid context
switches while threading, they cannot actually perform work, so spawning
a verification thread for them could even reduce efficiency and will put
undue load on the system.

Should fix issue #6358, as well as some other reported system overload
issues, especially on Intel processors.

The function was only introduced in boost 1.56, so provide a utility
function `GetNumCores` to fall back for older Boost versions.
2015-07-01 18:01:16 +02:00
Jonas Schnelli a7b9623d18 miner: rename UpdateRequestCount signal to ResetRequestCount 2015-07-01 16:09:58 +02:00
Jonas Schnelli 5496253966 add CReserveScript to allow modular script keeping/returning
- use one CReserveScript per mining thread
2015-07-01 16:06:14 +02:00
Shaul Kfir a651403e09 Add absurdly high fee message to validation state (for RPC propagation) 2015-06-30 15:59:11 -04:00
Jonas Schnelli 087e65def9 fix GetScriptForMining() CReserveKey::keepKey() issue 2015-06-30 21:45:46 +02:00
Jonas Schnelli d0fc10a844 detach wallet from miner 2015-06-30 21:45:46 +02:00
Suhas Daftuar 6b1066fab4 Ignore whitelisting during IBD for unrequested blocks. 2015-06-30 09:42:56 -04:00
Wladimir J. van der Laan 0564c5b795
Merge pull request #6337
6a4b97e Testing infrastructure: mocktime fixes (Gavin Andresen)
2015-06-29 16:41:29 +02:00
Luke Dashjr 9238ecb417 Policy: MOVEONLY: 3 functions to policy.o:
- [script/standard.o] IsStandard
- [main.o] IsStandardTx
- [main.o] AreInputsStandard

Also, don't use namespace std in policy.cpp
2015-06-26 17:59:10 +02:00
Jorge Timón 627b9deff4 Policy: MOVEONLY: Create policy/policy.h with some constants 2015-06-26 17:59:07 +02:00
Wladimir J. van der Laan 24f24896d6
Merge pull request #6299
4f40716 test: Move reindex test to standard tests (Wladimir J. van der Laan)
36c97b4 Bugfix: Don't check the genesis block header before accepting it (Jorge Timón)
2015-06-26 15:40:59 +02:00
Wladimir J. van der Laan 41076aad0c
Merge pull request #6124
ffd75ad Enable CHECKLOCKTIMEVERIFY as a standard script verify flag (Peter Todd)
bc60b2b Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) (Peter Todd)
48e9c57 Move LOCKTIME_THRESHOLD to src/script/script.h (Peter Todd)
99088d6 Make CScriptNum() take nMaxNumSize as an argument (Peter Todd)
2015-06-26 14:42:45 +02:00