Commit graph

16540 commits

Author SHA1 Message Date
Evan Klitzke f7683cba7b
Track negated arguments in the argument paser.
This commit adds tracking for negated arguments. This change will be used in a
future commit that allows disabling the debug.log file using -nodebuglogfile.
2018-03-27 22:12:02 -07:00
Evan Klitzke 4f872b2450
Add additional tests for GetBoolArg()
This is meant to be an intermediate commit to prove that the next does not
introduce any changes in the semantics of boolean option parsing.
2018-03-27 22:11:11 -07:00
Wladimir J. van der Laan ac898b689c
Merge #12717: [REST] Handle UTXO retrieval when ignoring the mempool
9cb9af8 [REST] Handle UTXO retrieval when ignoring the mempool (Roman Zeyde)
1fdc7c4 Make CTxMemPool::isSpent() const (Roman Zeyde)

Pull request description:

  Current REST API always returns empty UTXO when invoked without `/checkmempool/` URL part.

  After the fix:
  ```
  $ curl -s http://localhost:8332/rest/getutxos/0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098-0.json | jq
  {
    "chainHeight": 514109,
    "chaintipHash": "0000000000000000001fe76d1445e8a6432fd2de04261dc9c5915311dc7ad6de",
    "bitmap": "1",
    "utxos": [
      {
        "height": 1,
        "value": 50,
        "scriptPubKey": {
          "asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
          "hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
          "reqSigs": 1,
          "type": "pubkey",
          "addresses": [
            "12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"
          ]
        }
      }
    ]
  }
  ```

  Before the fix:
  ```
  $ curl -s http://localhost:8332/rest/getutxos/0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098-0.json | jq
  {
    "chainHeight": 514109,
    "chaintipHash": "0000000000000000001fe76d1445e8a6432fd2de04261dc9c5915311dc7ad6de",
    "bitmap": "0",
    "utxos": []
  }
  ```

Tree-SHA512: 994a350cb34a3c8f5a7afbc169c6b177c5be6cf223b2071c62d63644819d416d3e10d1c58b244d9d351bae7233d2974aa5e9ebadd1b5d6218f5245558675be0d
2018-03-27 21:32:02 +02:00
Wladimir J. van der Laan 534b8fa560
Merge #12653: Allow to optional specify the directory for the blocks storage
a192636 -blocksdir: keep blockindex leveldb database in datadir (Jonas Schnelli)
f38e4fd QA: Add -blocksdir test (Jonas Schnelli)
386a6b6 Allow to optional specify the directory for the blocks storage (Jonas Schnelli)

Pull request description:

  Since the actual block files taking up more and more space, it may be desirable to have them stored in a different location then the data directory (use case: SSD for chainstate, etc., HD for blocks).

  This PR adds a `-blocksdir` option that allows one to keep the blockfiles and the blockindex external from the data directory (instead of creating symlinks).

  I fist had an option to keep the blockindex within the datadir, but seems to make no sense since accessing the index will (always) lead to access (r/w) the block files.

Tree-SHA512: f8b9e1a681679eac25076dc30e45e6e12d4b2d9ac4be907cbea928a75af081dbcb0f1dd3e97169ab975f73d0bd15824c00c2a34638f3b284b39017171fce2409
2018-03-27 21:22:36 +02:00
Wladimir J. van der Laan b648974cc3
Merge #12778: RPC: Add username and ip logging for RPC method requests
4d74c78 Add username and ip logging for RPC method requests (Gabriel Davidian)

Pull request description:

  Adds username and IP logging (if enabled via -logips command) to RPC method request logging.
  This closes #12223

Tree-SHA512: a441228e80ea6884ec379c66e949d86df3689770f1b3c3608015cf5a36d2dfb38051298a7f6ea6dfdfbf0b3b6c896e414c8dc54e9833bb73dd65bdb1832f4395
2018-03-27 20:53:06 +02:00
Wladimir J. van der Laan e49ba2e23b
Merge #12762: Make CKeyStore an interface
f381299 Move CKeyStore::cs_KeyStore to CBasicKeyStore (João Barbosa)
25eb9f5 Inline CKeyStore::AddKey(const CKey &) in CBasicKeyStore (João Barbosa)

