Commit graph

10577 commits

Author SHA1 Message Date
Karl-Johan Alm b167951677
[rpc] Allow getrawtransaction to take optional blockhash to fetch transaction from a block directly. 2017-12-05 11:03:24 +09:00
Karl-Johan Alm a5f5a2ce53
[rpc] Fix fVerbose parsing (remove excess if cases). 2017-11-29 17:52:13 +09:00
Wladimir J. van der Laan 26efc220a1
Merge #11722: Switched sync.{cpp,h} to std threading primitives.
f7f7e2c threads: add a thread_local autoconf check (Cory Fields)
bba9bd0 Switched sync.{cpp,h} to std threading primitives. (Thomas Snider)

Pull request description:

  Replaced boost threading primitives with the std equivalents.

Tree-SHA512: 72d10f9e48bfcf1db87e4a88bc698ef98eba0b29fe904570391b34a6ea1ffad474b7f192e70e3588a30e448f70f244eb4ddc5f24412a0bde2b564e76274160a5
2017-11-28 08:39:41 +01:00
Cory Fields f7f7e2cd34 threads: add a thread_local autoconf check 2017-11-27 15:01:47 -08:00
Wladimir J. van der Laan a933cb14c7
Merge #11603: Move RPC registration out of AppInitParameterInteraction
abbd230 Move RPC registration out of AppInitParameterInteraction (Russell Yanofsky)

Pull request description:

  Move to AppInitServers. This doesn't have any effects on bitcoin behavior. It was just strange to have this unrelated code in the middle of parameter interaction.

Tree-SHA512: 373e18f2ef8d21999ad36295d69326128a3086044acfc8ed537abd5497c8d3620b9832f7f6aa87c0c0939bb5e0d92be8a3c006b5997e9e6fa20334f5610c89bc
2017-11-23 22:10:30 +01:00
practicalswift d2ea2bcb5c trivial: Fix unsuccessful typo 2017-11-21 19:14:35 +01:00
Wladimir J. van der Laan d4267a3ab2
Merge #11738: Fix sendrawtransaction hang when sending a tx already in mempool
d9340ce Fix sendrawtransaction hang when sending a tx already in mempool (Matt Corallo)

Pull request description:

  I assume this is what #11721 actually hit.

