Commit graph

11318 commits

Author SHA1 Message Date
Pieter Wuille 5df84de583
Merge #12970: logging: bypass timestamp formatting when not logging
339730a6d8 logging: bypass timestamp formatting when not logging (Cory Fields)

Pull request description:

  As suggested by @laanwj on IRC:
  ```
  <cfields> whoa
  <cfields> Leaving test case "knapsack_solver_test"; testing time: 358694ms
  <cfields> i386 + old wine ^^
  <cfields> Leaving test case "knapsack_solver_test"; testing time: 6781ms
  <cfields> ^^ same, but with the LogPrint commented out
  ...
  <wumpus> if both log-to-file and log-to-console is disabled, it should probably bypass all logging
  ```
  Edit: The painful line commented out being the LogPrintf in CWallet::AddToWallet.

Tree-SHA512: bc6da67dcdf05e9164fff7a7e9980de897e6f1b0d3f6e1ebde2162cbcba7d54a6ec94283534eb5a1ebde7134533d7fe7e496aa35ea3128c567ed6483eae5212c
2018-04-12 18:35:26 -07:00
Pieter Wuille 4ba6da5574
Merge #12743: Fix csBestBlock/cvBlockChange waiting in rpc/mining
4a6c0e3dcf Modernize best block mutex/cv/hash variable naming (Pieter Wuille)
45dd135039 Fix csBestBlock/cvBlockChange waiting in rpc/mining (Pieter Wuille)

Pull request description:

  This is an alternative to #11694.

  It reintroduces a uint256 variable with the best block hash, protected by csBestBlock, and only updated while holding it.

  Also rename the involved variable to modern guidelines, as there are very few uses.

Tree-SHA512: 826a86c7d3cee7fe49f99f4398ae99e81cb0563197eaeba77306a3ca6072b67cdb932bc35720fc0f99c2a57b218efa029d0b8bdfb240591a629b2e90efa3199d
2018-04-12 18:25:44 -07:00
Cory Fields 339730a6d8 logging: bypass timestamp formatting when not logging
This leads to massive speedups under Wine.
2018-04-12 18:33:30 -04:00
Wladimir J. van der Laan 8480d41e0f
Merge #12803: Make BaseSignatureCreator a pure interface
be67831 Make DummySignatureCreator a singleton (Pieter Wuille)
190b8d2 Make BaseSignatureCreator a pure interface (Pieter Wuille)

Pull request description:

  * Removes the `m_provider` field from `BaseSignatureCreator`. Instead both a `SigningProvider` (which provides keys and scripts) and a `BaseSignatureCreator` (which implements the transaction-specific (or other) signing logic) are passed into and down in `ProduceSignature`, making the two concepts orthogonal.
  * Makes `BaseSignatureCreator` a pure interface without constructor, making it easier to implement new derivations of it (for example for message signing).
  * As `DummySignatureCreator` now becomes a stateless object, turn it into a singleton `DUMMY_SIGNATURE_CREATOR`.

Tree-SHA512: 5f1f4512e4ea7d02a31df7b9ede55008efa716c5b74a2630ca1c2fc6599584d8bf5f5641487266127f4b3788033803539fbd22b03ef1219c83c10da2d3da3dcd
2018-04-12 22:55:56 +02:00
Wladimir J. van der Laan 39439e5ab4
Merge #12888: debug log number of unknown wallet records on load
72ec5b7 debug log number of unknown wallet records on load (Gregory Sanders)

Pull request description:

  This would have saved me some time during wallet debugging, with minimal logging clutter.

Tree-SHA512: e11a4d73a5b1d2bd73fe7b75b62fdfa127e21b8641c5b0c76f14ecd292ab374c0d4749f6bd99919b2b3e9cb00c3b5e8179386eb39ac656698306b3b545ee79f1
2018-04-12 09:17:45 +02:00
Wladimir J. van der Laan e561cf4fa8
Merge #12939: Extract consts for WITNESS_V0 hash sizes
3450a9b Extract consts for WITNESS_V0 hash sizes (Ben Woosley)