Pull request description:

  Made these simplifications while reviewing #12714. This aims to make `CKeyStore` a *pure* interface:
   - no variable members - the mutex is moved to `CBasicKeyStore` which is where it is used;
   - no method implementations - `AddKey(const CKey &)` is moved to `CBasicKeyStore` which is where it is needed.

Tree-SHA512: 84e44f4390c59600e5cefa599b5464e1771c31dd4abc678ef50db8e06ffac778d692860a352918444f8bcd66430634637b6277a818a658721ffc4f381c1c6a90
2018-03-27 20:42:49 +02:00
Wladimir J. van der Laan bf8fc7d352
Merge #12714: Introduce interface for signing providers
d40f06a Introduce interface for signing providers (Pieter Wuille)

Pull request description:

  `CKeyStore` is a rich interface that provides many features, including knowledge of scripts and pubkeys for solving, private keys for signing, in addition to watch-only keys and scripts, and distinguishing lack of keys from them just being encrypted.

  The signing logic in script/sign does not actually need most of these features. Here we introduce a simpler interface (`SigningProvider`) which *only* provides keys and scripts. This is actually sufficient for signing.

  In addtion, we swap the dependency between keystore and script/sign (keystore now depends on script/script with `CKeyStore` deriving from `SigningProvider`, rather than `CKeyStore` being the interface that signing relies on).

  This is a very early step towards the design in https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2, separating the concern between deciding what outputs are ours and signing.

Tree-SHA512: d511b7b03eec0e513530db1d9ae5aacf6d0bfa1d3e1c03d06c5bde396bafb5824c4491b227d32bcda9288530caf49835da18e846ccf66538d6c0cc6ae27291c9
2018-03-27 20:20:55 +02:00
Wladimir J. van der Laan 2d97611c41
Merge #12800: doc: Add note about our preference for scoped enumerations ("enum class")
0fee2b4 doc: Add note about our preference for scoped enumerations ("enum class") (practicalswift)

Pull request description:

  Add note about our preference for scoped enumerations (`enum class`).

  Context: #10742

Tree-SHA512: 0ab3465c2b734240cb38a05c2f6e75f1af54207a0f1a2e8115e7b367fd37e8966a2fc0240c6d4c2c66b6677b5f367eda4f4b783bbaa419777336c17f04adff06
2018-03-27 18:55:09 +02:00
practicalswift 0fee2b4180 doc: Add note about our preference for scoped enumerations ("enum class") 2018-03-27 17:18:32 +02:00
Wladimir J. van der Laan 0415b1e6b2
Merge #12797: init: Fix help message for checkblockindex
4ae7d15 init: Fix help message for checkblockindex (MarcoFalke)

Pull request description:

  Minor fixup for my commit fa6ab96799.

Tree-SHA512: 18f9255bf1342007be2bdc26d6f688bcd27ba8eebfc709bd9ee31dfd2e4d955d2b699686492ccf59e94eb4b1cc7bf3332376aa151a68cb0b21695b3f67d4a940
2018-03-27 16:40:23 +02:00
Wladimir J. van der Laan 3de01268b7
Merge #10742: scripted-diff: Use scoped enumerations (C++11, "enum class")
1f45e21 scripted-diff: Convert 11 enums into scoped enums (C++11) (practicalswift)