Tree-SHA512: 1da4088bbda64c5527233de9ec4d03f9e0c1eacddb2ed3deab3cb99eac0293ee6fb846830f97b5e10e230307b6d7fd18013043173aa4f27ef171d9da626e2c88
2017-11-21 08:51:19 +01:00
MarcoFalke 901ba3e381
Merge #11714: [tests] Test that mempool rejects coinbase transactions
65e91f5ed [tests] Test that mempool rejects coinbase transactions (James O'Beirne)

Pull request description:

  ![selection_063](https://user-images.githubusercontent.com/73197/32978622-b0fa9d70-cbfa-11e7-9a72-1997409e5ba8.png)

  Neither the unit nor functional tests appear to cover rejecting a transaction from acceptance to the mempool on the basis of it being a coinbase. Seems like a decent thing to have a test for.

Tree-SHA512: 53af53c975cad5d7a21c443d71a1c0ced5c70a7799b75bb44d9b7dd6ab2afbcdcaab14571540efeb848f3a1daee5e1dd856530d8f2b50582595219a1c17555ff
2017-11-20 15:19:24 -05:00
Matt Corallo d9340ce912 Fix sendrawtransaction hang when sending a tx already in mempool 2017-11-20 12:18:52 -08:00
Wladimir J. van der Laan 7293d06413
Merge #11698: [Docs] [Qt] RPC-Console nested commands documentation
c3055bb Add help-console command to Qt debug console (Luke Mlsna)

Pull request description:

  This PR would close issue #9195 by adding documentation for the debug console features (mainly nested commands) which were added in [PR #7783](https://github.com/bitcoin/bitcoin/pull/7783).

  The following changes were made to QT debug console code:
  - Added a line to the initial message text at the top of the debug console:

  > For more information on using this console type **help-console**.

  - Added a pseudo-command `help-console` which is hooked after parsing the request, but before actually executing the RPC thread. It prints the following text to the console as if it were a valid RPC response.

  > This console accepts RPC commands using the standard syntax.
  >    example:    getblockhash 8
  > This console can also accept RPC commands using bracketed syntax.
  >    example:    getblockhash(8)
  > A space or a comma can be used to separate arguments for either syntax.
  >    example:    sendtoaddress \<address\> \<amount\>
  >                    sendtoaddress,\<address\>,\<amount\>
  > Commands may be nested when specified with the bracketed syntax.
  >    example:    getblockinfo(getblockhash(0),true).
  > Result values can be queried with a non-quoted string in brackets.
  >    example:    getblock(getblockhash(0) true)[height]

  This seemed like a reasonably sane way to introduce a fake RPC help command, but

Tree-SHA512: 35d73dcef9c4936b8be99e80978169f117c22b94f4400c91097bf7e0e1489060202dcd738d9debdf4c8a7bd10709e2c19d4f625f19e47c4a034f1d6019c0e0f2
2017-11-19 13:04:43 +01:00
Wladimir J. van der Laan 9cdd2bcf67
Merge #11718: tests: move pwalletMain to wallet test fixture
49bd659 tests: move pwalletMain to wallet test fixture (Wladimir J. van der Laan)

Pull request description:

  Scope the variable instead of using an external global; this is how test fixtures are intended to be used.

  Followup to #11713.

Tree-SHA512: 7d5bda93cdfe1329c8fe39bd72965906e36dad72fbb5d344ebedf26e66b1857510d01a3c2872d7f718fdeb23365e6ba71991aafe68e82781c6767a086b6d1590
2017-11-19 11:21:51 +01:00
Thomas Snider bba9bd0d9d Switched sync.{cpp,h} to std threading primitives. 2017-11-18 11:35:14 -08:00
Wladimir J. van der Laan d080a7d503
Merge #11466: Specify custom wallet directory with -walletdir param
c1e5d40 Make debugging test crash easier (MeshCollider)
8263f6a Create walletdir if datadir doesn't exist and fix tests (MeshCollider)
9587a9c Default walletdir is wallets/ if it exists (MeshCollider)
d987889 Add release notes for -walletdir and wallets/ dir (MeshCollider)
80c5cbc Add test for -walletdir (MeshCollider)
0530ba0 Add -walletdir parameter to specify custom wallet dir (MeshCollider)

Pull request description:

  Closes #11348

  Adds a `-walletdir` parameter which specifies a directory to use for wallets, allowing them to be stored separately from the 'main' data directory. Creates a new `wallets/` directory in datadir if this is the first time running, and defaults to using it if it exists.

  Includes tests and release notes. Things which might need to be considered more:
  - there is no 'lock' on the wallets directory, which might be needed?
  - because this uses a new wallets/ directory by default, downgrading to an earlier version won't see the wallets in that directory (not a big deal though, users can just copy them up to the main dir)
  - jnewbery suggested putting each wallet in its own directory, which is a good idea, but out of scope for this PR IMO. EDIT: this is being done in https://github.com/bitcoin/bitcoin/pull/11687
  - doc/files.md needs updating (will do soon)

  I also considered including  a cleanup by removing caching of data directory paths and instead just initialise them once on startup (c.f. #3073), but decided it wasn't super relevant here will just complicate review.

Tree-SHA512: c8ac04bfe9a810c32055f2c8b8fa0d535e56125ceb8d96f12447dd3538bf3e5ee992b60b1cd2173bf5f3fa023a9feab12c9963593bf27ed419df929bb413398d
2017-11-18 14:41:15 +01:00
Wladimir J. van der Laan 49bd6590fe tests: move pwalletMain to wallet test fixture
Scope the variable instead of using an external global; this is how test
fixtures are intended to be used.

Followup to #11713.
2017-11-18 14:16:38 +01:00
Wladimir J. van der Laan 49667a77e7
Merge #11713: Fix for mismatched extern definition in wallet tests
f94c2ec Fix for mismatched extern definition in wallet test classes which was breaking msvc linking. (Aaron Clauson)

Pull request description:

  The extern declarations are using a raw pointer which doesn't match the source variable's std::unqiue_ptr.

Tree-SHA512: 1500ffa1282ee6565741bf2f8f9def68a355346c8e4a667e1167d3d550eb0b732e8cba52fbef380a92c860e686d36da877d800ee5f2fc1e4dd8fd88fbe170644
2017-11-18 14:03:12 +01:00
Wladimir J. van der Laan 938863965f
Merge #11710: cli: Reject arguments to -getinfo
dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan)

Pull request description:

  Currently it's possible to accidentally type e.g.

      bitcoin-cli -getinfo getbalance

  and get an answer which can be confusing; the trailing arguments are just ignored.

  To avoid this, throw an error if the user provides arguments to
  `-getinfo`.

Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4
2017-11-18 12:05:31 +01:00
James O'Beirne 65e91f5edf [tests] Test that mempool rejects coinbase transactions 2017-11-18 00:48:34 -08:00
Aaron Clauson f94c2ecb48 Fix for mismatched extern definition in wallet test classes which was breaking msvc linking. 2017-11-18 18:55:45 +11:00
Luke Mlsna c3055bbea1
Add help-console command to Qt debug console
- Added `help-console` to the list of autocompletion strings
     - Implemented requested changes to help message:
       - Added an example that uses access-by-index `getblock(getblockhash(0) true)[tx][0]`
       - Replace "bracketed syntax" to "parenthesized syntax" where applicable
       - Replace "separate" with "delimit"
       - Removed `<br>` and `<b>help/help-console</b>` from translation strings, since these parts don't change between languages
       - Changed examples to be based off `getblock 0` so they will work even with pruned/no blockchain and `disablewallet` if copied and pasted
       - Clarified syntax for queries of named/unnamed result objects.
2017-11-17 23:28:11 -06:00
Wladimir J. van der Laan 142913296f
Merge #11140: Trivial: Improve #endif comments
ac1cf8d Trivial: Improve #endif comments (danra)

Pull request description:

  Improve the #endif comments for the '#if HAVE_DECL_BSWAP_XX == 0' preprocessor conditions, so each shows the full condition which it closes.

Tree-SHA512: f533311fa48cb2f46f6490b6c965ad5f8861dcfad70c56d70e31fa989b422880c78b2dd6f24f648b19d3a22f767606e0de5cf1cb71445012b42c97ac2149295e
2017-11-17 15:34:51 +01:00
Wladimir J. van der Laan dcfef277b4 cli: Reject arguments to -getinfo
Currently it's possible to accidentally type e.g.

    bitcoin-cli -getinfo getbalance

and get an answer which can be confusing; the trialing arguments are
just ignored.

To avoid this, throw an error if the user provides arguments to
`-getinfo`.
2017-11-17 15:11:50 +01:00
Wladimir J. van der Laan 1f7695b419
Merge #11621: [build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck
a7c949f [build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck (fanquake)

Pull request description:

  Fixes #11302

  Tested on OS X 10.12.6 with 0e707919f5

  Was failing like:
  ```
  make distclean
  ....
  rm -f config.status config.cache config.log configure.lineno config.status.lineno
  rm -f Makefile
  ERROR: files left in build directory after distclean:
  ./src/qt/temp_bitcoin_locale.qrc
  make[1]: *** [distcleancheck] Error 1
  make: *** [distcheck] Error 1
  ```

Tree-SHA512: 291c786f20a82e648fdee2bcbc654d93d9abeb7d996ae7706d304697d4952709a0ec5d3aa88d1214f22cfe81ced88f10c187929904eecd60f2165b696727dd88
2017-11-17 14:04:02 +01:00
Wladimir J. van der Laan f6f8d54aff
Merge #10920: [qt] Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet)
446e261 [qt] Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet) (practicalswift)

Pull request description:

  Fix potential memory leak in `newPossibleKey(ChangeCWallet *wallet)`.

Tree-SHA512: 252d3828133a0d241cc649aed1280e14a5d5ea47b7b2989039cfa5061a8e35183c7f36d7320aa0ac1b4dcab31e584b358dbbb2fe645a412371d0a460878e2b58
2017-11-17 13:07:37 +01:00
MeshCollider 8263f6a5ac Create walletdir if datadir doesn't exist and fix tests 2017-11-18 00:50:59 +13:00
MeshCollider 9587a9c12b Default walletdir is wallets/ if it exists 2017-11-18 00:50:59 +13:00
MeshCollider 0530ba0eae Add -walletdir parameter to specify custom wallet dir 2017-11-18 00:50:58 +13:00
Wladimir J. van der Laan 99bc0b428b
Merge #11087: Diagnose unsuitable outputs in lockunspent().
28f8b66 Diagnose unsuitable outputs in lockunspent(). (Eelis)

Pull request description:

  Fixes #2667.

  This is a simplified version of pull request #3574, which was abandoned by its author.

  I added some tests as well.

Tree-SHA512: e63e00dec8b1b232079380183805cb0b0b18c78ea6bea769837949aab984689d7f68b2ccfe66b1873517b040b9e616ce0eb058575c3d4382aa8c26eebcf1f14e
2017-11-16 12:24:05 +01:00
Wladimir J. van der Laan 084f52f38d
Merge #11654: tests: Initialize recently introduced non-static class member lastCycles to zero in constructor
069215e Initialize recently introduced non-static class member lastCycles to zero in constructor (practicalswift)

Pull request description:

  Initialize recently introduced non-static class member `lastCycles` to zero in constructor.

  `lastCycles` was introduced in 3532818746 which was merged into master yesterday.

  Friendly ping  @laanwj :-)

Tree-SHA512: cb93b6a8f6e2e3b06cd05a635da95c84f3df64c21fc23fe82f98306ea571badc32040315b563e46ddb5203128226bc334269acd497beead5a5777c434060fd85
2017-11-16 11:49:42 +01:00
MeshCollider 7b91b5f8a4 Remove trailing whitespace causing travis failure 2017-11-16 08:23:03 +13:00
Wladimir J. van der Laan 96b92810a6 refactor: Include obj/build.h instead of build.h 2017-11-16 08:23:03 +13:00
Wladimir J. van der Laan 138016bf92 test: refactor: Use absolute include paths for test data files 2017-11-16 08:23:02 +13:00
Wladimir J. van der Laan e7b31631c7 qt: refactor: Changes to make include paths absolute
This makes all include paths in the GUI absolute.

Many changes are involved as every single source file in
src/qt/ assumes to be able to use relative includes.
2017-11-16 08:23:02 +13:00
Wladimir J. van der Laan 0c715214dd build: Remove -I for everything but project root
Remove -I from build system for everything but the project root,
and built-in dependencies.
2017-11-16 08:23:02 +13:00
Wladimir J. van der Laan 5b56ec969f qt: refactor: Use absolute include paths in .ui files 2017-11-16 08:23:02 +13:00
MeshCollider 1a445343f6 scripted-diff: Replace #include "" with #include <> (ryanofsky)
-BEGIN VERIFY SCRIPT-
for f in \
  src/*.cpp \
  src/*.h \
  src/bench/*.cpp \
  src/bench/*.h \
  src/compat/*.cpp \
  src/compat/*.h \
  src/consensus/*.cpp \
  src/consensus/*.h \
  src/crypto/*.cpp \
  src/crypto/*.h \
  src/crypto/ctaes/*.h \
  src/policy/*.cpp \
  src/policy/*.h \
  src/primitives/*.cpp \
  src/primitives/*.h \
  src/qt/*.cpp \
  src/qt/*.h \
  src/qt/test/*.cpp \
  src/qt/test/*.h \
  src/rpc/*.cpp \
  src/rpc/*.h \
  src/script/*.cpp \
  src/script/*.h \
  src/support/*.cpp \
  src/support/*.h \
  src/support/allocators/*.h \
  src/test/*.cpp \
  src/test/*.h \
  src/wallet/*.cpp \
  src/wallet/*.h \
  src/wallet/test/*.cpp \
  src/wallet/test/*.h \
  src/zmq/*.cpp \
  src/zmq/*.h
do
  base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
done
-END VERIFY SCRIPT-
2017-11-16 08:23:01 +13:00
MarcoFalke 4ed818060e
Merge #10600: Make feebumper class stateless
aed1d90ac [wallet] Change feebumper from class to functions (Russell Yanofsky)
37bdcca3c [refactor] Make feebumper namespace (Russell Yanofsky)
7c4f00919 [trivial] Rename feebumper variables according to project code style (Russell Yanofsky)

Pull request description:

  Make feebumper methods static and remove stored state in the class.

  Having the results of feebumper calls persist in an object makes process
  separation between Qt and wallet awkward, because it means the feebumper object
  either has to be serialized back and forth between Qt and wallet processes
  between fee bump calls, or that the feebumper object needs to stay alive in the
  wallet process with an object reference passed back to Qt. It's simpler just to
  have fee bumper calls return their results immediately instead of storing them
  in an object with an extended lifetime.

  In addition to making feebumper methods static, also:

  - Move LOCK calls from Qt code to feebumper
  - Move TransactionCanBeBumped implementation from Qt code to feebumper
  - Rename CFeeBumper class to FeeBumper (every CFeeBumper reference had to be
    updated in this PR anyway so this doesn't increase the size of the diff)

  This change was originally part of https://github.com/bitcoin/bitcoin/pull/10244

Tree-SHA512: bf75e0c741b4e9c8912e66cc1dedf0ff715f77ea65fc33f7020d97d9099b0f6448f5852236dac63eea649de7d6fc03b0b21492e2c5140fb7560a39cf085506fd
2017-11-15 12:50:17 -05:00
Wladimir J. van der Laan 927a1d7d08
Merge #10286: Call wallet notify callbacks in scheduler thread (without cs_main)
89f0312 Remove redundant pwallet nullptr check (Matt Corallo)
c4784b5 Add a dev notes document describing the new wallet RPC blocking (Matt Corallo)
3ea8b75 Give ZMQ consistent order with UpdatedBlockTip on scheduler thread (Matt Corallo)
cb06edf Fix wallet RPC race by waiting for callbacks in sendrawtransaction (Matt Corallo)
e545ded Also call other wallet notify callbacks in scheduler thread (Matt Corallo)
17220d6 Use callbacks to cache whether wallet transactions are in mempool (Matt Corallo)
5d67a78 Add calls to CWallet::BlockUntilSyncedToCurrentChain() in RPCs (Matt Corallo)
5ee3172 Add CWallet::BlockUntilSyncedToCurrentChain() (Matt Corallo)
0b2f42d Add CallFunctionInQueue to wait on validation interface queue drain (Matt Corallo)
2b4b345 Add ability to assert a lock is not held in DEBUG_LOCKORDER (Matt Corallo)
0343676 Call TransactionRemovedFromMempool in the CScheduler thread (Matt Corallo)
a7d3936 Add a CValidationInterface::TransactionRemovedFromMempool (Matt Corallo)

Pull request description:

  Based on #10179, this effectively reverts #9583, regaining most of the original speedups of #7946.

  This concludes the work of #9725, #10178, and #10179.

  See individual commit messages for more information.

Tree-SHA512: eead4809b0a75d1fb33b0765174ff52c972e45040635e38cf3686cef310859c1e6b3c00e7186cbd17374c6ae547bfbd6c1718fe36f26c76ba8a8b052d6ed7bc9
2017-11-15 16:25:40 +01:00
Wladimir J. van der Laan aca77a4d58
Merge #11655: net: Assert state.m_chain_sync.m_work_header in ConsiderEviction
63c2d83 Explicitly state assumption that state.m_chain_sync.m_work_header != nullptr in ConsiderEviction (practicalswift)

Pull request description:

  Explicitly state assumption that `state.m_chain_sync.m_work_header != nullptr` in `ConsiderEviction(…)`.

  Static analyzer (and humans!) will see the null-check in ...

  ```
  else if (state.m_chain_sync.m_timeout == 0 || (state.m_chain_sync.m_work_header != nullptr && ...
  ```

  ... and infer that `state.m_chain_sync.m_work_header` might be set to `nullptr` when reaching `else if (state.m_chain_sync.m_timeout > 0 && time_in_seconds > state.m_chain_sync.m_timeout)` and thus flag `state.m_chain_sync.m_work_header->GetBlockHash().ToString()` as a potential null pointer dereference.

  This commit makes the tacit assumption of `state.m_chain_sync.m_work_header != nullptr` explicit.

  Code introduced in 5a6d00c6de ("Permit disconnection of outbound peers on bad/slow chains") which was merged into master four days ago.

  Friendly ping @sdaftuar :-)

Tree-SHA512: 32e5631025b7ba7556a02c89d040fbe339c482a03f28d0dbc9871c699e1f8ac867619b89c5fd41fdcfcf0dc4d7c859295b26ccd988572145cc244261aec18ce9
2017-11-15 13:55:40 +01:00
fanquake a7c949f644
[build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck 2017-11-15 08:00:53 +08:00
practicalswift 069215ebe2 Initialize recently introduced non-static class member lastCycles to zero in constructor
lastCycles was introduced in 3532818746 which was merged into master yesterday.

Also initialize beginCycles to zero for consistency and completeness.
2017-11-13 22:37:13 +01:00
MarcoFalke 2adbddb038
Merge #10749: Use compile-time constants instead of unnamed enumerations (remove "enum hack")
1e65f0f33 Use compile-time constants instead of unnamed enumerations (remove "enum hack") (practicalswift)

Pull request description:

  Use compile-time constants instead of unnamed enumerations (remove "enum hack").

Tree-SHA512: 1b6ebb2755398c5ebab6cce125b1dfc39cbd1504d98d55136b32703fe935c4070360ab3b2f52b1da48ba9f3b01082d204f3d87c92ccb5c8c333731f7f972e128
2017-11-11 18:07:28 -05:00
MarcoFalke 13e352dc53
Merge #3716: GUI: Receive: Remove option to reuse a previous address
927f4ff5a GUI: Receive: Remove option to reuse a previous address (Luke Dashjr)

Pull request description:

  This was justified by the need to "resent" an invoice, but now that we have the request history, that need should be gone.

Tree-SHA512: 4ade4eb84a21bbbd8dcc3a2c9580d416e113284b5bdf350c22051c233101fe0ee31659c54a7a46e7136f9c999acb61efbbb3f97aeb2fa7b2b1e1daec02ca0837
2017-11-11 13:29:52 -05:00
MarcoFalke 95e14dc81d
Merge #11055: [wallet] [rpc] getreceivedbyaddress should return error if called with address not owned by the wallet
5e0ba8f8c [wallet] getreceivedbyaddress should return error if address is not mine (John Newbery)
ea0cd24f7 [tests] Tidy up receivedby.py (John Newbery)

Pull request description:

  Two commits:

  - First commit tidies up the `receivedby.py` test (and speeds it up by factor of two)
  - Second commit changes getreceivedbyaddress to return error if the address is not found in wallet, and adds test to `receivedby.py`

Tree-SHA512: e41342dcbd037a6b440cbe4ecd3b8ed589e18e477333f0d866f3564e948e0f5231e497d5ffb66da4e6680eb772d9f0cf839125098bb68b92d04a5ee35c6c0a81
2017-11-11 12:35:44 -05:00
Luke Dashjr 927f4ff5a2 GUI: Receive: Remove option to reuse a previous address
This was justified by the need to "resent" an invoice, but now that we have the request history, that need should be gone.
2017-11-11 07:51:08 +00:00
Pieter Wuille 033c78671b
Merge #11258: [rpc] Add initialblockdownload to getblockchaininfo
11413646b [trivial] (whitespace only) fix getblockchaininfo alignment (John Newbery)
bd9c18171 [rpc] Add initialblockdownload to getblockchaininfo (John Newbery)

Pull request description:

  Exposing whether the node is in IBD would help for testing, and may be useful in general, particularly for developers.

  First discussed in #10357 here: https://github.com/bitcoin/bitcoin/pull/10357#pullrequestreview-59963870

  > ... we could simplify this (and possibly other) tests by just adding a way to know if a node is in IBD. I'd like to do that, but I'm not sure it makes sense to complicate this PR with discussion over how that information should be made available. Eg it's not clear to me that the notion of being in IBD is worth exposing to the casual user, versus a hidden rpc call or something, since the definition has changed over time, and may continue to change in the future. But I still do agree that at least for testing purposes it would be far simpler to expose the field somehow...

   This PR currently implements the simplest way of doing this: adding an `initialblockdownload` field to `getblockchaininfo`. Other approaches we could take:

  1. add a new debug RPC method that exposes `IBD` and potentially other information.
  2. add a parameter to `getblockchaininfo`, eg `debug_info`, which would cause it to return debug information including IBD
  3. add a query string to the url `?debug=true` which would cause RPCs to return additional debug information.

  I quite like the idea of (3). Feedback on these and other approaches very much welcomed!

  @sdaftuar @laanwj

Tree-SHA512: a6dedd47f8c9bd38769cc597524466250041136feb33500644b9c48d0ffe4e3eeeb2587b5bbc6420364ebdd2667df807fbb50416f9a7913bbf11a14ea86dc0d4
2017-11-10 16:12:22 -08:00
Russell Yanofsky aed1d90aca [wallet] Change feebumper from class to functions
Change feebumper from a stateful class into a namespace of stateless
functions.

Having the results of feebumper calls persist in an object makes process
separation between Qt and wallet awkward, because it means the feebumper object
either has to be serialized back and forth between Qt and wallet processes
between fee bump calls, or that the feebumper object needs to stay alive in the
wallet process with an object reference passed back to Qt. It's simpler just to
have fee bumper calls return their results immediately instead of storing them
in an object with an extended lifetime.

In addition to making feebumper stateless, also:

- Move LOCK calls from Qt code to feebumper
- Move TransactionCanBeBumped implementation from Qt code to feebumper
2017-11-10 17:16:46 -05:00
Russell Yanofsky 37bdcca3c3 [refactor] Make feebumper namespace
Future commit will remove the FeeBumper class. This commit simply places
everything into a feebumper namespace, and changes the enum class name
from BumpeFeeResult to feebumper::Result.
2017-11-10 17:03:15 -05:00
Russell Yanofsky 7c4f009195 [trivial] Rename feebumper variables according to project code style
Future PRs will completely refactor this translation unit and touch all
this code so we rename the variables to follow project stlye guidelines
in this preparation commit.

Don't use m_ prefixes for member variables since we're going to remove
the class entirely in the next commits.
2017-11-10 17:01:41 -05:00
John Newbery 5e0ba8f8cd [wallet] getreceivedbyaddress should return error if address is not mine 2017-11-10 16:07:37 -05:00
MarcoFalke 61fb80660f
Merge #11269: [Mempool] CTxMemPoolEntry::UpdateAncestorState: modifySiagOps param type
203a4aa31 Fix CTxMemPoolEntry::UpdateAncestorState: modifySigOps param type int -> int64_t (donaloconnor)

Pull request description:

  CTxMemPoolEntry::CTxMemPoolEntry's modifySigOps parameter is int while update_ancestor_state::modifySigOpsCost is int64_t. This issue was raised in #11165. It looks like the function paramaters were not changed in commit 72abd2c

  This will avoid unexpected truncation of int64_t -> int

Tree-SHA512: 314c703f217e104336456859066d18fb0d12c4f9f32835e17490a6f29eb05951184095039e4e57edacef8ad35dd75c6d97d9af656a52209dd0c3779b4ffa0914
2017-11-10 15:33:30 -05:00