Pull request description:

Tree-SHA512: 57ba84dfa36aa61cabffce747388143cf1c8724dd2fc42aecf93748158b75dbe278b21a32483a100b8c303f6ad01d048da03b0a5c172175febbe70938ed4339d
2018-04-12 08:36:26 +02:00
MarcoFalke 7c06171b3d
Merge #12837: rpc: fix type mistmatch in listreceivedbyaddress
05c03d1249 rpc: fix type mistmatch in listreceivedbyaddress (joemphilips)

Pull request description:

  `txids` filed in return value is supposed be `string` but it was `numeric` in the help message

Tree-SHA512: 7d860994c2d1d9149b41fd7afefc1a44460eede5a023070fcc18b0a4a19a26c5eec5abd157038c15fe7d50a3390bdaf7a4823279129eb1458b0d3c6141a533ee
2018-04-11 15:32:55 -04:00
Gregory Sanders 72ec5b7766 debug log number of unknown wallet records on load 2018-04-11 11:46:14 -04:00
Wladimir J. van der Laan 6d3de17a22
Merge #12925: wallet: Logprint the start of a rescan
cab0824 Logprint the start of a rescan (Jonas Schnelli)

Pull request description:

  Right now, there is no log entry when a rescan starts which is confusing especially when a "still rescanning" log entry appears after the log-update timeout of 60s or when user manually aborts the rescan.

  This PR adds a log entry when a rescan starts.

Tree-SHA512: 8712605af6fd60950bf3904cfb586da6022e44b3da6f3155fe4f02aae16df6044bc504b3d48945ea6d7fe768f0c6cb3282a2e2251d14bf3b7f1dcbd12568b05e
2018-04-11 16:21:10 +02:00
Wladimir J. van der Laan fefb817009
Merge #12942: rpc: Drop redundant testing of signrawtransaction prevtxs args
459ea58 rpc: Drop redundant testing of signrawtransaction prevtxs args (Ben Woosley)

Pull request description:

  These other types are already tested on line 736.

Tree-SHA512: 2efe777c8a63c69ffe0fafcb2f37f134d324a8bc9525510f1079d2215535b511d6308e5e6eec702a3444f87701236c5e7a22f10bb24e5a454010ef421e5ae900
2018-04-11 15:57:41 +02:00
Wladimir J. van der Laan 1b5723ee57
Merge #11617: Avoid lock: Call FlushStateToDisk(...) regardless of fCheckForPruning
0000d8f Document how FlushStateMode::NONE is handled (practicalswift)
2311c7c Call FlushStateToDisk(...) regardless of fCheckForPruning (practicalswift)

Pull request description:

  FlushStateToDisk(...) won't do anything besides check if we need to prune if
  FLUSH_STATE_NONE is given. We avoid reading the variable fCheckForPruning
  which is guarded by the mutex cs_LastBlockFile.

Tree-SHA512: 89df06256f73503a74b9e26d580ce9ed09efaef347fae1ff6a5759a2993b0db52edd2fadb65694d27e579a5aed92127753bdf41b5bb1bd516e577fcf17f17999
2018-04-11 15:29:21 +02:00
Wladimir J. van der Laan b1fdfc1a8c
Merge #12920: test: Fix sign for expected values
c55aa4f test: Fix sign for expected values (Karl-Johan Alm)

Pull request description:

  A number of `BOOST_CHECK_EQUAL` calls would result in warnings about signs.

  This PR fixes signedness for all expectation values, sometimes resulting in `int` → `unsigned int`. No other code changes besides adding/removing `U` to/from values.

  Running `make &> make_output_...` on master versus on this PR:
  ```
  $ wc make_output_*
      1464    5925   90357 make_output_master
       613    1469   28370 make_output_signfixed
  ```
  More than halves the output lines from compiling.