Pull request description:

  Rationale (from Bjarne Stroustrup's ["C++11 FAQ"](http://www.stroustrup.com/C++11FAQ.html#enum)):

  >
  > The enum classes ("new enums", "strong enums") address three problems with traditional C++ enumerations:
  >
  > * conventional enums implicitly convert to int, causing errors when someone does not want an enumeration to act as an integer.
  > * conventional enums export their enumerators to the surrounding scope, causing name clashes.
  > * the underlying type of an enum cannot be specified, causing confusion, compatibility problems, and makes forward declaration impossible.
  >
  > The new enums are "enum class" because they combine aspects of traditional enumerations (names values) with aspects of classes (scoped members and absence of conversions).

Tree-SHA512: 9656e1cf4c3cabd4378c7a38d0c2eaf79e4a54d204a3c5762330840e55ee7e141e188a3efb2b4daf0ef3110bbaff80d8b9253abf2a9b015cdc4d60b49ac2b914
2018-03-27 16:38:14 +02:00
Jonas Schnelli 68484d64fd
Merge #12795: do not truncate .dat extension for wallets in gui
fc7c32fc6 do not truncate .dat extension for wallets in gui (Gregory Sanders)

Pull request description:

  Truncating the extension results in wallet name ambiguity and the inability to use the wallet in GUI debug rpc console.

  Resolves #12794

Tree-SHA512: 89507918f597e9274148b45233b893c9f653da4f9e929415822165d47c67b55ad0b2d5ff53b508e942831d5213d5c15bce3fbdfbcb592a5c7f3dd5c1ca02cfb8
2018-03-27 15:14:20 +07:00
Wladimir J. van der Laan 17b246f4b3
Merge #12793: qt: Avoid reseting on resetguisettigs=0
342fb80 qt: Avoid resetting on resetguisettigs=0 (MarcoFalke)

Pull request description:

  Shouldn't be affecting anyone, but might still be worth to fix at some point.

Tree-SHA512: af7fe67f1e8b3a0ff041258e3056d2e3e518258b015ee765f291e91fca86a7f7cd43c83844fd83f00a52dac2cf382db5d568aab91db636a031040551bd34172d
2018-03-27 08:24:33 +02:00
Wladimir J. van der Laan f4353daa61
Merge #12779: Qt: Remove unused method setupAmountWidget(...)
3a0f8d7 Qt: Remove unused method setupAmountWidget(...) (practicalswift)

Pull request description:

  Remove unused method `setupAmountWidget(...)`.

  Last use removed in f193c57a63.

Tree-SHA512: 8f25ed2da13cfbc0f2e042286b3c979ef03de960028d7824110bdc2ed96f5075e3b35a9809a09c83caa5bad2237d2e048ff212b19a0be1d07f79c19691dfcd87
2018-03-27 08:09:46 +02:00
MarcoFalke 4ae7d1529e init: Fix help message for checkblockindex 2018-03-26 17:02:25 -04:00
Gregory Sanders fc7c32fc68 do not truncate .dat extension for wallets in gui 2018-03-26 15:25:37 -04:00
MarcoFalke 342fb80346 qt: Avoid resetting on resetguisettigs=0 2018-03-26 15:13:33 -04:00
Wladimir J. van der Laan 0a018431c4
Merge #11962: [net] add seed.bitcoin.sprovoost.nl to DNS seeds
ffcc687 [net] add seed.bitcoin.sprovoost.nl to DNS seeds (Sjors Provoost)

Pull request description:

  ACK https://github.com/bitcoin/bitcoin/blob/master/doc/dnsseed-policy.md

  I'm willing to keep it up and running at least throughout 2018, unless something bad happens.

  Same setup as #11917, but with a dedicated instance.

Tree-SHA512: df0c8ab705628b8da4d0a0cb753759a699a6a91907a76e13c08cbdbeae81131af0f6040183dab7f00851e0c57dcd91f5cd5ce43482d1f13432a58c8943692e90
2018-03-26 20:30:17 +02:00
Wladimir J. van der Laan c948dc8f42
Merge #12699: [wallet] Shuffle transaction inputs before signing
2fb9c1e shuffle selected coins before transaction finalization (Gregory Sanders)

Pull request description:

  Currently inputs are ordered based on COutPoint ordering, which while doesn't leak additional internal wallet state, likely further fingerprints the wallet as a Core wallet to observers.

  Note: This slightly changed behavior of `fundrawtransaction` in that the newly-appended inputs will now be shuffled rather than in outpoint-order. This does not break API compatibility.

  Simple shuffling of the coins being returned will hopefully allow the wallet to blend in a bit more, in lieu of additional data to find what other wallets are doing, or another standard, ala @gmaxwell's suggested of ordering via scriptPubKey.

Tree-SHA512: 70689a6eccf9fa7fc6e3d884f2eba4b482446a1e6128beff7a98f446d0c60f7966c5a6c55e9b0b3d73a9b539ce54889a26c7efe78ab7f34af386d5e4f3fa6df2
2018-03-26 17:10:29 +02:00
Wladimir J. van der Laan ec7dbaa37c
Merge #12756: [config] Remove blockmaxsize option
4757c04 [config] Remove blockmaxsize option (John Newbery)

Pull request description:

  The blockmaxsize option was marked as deprecated in V0.15.1, and code
  was added to convert provided blockmaxsize into blockmaxweight. However,
  this code was incorrectly implemented, and blockmaxsize was silently
  ignored.

  No users have complained about blockmaxsize being ignored, so just
  remove it in V0.17.

  Fixes #12640

  cc @ajtowns

Tree-SHA512: 968d71d37bf175c5a02539ddec289a12586f886e1dfe64c1d9aa5e39db48d06d21665153824fac3b11503a55f0812d2f1115a2d726aafd37b76ed629ec0aa671
2018-03-26 15:30:27 +02:00
Jonas Schnelli 25cf18f239
Merge #12610: Multiwallet for the GUI
779c5f984 Qt: hide RPCConsole wallet selector when no wallets are present (Jonas Schnelli)
dc6f150f3 Qt: show wallet name in request dlg in case of multiwallet (Jonas Schnelli)
4826ca4b8 Qt: show wallet name in send confirmation dlg in case of multiwallet (Jonas Schnelli)
cfa4133ce GUI: RPCConsole: Log wallet changes (Luke Dashjr)
b6d04fc7c Qt: Get wallet name from WalletModel rather than passing it around (Luke Dashjr)
12d8d2681 Qt: When multiple wallets are used, include in notifications the name (Jonas Schnelli)
d1ec34a76 Qt: QComboBox::setVisible doesn't work in toolbars, so defer adding it at all until needed (Luke Dashjr)
d49cc70e6 Qt: Add wallet selector to debug console (Jonas Schnelli)
d558f44c5 Bugfix: RPC: Add missing UnregisterHTTPHandler for /wallet/ (Luke Dashjr)
85d531971 Qt: Ensure UI updates only come from the currently selected walletView (Luke Dashjr)
e449f9a9e Qt: Add a combobox to toolbar to select from multiple wallets (Luke Dashjr)
3dba3c3ac Qt: Load all wallets into WalletModels (Luke Dashjr)

Pull request description:

  This is an overhaul of #11383 (plus some additions).
  It avoids unnecessary coupling of httpserver/jsonrpc and the wallet as well as it avoids pointer pure passing (and pointer deletion) of `CWallet` (plus other minor design changes).

  Additionally it adds the wallet name to the sendconfirmation and request dialog (in case multiwallet is active)

Tree-SHA512: 3d06e18badbc5d1821e488bf1dae463bb0be544cf11b2b618e025812bfdd13c5f39604bb93b4c705313930e7dc4e66f4848b9469ba14871bade58e7a027246a1
2018-03-26 18:51:38 +07:00
Jonas Schnelli 779c5f9840
Qt: hide RPCConsole wallet selector when no wallets are present 2018-03-26 18:40:27 +07:00
Jonas Schnelli dc6f150f35
Qt: show wallet name in request dlg in case of multiwallet 2018-03-26 18:40:27 +07:00
Jonas Schnelli 4826ca4b84
Qt: show wallet name in send confirmation dlg in case of multiwallet 2018-03-26 18:40:27 +07:00
Luke Dashjr cfa4133ce5
GUI: RPCConsole: Log wallet changes 2018-03-26 18:40:27 +07:00
Luke Dashjr b6d04fc7cc
Qt: Get wallet name from WalletModel rather than passing it around 2018-03-26 18:40:26 +07:00
Jonas Schnelli 12d8d2681e
Qt: When multiple wallets are used, include in notifications the name 2018-03-26 18:40:26 +07:00
Luke Dashjr d1ec34a761
Qt: QComboBox::setVisible doesn't work in toolbars, so defer adding it at all until needed 2018-03-26 18:40:26 +07:00
Jonas Schnelli d49cc70e6d
Qt: Add wallet selector to debug console 2018-03-26 18:40:12 +07:00
Pieter Wuille d40f06a3da Introduce interface for signing providers
CKeyStore is a rich interface that provides many features, including knowledge
of scripts and pubkeys for solving, private keys for signing, in addition to
watch-only keys and scripts, and distinguishing lack of keys from them just
being encrypted.

The signing logic in script/sign does not actually need most of these features.
Here we introduce a simpler interface (SigningProvider) which *only* provides
keys and scripts. This is actually sufficient for signing.

In addtion, we swap the dependency between keystore and script/sign
(keystore now depends on script/script with CKeyStore deriving from
SigningProvider, rather than CKeyStore being the interface that signing
relies on).
2018-03-25 13:26:57 -07:00
practicalswift 3a0f8d795a Qt: Remove unused method setupAmountWidget(...) 2018-03-25 21:15:08 +02:00
Gabriel Davidian 4d74c78c69 Add username and ip logging for RPC method requests 2018-03-25 18:25:09 +00:00
Roman Zeyde 9cb9af8c41
[REST] Handle UTXO retrieval when ignoring the mempool
Current REST API always returns empty UTXO when invoked without `/checkmempool/` URL part.

After the fix:
```
$ curl -s http://localhost:8332/rest/getutxos/0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098-0.json | jq
{
  "chainHeight": 514109,
  "chaintipHash": "0000000000000000001fe76d1445e8a6432fd2de04261dc9c5915311dc7ad6de",
  "bitmap": "1",
  "utxos": [
    {
      "height": 1,
      "value": 50,
      "scriptPubKey": {
        "asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
        "hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
        "reqSigs": 1,
        "type": "pubkey",
        "addresses": [
          "12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"
        ]
      }
    }
  ]
}
```

Before the fix:
```
$ curl -s http://localhost:8332/rest/getutxos/0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098-0.json | jq
{
  "chainHeight": 514109,
  "chaintipHash": "0000000000000000001fe76d1445e8a6432fd2de04261dc9c5915311dc7ad6de",
  "bitmap": "0",
  "utxos": []
}
```
2018-03-25 11:32:44 +03:00
Roman Zeyde 1fdc7c41bb
Make CTxMemPool::isSpent() const 2018-03-25 11:32:41 +03:00
João Barbosa f381299d64 Move CKeyStore::cs_KeyStore to CBasicKeyStore 2018-03-24 12:15:53 +00:00
João Barbosa 25eb9f5020 Inline CKeyStore::AddKey(const CKey &) in CBasicKeyStore 2018-03-24 12:15:53 +00:00
MarcoFalke 7466a26cab
Merge #12760: Docs: Improve documentation on standard communication channels
30d1a0ae37 Docs: Improve documentation on standard communication channels (Jim Posen)

Pull request description:

  More information about connection on IRC will hopefully help new contributors.

Tree-SHA512: d0fc19303463fb1ebd193640058b8a1b3b1cc32592764632d6dce489ea3e1f6be421f8f2a776ff60036c174e1d0c847ad5a9fd7912c1aafc36f233eb840081ef
2018-03-24 08:15:42 -04:00
MarcoFalke b43aba89e3
Merge #12772: [CI]: bump travis timeout for make check to 50m
bc308ba999 [CI]: bump travis timeout for make check to 50m (Karl-Johan Alm)

Pull request description:

  The travis windows build sometimes times out on `make check`. Bump the timeout from 20 to 50 minutes.

  This is a short-term measure. We should figure out why the unit tests are slow in Wine.

Tree-SHA512: 4a512e96b805d52ea25eebb5dc026a11c48392abbc5d70990698ab44fae1494ec67261515948a7a8f919669716614817464c059e54d3beb99487358387f79a17
2018-03-24 08:10:04 -04:00
MarcoFalke 02b7e8319a
Merge #12709: [wallet] shuffle sendmany recipients ordering
6acb02d635 add release note for sendmany output shuffling (Gregory Sanders)
cf6ef3c139 shuffle sendmany recipients ordering to shuffle tx outputs (Gregory Sanders)

Pull request description:

  Unless there is something important I'm missing, we're just possible leaking information by preserving whatever ordering json object ordering is giving us (no guarantees at all).

  This is unneeded for `sendtoaddress` since there is only 1 or 2 outputs, and the change output is shuffled in.

  This will not effect `*raw` behavior by design, since users generally want full control using those apis. Further PRs could add optional args to over-ride that behavior.

  Alternative ideas would be to sort the outputs by some deterministic ordering. (this would require more refactoring since change outputs are created and handled by caller)

  related: https://github.com/bitcoin/bitcoin/pull/12699

Tree-SHA512: afdd990dde6a4a9e7eef7bb2e3342a46d11900d7fe6e6e4eb0cc6b5deed89df989fa7931a4bdcbf49b7c2d7a13c90169af3a166466e5760948bacabe3490f572
2018-03-23 19:03:34 -04:00
Karl-Johan Alm bc308ba999 [CI]: bump travis timeout for make check to 50m 2018-03-23 15:58:43 -04:00
Gregory Sanders 6acb02d635 add release note for sendmany output shuffling 2018-03-23 08:56:58 -04:00
Gregory Sanders cf6ef3c139 shuffle sendmany recipients ordering to shuffle tx outputs 2018-03-23 08:56:08 -04:00
Wladimir J. van der Laan cead84b72d
Merge #11536: Rename account to label where appropriate
d2527bd Rename wallet_accounts.py test (Russell Yanofsky)
045eeb8 Rename account to label where appropriate (Russell Yanofsky)

Pull request description:

  Rename account to label where appropriate

  This change only updates strings and adds RPC aliases, but should simplify the implementation of address labels in https://github.com/bitcoin/bitcoin/pull/7729, by getting renaming out of the way and letting that change focus on semantics.

  The difference between accounts and labels is that labels apply only to addresses, while accounts apply to both addresses and transactions (transactions have "from" and "to" accounts). The code associating accounts with transactions is clumsy and unreliable so we would like get rid of it.

  ---

  There is a rebased version of #7729 atop this PR at https://github.com/ryanofsky/bitcoin/commits/pr/label, see https://github.com/bitcoin/bitcoin/pull/7729#issuecomment-338417139.

Tree-SHA512: b3f934e612922d6290f50137f8ba71ddfaea4485713c7d97e89400a8b73b09b254f9186dffa462c77f5847721f5af9852b5572ade5443d8ee95dd150b3edb7ff
2018-03-22 21:27:53 +01:00
Wladimir J. van der Laan 9552dfb1f6
Merge #12694: Actually disable BnB when there are preset inputs
081bf54 Test that BnB is not used when there are preset inputs (Andrew Chow)
6ef9982 Actually disable BnB when there are preset inputs (Andrew Chow)

Pull request description:

  We don't want to use BnB when there are preset inputs because there
  is some weirdness with making that work with using the KnapsackSolver
  as the fallback. Currently we say that we haven't used bnb when
  there are preset inputs, but we don't actually disable BnB. This fixes
  that.

  I thought this was done originally. I guess it got lost in a rebase somewhere.

Tree-SHA512: 9792c0cdd0736866bddbed20f10b8050104955dc589fba49a0bd61a582ba491c921af2cdcc2269678b7b69275dad5fcf89c71b75c28733c7bacbe52e55891b9c
2018-03-22 21:13:13 +01:00
Jim Posen 30d1a0ae37 Docs: Improve documentation on standard communication channels
More information about connection on IRC will hopefully help new
contributors.
2018-03-22 12:58:57 -07:00
MarcoFalke f686002a8e
Merge #12742: Make FastRandomContext support standard C++11 RNG interface
1ec1602a45 Make FastRandomContext support standard C++11 RNG interface (Pieter Wuille)

Pull request description:

  This makes it possible to plug it into the various standard C++11 random distribution algorithms and other functions like `std::shuffle`.

Tree-SHA512: 935eae9c4fae31e1964c16d9cf9d0fcfa899e04567f010d8b3e1ff824e55e2392aa838ba743d03c1b2a5010c5b8da04343f453983dfeed83747d85828a564713
2018-03-22 12:21:46 -04:00
John Newbery 4757c04cb9 [config] Remove blockmaxsize option
The blockmaxsize option was marked as deprecated in V0.15.1, and code
was added to convert provided blockmaxsize into blockmaxweight. However,
this code was incorrectly implemented, and blockmaxsize was silently
ignored.

No users have complained about blockmaxsize being ignored, so just
remove it in V0.17.
2018-03-22 10:28:56 -04:00
Wladimir J. van der Laan c290508a5e
Merge #12630: Provide useful error message if datadir is not writable.
8674e74 Provide relevant error message if datadir is not writable. (murrayn)

Pull request description:

  If the --datadir exists, but is not writable, the current error message on startup is 'Cannot obtain a lock on data directory foo. Bitcoin Core is probably already running.' This is misleading.

  I believe this PR addresses #11668, although the issue is not Windows-specific.

Tree-SHA512: 10cbbaea433072aee4fb3e8938a72073c7a5c841f7a7685c9e12549c322b2925c7d34bac254ac33021b23132bfc352c058712bc9542298cf86f8fd9757f528b2
2018-03-22 15:14:43 +01:00
Wladimir J. van der Laan a6926b065d
Merge #12048: Use best-fit strategy in Arena, now O(log(n)) instead O(n)
5fbf7c4 fix nits: variable naming, typos (Martin Ankerl)
1e0ee90 Use best-fit strategy in Arena, now O(log(n)) instead O(n) (Martin Ankerl)

Pull request description:

  This replaces the first-fit algorithm used in the Arena with a best-fit. According to "Dynamic Storage Allocation: A Survey and Critical Review", Wilson et. al. 1995, http://www.scs.stanford.edu/14wi-cs140/sched/readings/wilson.pdf, both startegies work well in practice.

  The advantage of using best-fit is that we can switch the O(n) allocation to O(log(n)). Additionally, some previously O(log(n)) operations are now O(1) operations by using hash maps. The end effect is that the benchmark runs about 2.5 times faster on my machine:

      # Benchmark, evals, iterations, total, min, max, median
      old: BenchLockedPool, 5, 530, 5.25749, 0.00196938, 0.00199755, 0.00198172
      new: BenchLockedPool, 5, 1300, 5.11313, 0.000781493, 0.000793314, 0.00078606

  I've run all unit tests and benchmarks, and increased the number of iterations so that BenchLockedPool takes about 5 seconds again.

Tree-SHA512: 6551e384671f93f10c60df530a29a1954bd265cc305411f665a8756525e5afe2873a8032c797d00b6e8c07e16d9827465d0b662875433147381474a44119ccce
2018-03-22 14:28:37 +01:00
Wladimir J. van der Laan 6d36f599f8
Merge #12076: qa: Use node.datadir instead of tmpdir in test framework
c8330d4 qa: Use node.datadir instead of tmpdir in test framework (MarcoFalke)

Pull request description:

  Commit c53c9831ee introduced the utility function `get_datadir_path`, however not all places in the code use this util function. Using the util function everywhere makes it easier to review pull requests related to the datadir.

  This commit replaces datadir path creation with the `datadir` member of `TestNode`, which itself uses `get_datadir_path`.

Tree-SHA512: c75707ab7149d732a6d56152a5813138a33459d3d07577b60b89f2a207c83b7663fac5f203593677c9892d1c23a5eba4bd45c5c4ababf040d720b437240fcddf
2018-03-22 11:10:56 +01:00