Commit graph

8557 commits

Author SHA1 Message Date
Wladimir J. van der Laan
37a166f146 rpc: Named arguments for wallet calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan
78b684f2ac rpc: Named arguments for mining calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan
b8ebc595bb rpc: Named arguments for net calls
Also add a more descriptive message for `setnetworkactive`.
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan
fba1a6150c rpc: Named arguments for misc calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan
286ec08cb0 rpc: Add 'echo' call for testing
This hidden call simply returns what is passed in.
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan
495eb44a4f rpc: Named arguments for blockchain calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan
6f1c76ae14 rpc: Support named arguments
The [JSON-RPC specification](http://www.jsonrpc.org/specification) allows passing parameters as an Array, for by-position
arguments, or an Object, for by-name arguments.

This implements by-name arguments, but preserves full backwards compatibility. API using by-name arguments are
easier to extend, and easier to use (no need to guess which argument goes where).

Named are mapped to positions by a per-call structure, provided through the RPC command table.

Missing arguments will be replaced by null, except if at the end, then the argument is left out completely.

Currently calls fail (though not crash) on intermediate nulls, but this should be improved on a per-call basis later.
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan
cfe41d7a60
Merge #9387: [Refactor] RAII of libevent stuff using unique ptrs with deleters
05a55a6 Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. (Karl-Johan Alm)
280a559 Added some simple tests for the RAII-style events. (Karl-Johan Alm)
7f7f102 Switched bitcoin-cli.cpp to use RAII unique pointers with deleters. (Karl-Johan Alm)
e5534d2 Added std::unique_ptr<> wrappers with deleters for libevent modules. (Karl-Johan Alm)
2017-01-05 11:11:17 +01:00
Wladimir J. van der Laan
c4b7d4f79c
Merge #9417: Do not evaluate hidden LogPrint arguments
407cdd6 Do not evaluate hidden LogPrint arguments (Pieter Wuille)
2017-01-05 10:49:00 +01:00
Wladimir J. van der Laan
48d7e0d5e4
Merge #9474: Mark the minconf parameter to move as ignored
ce370c1 Mark the minconf parameter to move as ignored (Pieter Wuille)
2017-01-05 10:29:26 +01:00
Wladimir J. van der Laan
7014506415
Merge #9475: Let autoconf detect presence of EVP_MD_CTX_new
0388afe Let autoconf detect presence of EVP_MD_CTX_new (Luke Dashjr)
2017-01-05 10:28:47 +01:00
Pieter Wuille
6dd81169fc Remove SIGCHECK_VERIFICATION_FACTOR 2017-01-04 13:18:49 -08:00
Pieter Wuille
3641141c8f Move tx estimation data out of CCheckPointData 2017-01-04 13:18:49 -08:00
Pieter Wuille
a4bac66cca [MOVEONLY] Move progress estimation out of checkpoints 2017-01-04 13:18:49 -08:00
Russell Yanofsky
dd44ea39bb Check FRESH validity in CCoinsViewCache::BatchWrite 2017-01-04 14:56:17 -05:00
Pieter Wuille
7dac1e5e9e
Merge #9107: Safer modify new coins
b50cd7a Fix dangerous condition in ModifyNewCoins. (Alex Morcos)
2017-01-04 11:56:17 -08:00
Luke Dashjr
0388afe69d Let autoconf detect presence of EVP_MD_CTX_new
Fixes LibreSSL compatibility
2017-01-04 18:37:37 +00:00
Alex Morcos
44b64b933d Fix edge case with stale fee estimates 2017-01-04 12:10:18 -05:00
Alex Morcos
78ae62d264 Add clarifying comments to fee estimation 2017-01-04 12:10:18 -05:00
Alex Morcos
5fe0f47aa7 Add extra logging to processBlock in fee estimation. 2017-01-04 12:10:18 -05:00
Alex Morcos
dc008c462f Add IsCurrentForFeeEstimatation
Make a more conservative notion of whether the node is caught up to the rest of the network and only count transactions as fee estimation data points if the node is caught up.
2017-01-04 12:10:17 -05:00
Alex Morcos
ebafdcabb1 Pass pointers to existing CTxMemPoolEntries to fee estimation 2017-01-04 12:09:34 -05:00
Alex Morcos
d825838e64 Always update fee estimates on new blocks.
All decisions about whether the transactions are valid data points are made at the time the transaction arrives. Updating on blocks all the time will now cause stale fee estimates to decay quickly when we restart a node.
2017-01-04 12:09:34 -05:00
Alex Morcos
6f06b268c1 rename bool to validFeeEstimate 2017-01-04 12:09:33 -05:00
Alex Morcos
84f7ab08d2 Remove member variable hadNoDependencies from CTxMemPoolEntry
Fee estimation can just check its own mapMemPoolTxs to determine the same information.  Note that now fee estimation for block processing must happen before those transactions are removed, but this shoudl be a speedup.
2017-01-04 12:09:33 -05:00
Alex Morcos
60ac00de85 Don't track transactions at all during IBD.
This was an oversight, where blocks and mempool tracking were ignored during IBD, but transactions that arrived during IBD but were included in blocks after IBD were not ignored.
2017-01-04 12:05:05 -05:00
Alex Morcos
4df44794c9 Remove extraneous LogPrint from fee estimation
Once priority estimation was removed, not all transactions in the mempool are tracked in the fee estimation mempool tracking.  So there is no error if a transaction is not found for removal.
2017-01-04 12:03:44 -05:00
Pieter Wuille
ce370c1811 Mark the minconf parameter to move as ignored 2017-01-04 08:48:21 -08:00
Alex Morcos
b50cd7a67e Fix dangerous condition in ModifyNewCoins.
We were marking coins FRESH before being sure they were not overwriting dirty undo data. This condition was never reached in existing code because undo data was always flushed before UpdateCoins was called with new transactions, but could have been exposed in an otherwise safe refactor.
Clarify in the comments the assumptions made in ModifyNewCoins.
Add ability to undo transactions to UpdateCoins unit test.
Thanks to Russ Yanofsky for suggestion on how to make logic clearer and fixing up the ccoins_modify_new test cases.
2017-01-04 11:20:42 -05:00
Wladimir J. van der Laan
123ea73624
Merge #9457: [qt] Select more files for translation
facf3e7 [qt] `make translate` (MarcoFalke)
fae26e8 [qt] Add more sources to translate (MarcoFalke)
2017-01-04 16:41:29 +01:00
MarcoFalke
df1ab5b4d6
Merge #9470: qt: Set (count) placeholder in sendcoinsdialog to notranslate
388ea19 qt: Set (count) placeholder in sendcoinsdialog to notranslate (Wladimir J. van der Laan)
2017-01-04 15:19:00 +01:00
Wladimir J. van der Laan
388ea19bf2 qt: Set (count) placeholder in sendcoinsdialog to notranslate 2017-01-04 14:37:53 +01:00
MarcoFalke
c2ea1e6561
Merge #9401: Make rpcauth help message clearer, add example in example .conf
0513c70 Make rpcauth help message clearer, add example in example .conf (Gregory Sanders)
2017-01-04 13:00:12 +01:00
Wladimir J. van der Laan
d65a13b773
Merge #9396: Updated listsinceblock rpc documentation
3f67972 updated listsinceblock rpc docs (accraze)
2017-01-04 12:47:56 +01:00
Wladimir J. van der Laan
1ce7ede2a9
Merge #9288: Fix a bug if the min fee is 0 for FeeFilterRounder
f8d43b8 Avoid rollingMinimumFeeRate never being able to decay below half (Alex Morcos)
eab8e1b fix a bug if the min fee is 0 for FeeFilterRounder (Alex Morcos)
2017-01-04 12:33:56 +01:00
Wladimir J. van der Laan
869781c51c
Merge #9283: A few more CTransactionRef optimizations
91335ba Remove unused MakeTransactionRef overloads (Pieter Wuille)
6713f0f Make FillBlock consume txn_available to avoid shared_ptr copies (Pieter Wuille)
62607d7 Convert COrphanTx to keep a CTransactionRef (Pieter Wuille)
c44e4c4 Make AcceptToMemoryPool take CTransactionRef (Pieter Wuille)
2017-01-04 12:23:10 +01:00
Wladimir J. van der Laan
d9ae1cefa0
Merge #9289: net: drop boost::thread_group
67ee4ec net: misc header cleanups (Cory Fields)
8b3159e net: make proxy receives interruptible (Cory Fields)
5cb0fce net: remove thread_interrupted catch (Cory Fields)
d3d7056 net: make net processing interruptible (Cory Fields)
0985052 net: make net interruptible (Cory Fields)
799df91 net: add CThreadInterrupt and InterruptibleSleep (Cory Fields)
7325b15 net: a few small cleanups before replacing boost threads (Cory Fields)
2017-01-04 12:21:53 +01:00
MarcoFalke
facf3e7608 [qt] make translate 2017-01-04 12:13:03 +01:00
MarcoFalke
fae26e8dfc [qt] Add more sources to translate 2017-01-04 12:12:43 +01:00
Wladimir J. van der Laan
c0ddd32bf6
Merge #9450: Increment MIT licence copyright header year on files modified in 2016
27765b6 Increment MIT Licence copyright header year on files modified in 2016 (isle2983)
2017-01-04 12:09:05 +01:00
Karl-Johan Alm
05a55a639b Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. 2017-01-04 18:16:55 +09:00
Wladimir J. van der Laan
649cf5fe89
Merge #9462: [qt] Do not translate tilde character
fab6c5f [qt] Do not translate `~` (MarcoFalke)
2017-01-04 08:21:04 +01:00
Cory Fields
67ee4ec901 net: misc header cleanups 2017-01-03 17:56:21 -05:00
Cory Fields
8b3159ef0a net: make proxy receives interruptible 2017-01-03 17:56:21 -05:00
Cory Fields
5cb0fcee81 net: remove thread_interrupted catch
This is now a std::thread, so there's no hope of catching a boost interruption
point.
2017-01-03 17:56:21 -05:00
Cory Fields
d3d7056d2a net: make net processing interruptible 2017-01-03 17:56:20 -05:00
Cory Fields
0985052319 net: make net interruptible
Also now that net threads are interruptible, switch them to use std
threads/binds/mutexes/condvars.
2017-01-03 17:53:09 -05:00
Cory Fields
799df9115f net: add CThreadInterrupt and InterruptibleSleep 2017-01-03 17:53:09 -05:00
Cory Fields
7325b15566 net: a few small cleanups before replacing boost threads
- Drop the interruption point directly after the pnode allocation. This would
    be leaky if hit.
- Rearrange thread creation so that the socket handler comes first
2017-01-03 17:53:09 -05:00
Pieter Wuille
2a524b8e8f
Merge #8776: Wallet refactoring leading up to multiwallet
5394b39 Wallet: Split main logic from InitLoadWallet into CreateWalletFromFile (Luke Dashjr)
fb0c934 Wallet: Let the interval-flushing thread figure out the filename (Luke Dashjr)
2017-01-03 14:11:11 -08:00
Pieter Wuille
ce5c1f4aca
Merge #9252: Release cs_main before calling ProcessNewBlock, or processing headers (cmpctblock handling)
bd02bdd Release cs_main before processing cmpctblock as header (Suhas Daftuar)
680b0c0 Release cs_main before calling ProcessNewBlock (cmpctblock handling) (Suhas Daftuar)
2017-01-03 13:52:16 -08:00
MarcoFalke
fab6c5f46b [qt] Do not translate ~ 2017-01-03 17:51:12 +01:00
Jonas Schnelli
6dc4c43d32
Merge #8877: Qt RPC console: history sensitive-data filter, and saving input line when browsing history
8562792 GUI/RPCConsole: Include importmulti in history sensitive-command filter (Luke Dashjr)
ff77faf Qt/RPCConsole: Use RPCParseCommandLine to perform command filtering (Luke Dashjr)
a79598d Qt/Test: Make sure filtering sensitive data works correctly in nested commands (Luke Dashjr)
629cd42 Qt/RPCConsole: Teach RPCParseCommandLine how to filter out arguments to sensitive commands (Luke Dashjr)
e2d9213 Qt/RPCConsole: Make it possible to parse a command without executing it (Luke Dashjr)
1755c04 Qt/RPCConsole: Truncate filtered commands to just the command name, rather than skip it entirely in history (Luke Dashjr)
d80a006 Qt/RPCConsole: Add signmessagewithprivkey to list of commands filtered from history (Luke Dashjr)
afde12f Qt/RPCConsole: Refactor command_may_contain_sensitive_data function out of RPCConsole::on_lineEdit_returnPressed (Luke Dashjr)
de8980d Bugfix: Do not add sensitive information to history for real (Luke Dashjr)
9044908 Qt/RPCConsole: Don't store commands with potentially sensitive information in the history (Jonas Schnelli)
fc95daa Qt/RPCConsole: Save current command entry when browsing history (Jonas Schnelli)
2017-01-03 16:57:21 +01:00
Wladimir J. van der Laan
d45b21e2b3 qt: Fill in English numerusforms
minute/minutes block/blocks and so forth.
2017-01-03 15:03:37 +01:00
Wladimir J. van der Laan
a9d6151802 qt,wallet: Fix a few typos in messages
As reported by [yahoe.001](https://www.transifex.com/user/profile/yahoe.001/).
2017-01-03 15:01:46 +01:00
Jonas Schnelli
510c0d9c79
Merge #9446: SetMerkleBranch: remove unused code, remove cs_main lock requirement
9e351c9 SetMerkleBranch: remove unused code, remove cs_main lock requirement (Jonas Schnelli)
2017-01-03 09:31:57 +01:00
Karl-Johan Alm
73f41190b9 Refactoring: Removed using namespace <xxx> from bench/ and test/ source files. 2017-01-02 20:35:23 +09:00
Wladimir J. van der Laan
1d2d67692c
qt: Set transifex slug to 0.14
Also perform update of source translations.
2017-01-02 09:36:03 +01:00
isle2983
27765b6403 Increment MIT Licence copyright header year on files modified in 2016
Edited via:

$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Jonas Schnelli
9e351c9586
SetMerkleBranch: remove unused code, remove cs_main lock requirement 2016-12-30 10:37:13 +01:00
jnewbery
b7e144bb73 Add test cases to test new bitcoin-tx functionality
This commit add testcases to test the following functions in bitcoin-tx:

- add a pay to non-standard script output
- add a P2SH output
- add a P2WSH output
- add a P2WSH wrapped in a P2SH output
- add a pay to pub key output
- add a P2WPKH output
- add a P2WPKH wrapped in a P2SH output
- add a bare multisig output
- add a multisig in P2SH output
- add a multisig in a P2WSH output
- add a multisig in a P2WSH wrapped in as P2SH output
2016-12-29 15:40:40 +00:00
jnewbery
61a153443e Add all transaction output types to bitcoin-tx.
This commit enhances bitcoin-tx so all remaining standard TXO types can be created:

- Pay to Pub Key
- Multi-sig
  - bare multi-sig
  - multi-sig in Pay To Script Hash
  - multi-sig in Pay to Witness Script Hash
  - multi-sig in Pay to Witness Script Hash, wrapped in P2SH
- Pay to Witness Pub Key Hash
  - Pay to Witness Pub Key Hash, wrapped in P2SH
- Pay to Witness Script Hash
  - Pay to Witness Script Hash, wrapped in P2SH
2016-12-29 15:40:40 +00:00
Stanislas Marion
1814b089fb add p2sh and segwit options to bitcoin-tx outscript command 2016-12-29 15:40:40 +00:00
Luke Dashjr
8562792095 GUI/RPCConsole: Include importmulti in history sensitive-command filter 2016-12-29 11:47:58 +00:00
Luke Dashjr
ff77faf480 Qt/RPCConsole: Use RPCParseCommandLine to perform command filtering 2016-12-29 11:47:58 +00:00
Luke Dashjr
a79598ddf4 Qt/Test: Make sure filtering sensitive data works correctly in nested commands 2016-12-29 11:46:26 +00:00
Luke Dashjr
629cd42364 Qt/RPCConsole: Teach RPCParseCommandLine how to filter out arguments to sensitive commands 2016-12-29 11:46:26 +00:00
Luke Dashjr
e2d9213c32 Qt/RPCConsole: Make it possible to parse a command without executing it 2016-12-29 11:43:29 +00:00
Luke Dashjr
1755c04576 Qt/RPCConsole: Truncate filtered commands to just the command name, rather than skip it entirely in history 2016-12-29 11:43:29 +00:00
Luke Dashjr
d80a00660f Qt/RPCConsole: Add signmessagewithprivkey to list of commands filtered from history 2016-12-29 11:43:29 +00:00
Luke Dashjr
afde12f265 Qt/RPCConsole: Refactor command_may_contain_sensitive_data function out of RPCConsole::on_lineEdit_returnPressed 2016-12-29 11:43:29 +00:00
Luke Dashjr
de8980df9d Bugfix: Do not add sensitive information to history for real
Original code was missing braces, and short-circuited before checking everything after importprivkey
2016-12-29 11:43:29 +00:00
Jonas Schnelli
9044908636 Qt/RPCConsole: Don't store commands with potentially sensitive information in the history
Filters importprivkey, signrawtransaction, walletpassphrase, walletpassphrasechange, and encryptwallet
2016-12-29 11:43:28 +00:00
Jonas Schnelli
fc95daa97f Qt/RPCConsole: Save current command entry when browsing history
Shell-like, but doesn't store changed history commands until executing it.
2016-12-29 11:43:28 +00:00
MarcoFalke
dce853ef76
Merge #9436: test: Include tx data in EXTRA_DIST
fa558be test: Include tx data in EXTRA_DIST (MarcoFalke)
2016-12-28 12:58:20 +01:00
Pieter Wuille
2db4cbcc43
Merge #9349: Make CScript (and prevector) c++11 movable.
2ddfcfd Make CScript (and prevector) c++11 movable. (Pieter Wuille)
2016-12-27 11:04:14 -08:00
Pieter Wuille
7aa700424c
Merge #9243: Clean up mapArgs and mapMultiArgs Usage
c2f61be Add a ForceSetArg method for testing (Matt Corallo)
4e04814 Lock mapArgs/mapMultiArgs access in util (Matt Corallo)
4cd373a Un-expose mapArgs from utils.h (Matt Corallo)
71fde55 Get rid of mapArgs direct access in ZMQ construction (Matt Corallo)
0cf86a6 Introduce (and use) an IsArgSet accessor method (Matt Corallo)
2b5f085 Fix non-const mapMultiArgs[] access after init. (Matt Corallo)
c8042a4 Remove arguments to ParseConfigFile (Matt Corallo)
2016-12-27 10:17:11 -08:00
MarcoFalke
fa558be2c1 test: Include tx data in EXTRA_DIST 2016-12-27 19:16:17 +01:00
MarcoFalke
dbc8a8c86a
Merge #9435: Removed unused variable in test, fixing warning.
35356b4 Remove unused variable in test, fixing warning. (Russell Yanofsky)
2016-12-27 18:51:36 +01:00
Matt Corallo
c2f61bebb1 Add a ForceSetArg method for testing 2016-12-27 13:52:07 +01:00
Russell Yanofsky
35356b40ef Remove unused variable in test, fixing warning.
Pointed out by Pavel Janík <Pavel@Janik.cz> in
https://github.com/bitcoin/bitcoin/pull/9308.
2016-12-27 07:35:39 -05:00
Suhas Daftuar
bd02bddb93 Release cs_main before processing cmpctblock as header 2016-12-26 05:34:54 -05:00
Suhas Daftuar
680b0c0138 Release cs_main before calling ProcessNewBlock (cmpctblock handling) 2016-12-26 05:30:26 -05:00
Matt Corallo
4e048142a5 Lock mapArgs/mapMultiArgs access in util 2016-12-24 11:29:33 -05:00
Matt Corallo
4cd373aea8 Un-expose mapArgs from utils.h 2016-12-24 11:29:33 -05:00
Matt Corallo
71fde5563b Get rid of mapArgs direct access in ZMQ construction 2016-12-24 11:10:39 -05:00
Matt Corallo
0cf86a6678 Introduce (and use) an IsArgSet accessor method 2016-12-23 21:30:16 -05:00
Matt Corallo
2b5f085ad1 Fix non-const mapMultiArgs[] access after init.
Swap mapMultiArgs for a const-reference to a _mapMultiArgs which is
only accessed in util.cpp
2016-12-23 21:30:15 -05:00
Matt Corallo
c8042a48f0 Remove arguments to ParseConfigFile 2016-12-23 21:30:15 -05:00
Pieter Wuille
407cdd6cb8 Do not evaluate hidden LogPrint arguments 2016-12-23 14:22:46 -08:00
Jonas Schnelli
54f80263fc
[CoinControl] Allow non-wallet owned change addresses 2016-12-23 16:07:37 +01:00
Jonas Schnelli
9479f8dfcf
Allow shutdown during LoadMempool, dump only when necessary 2016-12-23 14:19:38 +01:00
MarcoFalke
0f921e6a04
Merge #9406: Re-enable a blank v1 Tx JSON test
b371732 Re-enable a blank v1 Tx JSON test (Douglas Roark)
2016-12-23 12:07:16 +01:00
Pieter Wuille
ba3cecf5c4 Share unused mempool memory with coincache
If the mempool is not completely full, treat the difference between
the maximum size and the actual usage as available for the coin cache.

This also changes the early flush trigger from (usage > 0.9 * space)
to (usage > 0.9 * space && usage > space - 100MB). This means we're not
permanently leaving 10% of the space unused when the space is large.
2016-12-22 15:04:05 -08:00
accraze
3f67972654 updated listsinceblock rpc docs
fixes #8758
2016-12-22 09:28:03 -08:00
Anditto Heristyo
afe5b3f553 Added missing colons in when running help command 2016-12-22 13:26:03 +09:00
Pieter Wuille
2ddfcfd2d6 Make CScript (and prevector) c++11 movable.
Such moves are used when reallocating vectors that contain them,
for example.
2016-12-21 18:28:33 -08:00
Pieter Wuille
91335ba389 Remove unused MakeTransactionRef overloads 2016-12-21 18:18:28 -08:00
Pieter Wuille
6713f0f142 Make FillBlock consume txn_available to avoid shared_ptr copies 2016-12-21 18:18:28 -08:00
Pieter Wuille
62607d796c Convert COrphanTx to keep a CTransactionRef 2016-12-21 18:18:28 -08:00