Tree-SHA512: b06c9fb81704fd32a6a61fe7b2ceb5f1bb381e9873d79e13d7e4d26bbd9b67c9725a84e6fb2903bcda775aea2a792e544b0799d36735c19f5d1c7225e8c6d14e
2018-04-11 15:01:34 +02:00
Wladimir J. van der Laan f15b72f482
Merge #12650: gui: Fix issue: "default port not shown correctly in settings dialog"
40c5886 Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251)

Pull request description:

  In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method:

  29fad97c32/src/qt/optionsmodel.cpp (L129)

  29fad97c32/src/qt/optionsmodel.cpp (L139)

  This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`.

  This PR attempts to resolve #12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug.

  The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value.

Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d
2018-04-11 14:44:24 +02:00
Wladimir J. van der Laan 7b6041d1a7
Merge #12916: Introduce BigEndian wrapper and use it for netaddress ports
ece88fd Introduce BigEndian wrapper and use it for netaddress ports (Pieter Wuille)

Pull request description:

  This is another small improvement taken from #10785.

  Instead of manually converting from/to BE format in the `CService` serializer, provide a generic way in serialize.h to serialize BE data (only 16 bits for now).

Tree-SHA512: bd67cf7eed465dad08551fb62f659e755e0691e4597a9f59d285d2b79975b50e5710d35a34a185b5ad232e1deda9a4946615f9132b1ed7d96ed8087f73ace66b
2018-04-11 14:23:58 +02:00
practicalswift 0000d8f727 Document how FlushStateMode::NONE is handled 2018-04-11 12:45:59 +02:00
practicalswift 2311c7cc86 Call FlushStateToDisk(...) regardless of fCheckForPruning
FlushStateToDisk(...) won't do anything besides check if we need to prune if
FLUSH_STATE_NONE is given. We avoid reading the variable fCheckForPruning
which is guarded by the mutex cs_LastBlockFile.
2018-04-11 12:40:08 +02:00
Ben Woosley 459ea5836e
rpc: Drop redundant testing of signrawtransaction prevtxs args
These other types are already tested on line 736.
2018-04-11 03:33:01 -07:00
Wladimir J. van der Laan 807d2ac186
Merge #12941: [Trivial] Ignore macOS daemon() depracation warning
12e7c55 Ignore macOS daemon() depracation warning (Jonas Schnelli)

Pull request description:

  `daemon()` is deprecated on OSX since 10.5 (should migrate to `posix_spawn()`). There are no signs `daemon()` will get removed by Apple.

Tree-SHA512: d5bcdc5d6b507576e0358906a73f9c766f2072f4a9aef6bdc559e10dbec95337ffa50a1ccb60f7197591e2e74f87c74c13387de880aaedc6dbf3796253f69561
2018-04-11 11:43:23 +02:00
Wladimir J. van der Laan 9b3370d1c6
Merge #12892: [wallet] [rpc] introduce 'label' API for wallet
41ba061 [docs] Add release notes for wallet 'label' API. (John Newbery)
189e0ef [wallet] [rpc] introduce 'label' API for wallet (Wladimir J. van der Laan)

Pull request description:

  Add label API to wallet RPC.

  This is one step towards #3816 ("Remove bolt-on account system") although it doesn't
  actually remove anything yet.

  These initially mirror the account functions, with the following differences:

  - These functions aren't DEPRECATED in the help
  - Help mentions 'label' instead of accounts. In the language used, labels are
    associated with addresses, instead of addresses associated with labels. (unlike
    with accounts.)
  - Labels have no balance
    - No balances in `listlabels`
    - `listlabels` has no minconf or watchonly argument
  - Like in the GUI, labels can be set on any address, not just receiving addreses
  - Unlike accounts, labels can be deleted.
    Being unable to delete them is a common annoyance (see #1231).
    Currently only by reassigning all addresses using `setlabel`, but an explicit
    call `deletelabel` which assigns all address to the default label may make
    sense.

Tree-SHA512: 45cc313c68ad529ce3a15c02181d2ab0083a7e14fe824e2cde34972713fecce512e3d4b9aa46db5355f2baa857c44b234d4fe9709225bc23c7ebbc0e03febbf5
2018-04-11 11:41:20 +02:00
Jonas Schnelli 12e7c558af
Ignore macOS daemon() depracation warning 2018-04-11 10:19:44 +02:00
Karl-Johan Alm c55aa4f27d
test: Fix sign for expected values
A number of BOOST_CHECK_EQUAL calls would result in warnings about signs.
2018-04-11 13:39:41 +09:00
Ben Woosley 3450a9b25c
Extract consts for WITNESS_V0 hash sizes 2018-04-10 20:13:32 -07:00
Wladimir J. van der Laan 189e0ef33e [wallet] [rpc] introduce 'label' API for wallet
Add label API to wallet RPC.

This is one step towards #3816 ("Remove bolt-on account system") although it doesn't
actually remove anything yet.

These initially mirror the account functions, with the following differences:

- These functions aren't DEPRECATED in the help
- Help mentions 'label' instead of accounts. In the language used, labels are
  associated with addresses, instead of addresses associated with labels. (unlike
  with accounts.)
- Labels have no balance
  - No balances in `listlabels`
  - `listlabels` has no minconf or watchonly argument
- Like in the GUI, labels can be set on any address, not just receiving addreses
- Unlike accounts, labels can be deleted.
  Being unable to delete them is a common annoyance (see #1231).
  Currently only by reassigning all addresses using `setlabel`, but an explicit
  call `deletelabel` which assigns all address to the default label may make
  sense.

Thanks to Pierre Rochard for test fixes.
2018-04-10 19:27:22 -04:00
251 40c58866c7 Fix illegal default addProxy and addrSeparateProxyTor settings. 2018-04-10 22:22:55 +02:00
Wladimir J. van der Laan 0a8054e7cd
Merge #12731: Support serialization as another type without casting
818dc74 Support serialization as another type without casting (Pieter Wuille)

Pull request description:

  This adds a `READWRITEAS(type, obj)` macro which serializes `obj` as if it were converted to `const type&` when `const`, and to `type&` when non-`const`. No actual cast is involved, so this only works when this conversion can be done automatically.

  This makes it usable in serialization code that uses a single implementation for both serialization and deserializing, which doesn't know the constness of the object involved.

  This is a redo of #12712, using a slightly different interface.

Tree-SHA512: 262f0257284ff99b5ffaec9b997c194e221522ba35c3ac8eaa9bb344449d7ea0a314de254dc77449fa7aaa600f8cd9a24da65aade8c1ec6aa80c6e9a7bba5ca7
2018-04-10 20:54:33 +02:00
Wladimir J. van der Laan a84b056d5f
Merge #12749: [wallet] feebumper: discard change outputs below discard rate
f526046 adapt bumpfee change discard test to be more strict and add note on p2sh discrep (Gregory Sanders)
5805d6f feebumper: discard change outputs below discard rate (Gregory Sanders)

Pull request description:

  The "discard rate" is the concept we use to ensure the wallet isnt creating not so useful just-above-relay dust.

  Outside of bumpfee previous to this PR, and manually creating such an output, the wallet will never make change outputs of that size, preferring to send them to fees instead.

  "Worst case" for the user is that users pay a slightly higher feerate than they were expecting, which is already a possibility with relay dust.

Tree-SHA512: dd69351810dc1709437602e7db1be46e4e905ccd8e16d03952de8b4c1fdbf9cb7e6c99968930896baf6b5c7cb005a03ec0506a2669d22e21e32982e60329606b
2018-04-10 19:35:51 +02:00
Pieter Wuille be67831210 Make DummySignatureCreator a singleton 2018-04-10 09:29:17 -07:00
Pieter Wuille 190b8d2dcf Make BaseSignatureCreator a pure interface 2018-04-10 09:29:17 -07:00
Wladimir J. van der Laan 9b9d717263 wallet: Remove redundant lambda function arg in handleTransactionChanged
Makes the build warning-clean again here:

    bitcoin/src/interfaces/wallet.cpp:425:18: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
                [fn, this](CWallet*, const uint256& txid, ChangeType status) { fn(txid, status); }));
                     ^
2018-04-10 15:23:37 +02:00
Wladimir J. van der Laan dd1ca9e0b3
Merge #12926: Run unit tests in parallel
7ef9cd8 Increase entropy in test temp directory name (Pieter Wuille)
f6dfb0f Reorder travis builds (Pieter Wuille)
156db42 tests: run tests in parallel (Cory Fields)
66f3255 tests: split up actual tests and helper files (Cory Fields)

Pull request description:

  This runs the unit tests (`src/test/test_bitcoin`) in 4 separate simultaneous processes, significantly speeding up some Travis runs (over 2x for win32).

  This uses an approach by @theuni that relies on `make` as the mechanism for distributing tests over processes (through `-j`). For every test .cpp file, we search for `BOOST_FIXTURE_TEST_SUITE` or `BOOST_AUTO_TEST_SUITE`, and then invoke the test binary for just that suite (using `-t`). The (verbose) output is stored in a temporary file, and only shown in the case of failure.

  Some makefile reshuffling is necessary to avoid trying to run tests from `src/test/test_bitcoin.cpp` for example, which contains framework/utility code but no real tests.

  Finally, order the Travis jobs from slow to fast (apart from the arm/doc job which goes first, for fast failure). This should help reducing the total wall clock time before opening a PR and finishing Travis, in case where not all jobs are started simultaneously.

  This is an alternative to #12831.

Tree-SHA512: 9f82eb4ade14ac859618da533c7d9df2aa9f5592a076dcc4939beeffd109eda33f7d5480d8f50c0d8b23bf3099759e9f3a2d4c78efb5b66b04569b39b354c185
2018-04-10 14:27:18 +02:00
Pieter Wuille 7ef9cd8491 Increase entropy in test temp directory name 2018-04-09 19:59:29 -04:00
Cory Fields 156db42c3f tests: run tests in parallel 2018-04-09 19:56:25 -04:00
Cory Fields 66f32551bd tests: split up actual tests and helper files 2018-04-09 19:55:49 -04:00
MarcoFalke 06ead15050
Merge #12927: Docs: fixed link, replaced QT with Qt
7039319db5 Docs: fixed link, replaced QT with Qt (Darko Janković)

Pull request description:

Tree-SHA512: 6c071189b4c030d03d3d09535333d2ed7115fba07ee2561591124c2063041966cc8012e4d8416c3dda155f2df5e15b8f772712cac35b4d266b50c48f4d74b6e4
2018-04-09 19:09:56 -04:00
Darko Janković 7039319db5
Docs: fixed link, replaced QT with Qt 2018-04-09 22:55:36 +02:00
Steve Lee 23abfb7b7f added logging line back that was accidentally removed with #10762 2018-04-09 12:21:25 -07:00
Wladimir J. van der Laan 0700b6f778
Merge #11851: scripted-diff: Rename wallet database classes
9b0f0c5 Add m_ prefix to WalletBatch::m_batch (Russell Yanofsky)
398c6f0 Update walletdb comment after renaming. (Russell Yanofsky)
ea23945 scripted-diff: Rename wallet database classes (Russell Yanofsky)

Pull request description:

  Scripted diff to rename some wallet classes. Motivated by discussion in https://github.com/bitcoin/bitcoin/pull/11687#discussion_r155354119

  | Current          | New                 |
  | ---------------- | ------------------- |
  | CDBEnv           | BerkeleyEnvironment |
  | CDB              | BerkeleyBatch       |
  | CWalletDBWrapper | WalletDatabase      |
  | CWalletDB        | WalletBatch         |

  Berkeley\* classes are intended to contain BDB specific code, while Wallet\* classes are intended to be more backend-agnostic.

  Also renamed associated variables:

  | Current             | New             |
  | ------------------- | --------------- |
  | dbw                 | database        |
  | pwalletdb           | batch           |
  | pwalletdbEncryption | encrypted_batch |

Tree-SHA512: 372f2e24b2deb59d4792b5ed578aaf0cce51b6db41c400bef5d0c2cd7833e62ae4d4afa0f6000268d52e15b20f737c5a55f1cecf7768556a782fd8cd6fe051d9
2018-04-09 19:29:54 +02:00
Jonas Schnelli cab0824c96
Logprint the start of a rescan 2018-04-09 18:49:09 +02:00
Wladimir J. van der Laan b86730a4d7 util: Remove designator initializer from ScheduleBatchPriority
Although no compiler appears to complain about it, these are
not valid for c++11.
(http://en.cppreference.com/w/cpp/language/aggregate_initialization says they're c++20)

The structure is defined as:

   struct sched_param {
       int sched_priority;
   };

So passing 0 for the first field has the same effect.
2018-04-09 17:02:19 +02:00
Wladimir J. van der Laan cff66e6a29 util: Pass pthread_self() to pthread_setschedparam instead of 0
Nowhere in the man page of `pthread_setschedparam` it is mentioned that
`0` is a valid value. The example uses `pthread_self()`, so should we.

(noticed by Anthony Towns)
2018-04-09 15:44:46 +02:00
MarcoFalke 603975b96a
Merge #12770: Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion
9142dfea81 Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion (practicalswift)

Pull request description:

  Use explicit casting in cuckoocache's `compute_hashes(...)` to clarify integer conversion.

  I discussed this code with the code's author @JeremyRubin who suggested patching it to avoid any confusion.

  At least one static analyzer incorrectly warns about a shift past bitwidth (UB) here, so this patch will help avoid confusion for human reviewers and static analyzers alike :-)

Tree-SHA512: 0419ee31b422d2ffedbd1a100688ec0ff5b0c1690d6d92592f638ca8db07a21a9650cb467923108c6f14a38d2bf07d6e6c85d2d1d4b7da53ffe6919f94f32655
2018-04-09 08:06:09 -04:00
MarcoFalke cd8e45b4e7
Merge #12007: [Doc] Clarify the meaning of fee delta not being a fee rate in prioritisetransaction RPC
c198dc00e1 [Doc] Clarify the meaning of fee delta not being a fee rate in prioritisetransaction RPC (Jan Čapek)

Pull request description:

  Hi,

  I have faced some confusion among our developers considering this being a fee rate. Would you consider including this tiny doc update?

  Best regards,

  Jan Capek

Tree-SHA512: cd0560540418e53c5c19ceab2d5aca229f4ef6b788b9543695742522e1c63a7f2cce2574b47fead098a106da2f77e297f0c728474565f6259b50d62369bbe7da
2018-04-09 08:04:10 -04:00
practicalswift 280023f31d Remove duplicate includes 2018-04-09 09:18:49 +02:00
Wladimir J. van der Laan 4781813b56
Merge #12537: [arith_uint256] Make it safe to use "self" in operators
b120f7b [test] Add tests for self usage in arith_uint256 (Karl-Johan Alm)
08b17de [arith_uint256] Do not destroy *this content if passed-in operator may reference it (Karl-Johan Alm)

Pull request description:

  Before this fix (see test commit), `v *= v` would result in `0` because `operator*=` set `*this` (`==b`) to `0` at the start. This patch changes the code to use `a` as temporary for `*this`~~, with drawback that `*this` is set to `a` at the end, an extra `=` operation in other words~~.

Tree-SHA512: 8028a99880c3198a39c4bcc5056169735ba960625d553e15c0317510a52940c875f7a1fefe14e1af7fcf10c07a246411994a328cb1507bf3eaf1b6e7425390dc
2018-04-09 05:57:19 +02:00
Pieter Wuille ece88fd269 Introduce BigEndian wrapper and use it for netaddress ports 2018-04-08 15:31:01 -07:00
MarcoFalke bd42b85e8b
Merge #12905: [rpcwallet] Clamp walletpassphrase value at 100M seconds
2b2b96cd45 Use std::bind instead of boost::bind to re-lock the wallet (Suhas Daftuar)
662d19ff72 [rpcwallet] Clamp walletpassphrase value at 100M seconds (Suhas Daftuar)

Pull request description:

  Larger values seem to trigger a bug on macos+libevent (resulting in the rpc server stopping).

Tree-SHA512: 890f3b641f6c586e2f8f629a9d23bca6ceb8b237b285561aad488cb7adf941a21177d3129d0c2b8293c0a673cd8e401957dbe2b6b3b7c8c4e991bb411d260102
2018-04-08 12:58:46 -04:00
Wladimir J. van der Laan 97785863e2
Merge #12886: Introduce Span type and use it instead of FLATDATA
9272d70 Support serializing Span<unsigned char> and use that instead of FLATDATA (Pieter Wuille)
833bc08 Add Slice: a (pointer, size) array view that acts like a container (Pieter Wuille)

Pull request description:

  Introduce a new data type `Span`, which is an encapsulated pointer + size (like C++20's `std::span` or LevelDB's `Slice`), and represents a view to a sequence of objects laid out continuously in memory.

  The immediate use case is replacing the remaining `FLATDATA` invocations. Instead of those, we support serializing/deserializing unsigned char `Span`s (treating them as arrays).

  A longer term goal for `Span`s is making the script execution operate on them rather than on `CScript` itself. This will allow separate storage mechanisms for scripts.

Tree-SHA512: 7b0da3c802e5df367f223275004d16b04262804c007b7c73fda927176f0a9c3b2ef3225fa842cb73500b0df73175ec1419f1f5239de2402e21dd9ae8e5d05233
2018-04-08 18:13:49 +02:00
Suhas Daftuar 2b2b96cd45 Use std::bind instead of boost::bind to re-lock the wallet
Change suggested by Marco Falke.
2018-04-08 10:44:40 -04:00
Suhas Daftuar 662d19ff72 [rpcwallet] Clamp walletpassphrase value at 100M seconds
Larger values seem to trigger a bug on macos+libevent (resulting in the
rpc server stopping).
2018-04-08 10:44:40 -04:00
Jonas Schnelli 25c56cdbe7
Merge #12878: [refactor] Config handling refactoring in preparation for network-specific sections
77a733a99 [tests] Add additional unit tests for -nofoo edge cases (Anthony Towns)
af173c2be [tests] Check GetChainName works with config entries (Anthony Towns)
fa27f1c23 [tests] Add unit tests for ReadConfigStream (Anthony Towns)
087c5d204 ReadConfigStream: assume the stream is good (Anthony Towns)
6d5815aad Separate out ReadConfigStream from ReadConfigFile (Anthony Towns)
834d30341 [tests] Add unit tests for GetChainName (Anthony Towns)
11b6b5b86 Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName (Anthony Towns)

Pull request description:

  This does a bit of refactoring of the configuration handling code in order to add additional tests to make adding support for [test]/[regtest] sections in the config file in #11862 easier. Should not cause any behaviour changes.

Tree-SHA512: 8d2ce1449fc180de03414e7e569d1a21ba1e9f6564e13d3faf3961f710adc725fa0d4ab49b89ebd2baa11ea36ac5018377f693a84037d386a8b8697c9d6db3e9
2018-04-08 16:24:30 +02:00