Commit Graph

17574 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
40e4a1a45c Merge #12422: util: Make LockDirectory thread-safe, consistent, and fix OpenBSD 6.2 build
1d4cbd2 test: Add unit test for LockDirectory (Wladimir J. van der Laan)
fc888bf util: Fix multiple use of LockDirectory (Wladimir J. van der Laan)

Pull request description:

  Wrap the `boost::interprocess::file_lock` in a `std::unique_ptr` inside the map that keeps track of per-directory locks.

  This fixes a build issue with the clang 4.0.0+boost-1.58.0p8 version combo on OpenBSD 6.2, and should have no effect otherwise.

  Also add a unit test, make the function thread-safe, and fix Linux versus Windows behavior inconsistency.

  Meant to fix #12413.

Tree-SHA512: 1a94c714c932524a51212c46e8951c129337d57b00fd3da5a347c6bcf6a947706cd440f39df935591b2079995136917f71ca7435fb356f6e8a128c509a62ec32
2020-04-03 04:00:42 -05:00
MarcoFalke
45844dc002 Merge #12241: [trivial][docs] Fix incorrect link in /test/ README.md
bf1897710f [trivial][docs] Fix incorrect link in /test/ README.md (fanquake)

Pull request description:

Tree-SHA512: f9024a5b6b03c591b9e02057aedd862f479d4b38d293dd04a07e411b877c0fb5b4d95ced7d09190bb8a83078fe8c97db24c5dcdac7cbd59d37b41f614d423026
2020-04-03 03:38:56 -05:00
UdjinM6
3e072bed89
Merge pull request #3387 from PastaPastaPasta/backports-0.16-pr13
Backports 0.16 pr13
2020-04-03 02:31:23 +03:00
Alexander Block
c7b6eb851d
Merge pull request #3389 from codablock/pr_concentrated_recovery
Implement "concentrated recovery" of LLMQ signatures
2020-04-02 13:59:05 +02:00
Alexander Block
e518ce4e13
Increase DIP0008 bip9 window by 10 years (#3391) 2020-04-02 08:19:41 +02:00
Alexander Block
1aba86567b
Merge pull request #3390 from codablock/pr_pose_ban_bad_connections
Implement checking of open ports and min proto versions in DKGs
2020-04-02 08:18:35 +02:00
UdjinM6
7d75dbda22 More of 10773 2020-04-01 12:43:18 -05:00
UdjinM6
f4d6d370f0 Fix 11854 2020-04-01 12:43:18 -05:00
pasta
97f1661853 fix test failure and fix indentation
Signed-off-by: pasta <pasta@dashboost.org>
2020-04-01 12:43:18 -05:00
Wladimir J. van der Laan
9bedb900a9 Merge #11904: Add a lock to the wallet directory
2f3bd47 Abstract directory locking into util.cpp (MeshCollider)
5260a4a Make .walletlock distinct from .lock (MeshCollider)
64226de Generalise walletdir lock error message for correctness (MeshCollider)
c9ed4bd Add a test for wallet directory locking (MeshCollider)
e60cb99 Add a lock to the wallet directory (MeshCollider)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/11888, needs a 0.16 milestone

  Also adds a test that the lock works.

  https://github.com/bitcoin/bitcoin/pull/11687 will probably rework this to a per-wallet lock instead of just the walletdir, but this fixes the current issue

Tree-SHA512: 98e52d67f820e3b8f919cf361ffbb7d928f1bd67603e0ed26c5076ea02d9b3a90c3535ddf7329f3b88171396fa28dd3c87adab3577a8a217bd1e4247bda99138
2020-04-01 12:43:18 -05:00
Wladimir J. van der Laan
9d3c7c3ca6 Merge #11854: Split up key and script metadata for better type safety
9c8eca7 Split up key and script metadata for better type safety (Russell Yanofsky)

Pull request description:

  Suggested by @TheBlueMatt
  https://github.com/bitcoin/bitcoin/pull/11403#discussion_r155599383

  Combining the maps was probably never a good arrangement but is more
  problematic now in presence of WitnessV0ScriptHash and WitnessV0KeyHash types.

Tree-SHA512: 9263e9c01090fb49221e91d88a88241a9691dda3e92d86041c8e284306a64d3af5e2438249f9dcc3e6e4a5c11c1a89f975a86d55690adf95bf2636f15f99f92a
2020-04-01 12:43:18 -05:00
Wladimir J. van der Laan
02ab2efe4a Merge #11667: Add scripts to dumpwallet RPC
656fde5 Add script birthtime metadata to dump and import wallet (MeshCollider)
1bab9b2 Add script dump note to RPC help text and release notes (MeshCollider)
68c1e00 Add test for importwallet (MeshCollider)
9e1184d Add dumpwallet scripts test (MeshCollider)
ef0c730 Add scripts to importwallet RPC (MeshCollider)
b702ae8 Add CScripts to dumpwallet RPC (MeshCollider)
cdc260a Add GetCScripts to CBasicKeyStore (MeshCollider)

Pull request description:

  As discussed in https://github.com/bitcoin/bitcoin/pull/11289#issuecomment-334600457, adds the CScripts from the wallet to the `dumpwallet` RPC and then allows them to be imported with the `importwallet` RPC. Includes a basic test, and modifies the helptext of the dumpwallet RPC.

  Notes:
  - Reviewers: use `?w=1` to avoid the indentation-only change in commit `Add scripts to importwallet RPC `
  - currently the scripts are followed with `# addr=` comments just as the other keys are, unsure if this might confuse users into thinking all the scripts are for valid P2SH addresses though, but I don't think that should be an issue.
  - there are no birthtimes for scripts, so script imports don't affect rescans
  - `importwallet` imports the CScripts but I'm not sure how to approach specifying whether scripts are for P2SH addresses, BIP173 addresses, etc. whether that matters or not. Otherwise the RPC helptext might just need modification.

  Fixes #11715

Tree-SHA512: 36c55837b3a58b9d3499d4c0c2ae82153d62aa71919e751574651b63a1d2b8ecc83796db4553cc65dad9b5341c3a42ae2fcf4d62598c30af267f8e1461ba8272
2020-04-01 12:43:18 -05:00
MarcoFalke
adec6e262e Merge #11997: [tests] util_tests.cpp: actually check ignored args
c99a3c32c8 [tests] util_tests.cpp: actually check ignored args (Anthony Towns)

Pull request description:

  An array with 7 elements was setup for checking argument parsing, but
  was passed to ParseParamaeters with argc=5, meaning the interpretation
  of the last two arguments was never actually checked.

Tree-SHA512: 7b81fde49742e524f1bb67e2ec084f5909ae36125f237f0210df4587c62e5a5a8f277f13543f0a85ad145c4bb80d62339a7d50d7ed41659df318c8198ea7f428
2020-04-01 12:43:18 -05:00
Wladimir J. van der Laan
58422516d0 Merge #10874: [RPC] getblockchaininfo: Loop through the bip9 soft fork deployments instead of hard coding
e4d0af4 Loop through the bip9 soft fork deployments instead of hard coding (Andrew Chow)

Pull request description:

  Instead of hard coding which deployment statistics should be listed in the `getblockchaininfo` output, loop through the available deployments (except testdummy) when displaying their deployment info.

Tree-SHA512: 87e503bcf5e0fd379940d5e53320b9cbb4b47d647c66246d46f47c09a941f135e6ce1e8b75dad441ed4c22c3f41992dfde7717414be1d71c771d4ff8fe0e1936
2020-04-01 12:43:18 -05:00
Wladimir J. van der Laan
7b1f32082c Merge #11981: Fix gitian build after libzmq bump
a6365c5 depends: fix libzmq's needless linking against libstdc++ (Cory Fields)

Pull request description:

  Broken gitian builds were introduced with #9254. Big thanks to @jonasschnelli for narrowing down the bisection.

  This is broken for a number of reasons, including:
  - g++ understands "-static-libstdc++ -lstdc++" to mean "link against whatever libstdc++ exists, probably shared", which in itself is buggy.
  - another stdlib (libc++ for example) may be in use

Tree-SHA512: d84968ee680f32ea799034ee516e9477fff2b1ef1b7c9a8ef1941631520ab196ecd50f5d64f3ed1c84113ead44be5e3ddf6ff2ae0277625bdeed05f1da89e017
2020-04-01 12:43:18 -05:00
Wladimir J. van der Laan
fe8c18ca77 Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included
a720b92 Remove includes in .cpp files for things the corresponding .h file already included (practicalswift)

Pull request description:

  Remove includes in .cpp files for things the corresponding .h file already included.

  Example case:
  * `addrdb.cpp` includes `addrdb.h` and `fs.h`
  * `addrdb.h` includes `fs.h`

  Then remove the direct inclusion of `fs.h` in `addrman.cpp` and rely on the indirect inclusion of `fs.h` via the included `addrdb.h`.

  In line with the header include guideline (see #10575).

Tree-SHA512: 8704b9de3011a4c234db336a39f7d2c139e741cf0f7aef08a5d3e05197e1e18286b863fdab25ae9638af4ff86b3d52e5cab9eed66bfa2476063aa5c79f9b0346
2020-04-01 12:43:18 -05:00
Pieter Wuille
a7a3ecc354 Merge #10773: Shell script cleanups
13a81b19d Add quotes to variable assignment (as requested by @TheBlueMatt) (practicalswift)
683b9d280 Fix valid path output (practicalswift)
193c2fb4c Use bash instead of POSIX sh. POSIX sh does not support arrays. (practicalswift)
80f5f28d3 Fix incorrect quoting of quotes (the previous quotes had no effect beyond unquoting) (practicalswift)
564a172df Add required space to [[ -n "$1" ]] (previously [[ -n"$1" ]]) (practicalswift)
1e44ae0e1 Add error handling: exit if cd fails (practicalswift)
b9e79ab41 Remove "\n" from echo argument. echo does not support escape sequences. (practicalswift)
f6b3382fa Remove unused variables (practicalswift)

Pull request description:

  Shell script cleanups:
  * Add required space to `[ -n ]`.
  * Avoid quote within quote.
  * Exit if `cd` fails.
  * Remove `\n` which is not handled by `echo`.
  * ~~Remove redundant `$` in arithmetic variable expression.~~
  * ~~Use `$(command)` instead of legacy form `` `command` ``.~~
  * Arrays are not supported in POSIX `sh`. Use `bash` when arrays are used.
  * ~~`[ foo -a bar ]` is not well defined, use `[ foo ] && [ bar ]` instead.~~
  * ~~`[ foo -o bar ]` is not well defined, use `[ foo ] || [ bar ]` instead.~~

Tree-SHA512: 80f6ded58bce625b15b4da30d69d2714c633e184e62b21ed67d2c58e2ebaa08b4147593324012694d02bf4f1f252844cdff2fd1cf5e817ddb07e2777db7a6390
2020-04-01 12:43:18 -05:00
MarcoFalke
a98db86ada Merge #10493: Use range-based for loops (C++11) when looping over map elements
680bc2cbb Use range-based for loops (C++11) when looping over map elements (practicalswift)

Pull request description:

  Before this commit:

  ```c++
  for (std::map<T1, T2>::iterator x = y.begin(); x != y.end(); ++x) {
      T1 z = (*x).first;
      …
  }
  ```

  After this commit:

  ```c++
  for (auto& x : y) {
      T1 z = x.first;
      …
  }
  ```

Tree-SHA512: 954b136b7f5e6df09f39248a6b530fd9baa9ab59d7c2c7eb369fd4afbb591b7a52c92ee25f87f1745f47b41d6828b7abfd395b43daf84a55b4e6a3d45015e3a0
2020-04-01 12:43:18 -05:00
Pieter Wuille
306390abac Merge #11746: trivial: Fix unsuccessful typo
d2ea2bcb5 trivial: Fix unsuccessful typo (practicalswift)

Pull request description:

  Fix unsuccessful typo.

Tree-SHA512: 48dde6764603b91cdd698fd9b5ea200961009df07f5a024430aaf81c50d889ed72681d76ac0832cdafaa2fd2be32ef3637ba641308de5eea6146f3b1074e9b19
2020-04-01 12:43:17 -05:00
Wladimir J. van der Laan
3f16ebd70a 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
2020-04-01 12:43:17 -05:00
MarcoFalke
1587728345 Merge #11690: [trivial] Fix the StartupWMClass for bitoin-qt, so gnome-shell can recognize it
b077fe908 fix the StartupWMClass for bitoin-qt, so gnome-shell can recognize it (Evan Klitzke)

Pull request description:

  I spent some time trying to figure out how to get the provided `.desktop` file to work correctly in GNOME. When a non-absolute path is used in the desktop file, you need to specify `StartupWMClass` in order for gnome-shell to know that a running application matches one in its desktop database. I also set a version and removed the deprecated `Encoding` field. With these changes, the desktop file passes `desktop-file-validate` cleanly.

  P.S. I found this while working on a new spec file for Bitcoin, which you can find here: https://github.com/eklitzke/bitcoin-copr/blob/master/bitcoin.spec . I plan to contribute this work back upstream as well, once I've figured out more of these packaging issues (desktop files being one of them!).

Tree-SHA512: cb290dd2c2fbcf7f08d838cf911d516d09a4e978d939e719a21a84db7232d1f534043616d7fbb52edd2b7d12389e5f0f8e53d29ac59d7282bdebde8224a2db7f
Signed-off-by: pasta <pasta@dashboost.org>

# Conflicts:
#	contrib/debian/bitcoin-qt.desktop
2020-04-01 12:43:17 -05:00
Alexander Block
148bbdd5cf
Use GetTime instead of GetAdjustedTime
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-04-01 18:05:44 +02:00
Alexander Block
47bd5d7ede
Only update id in spork21 case
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-04-01 16:12:04 +02:00
Alexander Block
76b6614fe5 Use auto keyword in CollectSigSharesToSend 2020-03-31 19:58:07 +02:00
Alexander Block
900ee0f194 Use range based for loop in SelectMemberForRecovery 2020-03-31 19:58:07 +02:00
Alexander Block
91f811edd9 Test failure of recovery on first node 2020-03-31 19:58:07 +02:00
Alexander Block
beaf3f40b2 Implement DashTestFramework.get_mninfo 2020-03-31 19:58:07 +02:00
Alexander Block
80533f6c0d Implement "quorum selectquorum" RPC 2020-03-31 19:58:07 +02:00
Alexander Block
5edbeafcea Also run llmq-signing.py with spork21 enabled 2020-03-31 19:58:07 +02:00
Alexander Block
b212f21c15 Implement new way of concentrated signature recovery
Instead of propagating all sig shares to all LLMQ members, this will now
make all members send their individual sig share to a single member, which
is then responsible for the recovery and propagation of the recovered
signature. This process is repeated by all members every second for another
target/recovering member, until a recovered signature appears.
2020-03-31 19:58:07 +02:00
Alexander Block
45064d8dc9 Rename sigSharesToSend to sigShareBatchesToSend 2020-03-31 19:58:07 +02:00
Alexander Block
97ffcd369d Use !fMasternode to disable restart of mnsync instead of checking for regtest 2020-03-31 19:53:46 +02:00
Alexander Block
19e3e8733d Use Params().RequireRoutableExternalIP() wherever possible 2020-03-31 07:21:12 +02:00
Alexander Block
99414ed754 Fix fRequireRoutableExternalIP for devnets 2020-03-31 07:16:35 +02:00
Alexander Block
88d4f551c9 Move spork21 condition into VerifyConnectionAndMinProtoVersions 2020-03-31 07:11:27 +02:00
Alexander Block
a3c1fce551 Also test banning due to closed ports and old proto versions 2020-03-31 07:09:38 +02:00
Alexander Block
2de860685f Refactor test_banning to support more scenarios 2020-03-31 07:09:38 +02:00
Alexander Block
535698d31f Allow calling start_masternode from outside of start_masternodes 2020-03-31 07:09:38 +02:00
Alexander Block
41796bec06 Put (no-)banning loop into test_(no)_banning 2020-03-31 07:09:38 +02:00
Alexander Block
4dc483de26 Support waiting for probes in mine_quorum 2020-03-31 07:09:38 +02:00
Alexander Block
e980b18b68 Isolate instead of kill MNs in llmq-simplepose.py 2020-03-31 07:09:38 +02:00
Alexander Block
a308a092e2 Don't touch self.nodes/self.mninfo in llmq-simplepose.py 2020-03-31 07:09:38 +02:00
Alexander Block
908eb8372b Allow to pass list of online masternodes to mine_quorum 2020-03-31 07:09:38 +02:00
Alexander Block
dfe9daabd9 Fix test in LLMQSimplePoSeTest
This was intended to test for "not self.check_banned"
2020-03-31 07:07:52 +02:00
Alexander Block
3e3eba63e2 Fix LLMQ dkgBadVotesThreshold parameter in regtest and devnet 2020-03-31 07:07:52 +02:00
Alexander Block
d3586e1df0 Immediately close connections again when fNetworkActive==false 2020-03-31 07:07:52 +02:00
Alexander Block
cace76d07f Actually use LLMQConnectionRetryTimeout for probing 2020-03-31 07:07:52 +02:00
Alexander Block
38bf1a31fb Allow masternode mode and -listen=0 in regtest mode 2020-03-31 07:07:52 +02:00
Alexander Block
bb63327623 Don't restart mnsync in regtest when nothing happens for too long
This kept conflicting with the way we use mocktime and causes many DKG
failures.
2020-03-31 07:07:52 +02:00
Alexander Block
d16b7dbcb5 Implement hidden "-pushversion" parameter for PoSe testing 2020-03-31 07:07:52 +02:00