Commit graph

19403 commits

Author SHA1 Message Date
Wladimir J. van der Laan
a0d657bd31
Merge #15272: doc: correct logging return type and RPC example
e1c27da303 doc: correct logging rpc return type and example (fanquake)

Pull request description:

  Logging status is returned as a bool.
  ```
  src/bitcoin-cli logging "[\"all\"]" "[\"http\"]"
  {
    "net": true,
    "tor": true,
    "mempool": true,
    "http": false,
    "bench": true,
    "zmq": true,
    "db": true,
    "rpc": true,
    "estimatefee": true,
    "addrman": true,
    "selectcoins": true,
    "reindex": true,
    "cmpctblock": true,
    "rand": true,
    "prune": true,
    "proxy": true,
    "mempoolrej": true,
    "libevent": true,
    "coindb": true,
    "qt": true,
    "leveldb": true
  }
  ```

  Also corrects the RPC example so that `libevent` logging will actually be turned off.

Tree-SHA512: 2de7130df51688d2d6636c12fd56326362794118a10efc8100f0bf541a7da00a12a6cd9d75e599a104513a050bbe49b418ea460ee8033ac6cf6ffb8e8e9140d6
2019-01-31 13:38:13 +01:00
Wladimir J. van der Laan
b9d3df8bcd
Merge #15176: docs: Get rid of badly named readme
f24ed6d39f Delete README_osx.md and move its contents into build-osx.md (Martin Erlandsson)

Pull request description:

  With its current name, the file `doc/README_osx.md` looks like an entry point README for OSX users, but it only contains specific instructions on how to build a DMG.

  This PR deletes the file and moves the contents of the file into `doc/build-osx.md`.

Tree-SHA512: 2636b9da967f2a4c0d68cb9a157fb3db137bdb8fbff5d9d004f28b5d816e9c27fddc5c403e6b0c363d1dc9ddc7cac8b295efa01fc691126c0e36e21bb9b3cbd3
2019-01-31 13:33:04 +01:00
Wladimir J. van der Laan
37d09b251c
Merge #15275: Add gitian PGP key for hebasto
a6cd50dec6 Add gitian PGP key for hebasto (Hennadii Stepanov)

Pull request description:

Tree-SHA512: 3ce574d92b17b0e00901b8f58c3ad57e3c98d60aab51f15af50b3d65c882ace39a98c376298b6136aa2e29bc0856609dd492493a0b93760edd8f0a49f31d5045
2019-01-31 10:50:21 +01:00
Wladimir J. van der Laan
cb77dc820f
Merge #15292: Remove 'boost::optional'-related false positive -Wmaybe-uninitialized warnings on GCC compiler
2d483142a7 Remove 'boost::optional'-related gcc warnings (Hennadii Stepanov)

Pull request description:

  #14711 introduced some warnings when building with gcc compiler.

  See:
  - https://github.com/bitcoin/bitcoin/pull/14711#issuecomment-454760017 by @laanwj
  - https://github.com/bitcoin/bitcoin/pull/14711#pullrequestreview-193702611 by @ryanofsky

  This gcc [issue](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47679) has been known since version 4.6.0 and last updated in 2017.
  From the boost [docs](https://www.boost.org/doc/libs/1_69_0/libs/optional/doc/html/boost_optional/quick_start/optional_automatic_variables.html):
  > The default constructor of `optional` creates an _uninitialized_ `optional` object.

  Also: [False positive with -Wmaybe-uninitialized](https://www.boost.org/doc/libs/1_69_0/libs/optional/doc/html/boost_optional/tutorial/gotchas/false_positive_with__wmaybe_uninitialized.html) ([pointed out](https://github.com/bitcoin/bitcoin/pull/15292#issuecomment-459063170) by @Empact)

  This PR removes these warnings.

  cc: @Empact @practicalswift

Tree-SHA512: 752ae3c3ca6282bbf98726236fbc3069ab9d1aee57ae2ec2668b32e4541e7bc1acb15b7d6fa9e2b6daf1ec29c0987a1053ee1ca0f523b71367ff911221c58c94
2019-01-30 23:39:00 +01:00
Hennadii Stepanov
2d483142a7
Remove 'boost::optional'-related gcc warnings 2019-01-30 22:44:28 +02:00
MarcoFalke
bb36f5e24b
Merge #15276: travis: Compile once on trusty
fa5ce3f10e travis: Compile trusty with depends for now (MarcoFalke)
fa83999d92 travis: Compile once on trusty (MarcoFalke)

Pull request description:

  To avoid accidentally regressing again on #15172, we should compile at least once with gcc4.8 (the minimum required version)

  Note that this uses the trusty image, which will be removed in a few months from the docker hub, so in the future it had to be switched to the centos7 (or similar) image, which should come with gcc4.8 as well.

Tree-SHA512: 9d1704464bde8dbaf3319ac35f72d32dce549818730d3b2fb63df817f84a88dd64aa3419b97a57c1120ffb254784503b7d2675b1291d4ed073cd2a2488aa717d
2019-01-30 15:11:52 -05:00
Wladimir J. van der Laan
9553102c38
Merge #15043: test: Build fuzz targets into seperate executables
2ca632e5b4 test: Build fuzz targets into seperate executables (MarcoFalke)
fab4bed68a [test] fuzz: make test_one_input return void (MarcoFalke)

Pull request description:

  Currently our fuzzer is a single binary that decides on the first few bits of the buffer what target to pick. This is ineffective as the fuzzer needs to "learn" how the fuzz targets are organized and could get easily confused. Not to mention that the (seed) corpus can not be categorized by target, since targets might "leak" into each other. Also the corpus would potentially become invalid if we ever wanted to remove a target...

  Solve that by building each fuzz target into their own executable.

Tree-SHA512: a874febc85a3c5e6729199542b65cad10640553fba6f663600c827fe144543744dd0f844fb62b4c95c6a04c670bfce32cdff3d5f26de2dfc25f10b258eda18ab
2019-01-30 21:10:21 +01:00
Wladimir J. van der Laan
77339e5c24
Merge #15163: Correct units for "-dbcache" and "-prune"
6f6514a080 Correct units for "-dbcache" and "-prune" (Hennadii Stepanov)

Pull request description:

  Actually, all `dbcache`-related values in the code are measured in MiB (not in megabytes, MB) or in bytes (e.g., `nTotalCache`).

  See: https://github.com/bitcoin/bitcoin/blob/master/src/txdb.h

  ba8c8b2227/src/init.cpp (L1405-L1424)

  Also, "-prune" is fixed:
  1. The GUI values in GB are translated to the node values in MiB correctly.
  2. The maximum of the "prune" `QSpinBox` is not limited by default value of 99 (GB).

  Fix: #15106

Tree-SHA512: 151ec43b31b1074db8b345fedb1dcc10bde225899a5296bfc183f57e1553d13ac27db8db100226646769ad03c9fcab29d88763065a471757c6c41ac51108459d
2019-01-30 20:22:57 +01:00
MarcoFalke
04226f8706
Merge #15279: wallet: Clarify rescanblockchain doc
fa5e6ef55c wallet: Fixup rescanblockchain result doc (MarcoFalke)

Pull request description:

  This was probably accidentally added to the wrong line when addressing the feedback here: https://github.com/bitcoin/bitcoin/pull/7061#discussion_r142199778

  I already added the default values in #14877, but it could be clarified more that this really has no specific block height as default value, since the tip can change during a rescan.

Tree-SHA512: 48a3c5143e2b7129ee8f396d2e77550cb393fbe45f5936aeebeb7a201d61560336a3ae47b26bb757a4dbbe217e06abfd67a5a673aef266b6c4d7a80d049a2b49
2019-01-30 13:35:55 -05:00
MarcoFalke
a47319dada
Merge #15159: [RPC] Remove lookup to UTXO set from GetTransaction
04da9f4834 [RPC] Update getrawtransaction interface (Amiti Uttarwar)

Pull request description:

  - stop checking unspent UTXOs for a transaction when txindex is not enabled, as per conversation here: https://github.com/bitcoin/bitcoin/issues/3220#issuecomment-377458383
  - code contributed by sipa

Tree-SHA512: aa07353bccc14b81b7803992a25d076d6bc06d15ec7c1b85828dc10aea7e0498d9b49f71783e352ab8a14b0bb2010cfb7835de3dfd1bc6f2323f460449348e66
2019-01-30 11:18:44 -05:00
Wladimir J. van der Laan
bd8bda161e
Merge #15243: [doc] add notes on release notes
65bc38d1c1 [doc] add notes on release notes (John Newbery)

Pull request description:

  Explains when and how release notes should be written.

Tree-SHA512: 94085d5a30499f41e6d1821b9f157aea40b3cff61a8ba606fed1b239e794ffe6769f985f53400715d712d12aadaa8db8cfca08dd1700a1fe17df86e0e554eac2
2019-01-30 16:18:57 +01:00
Wladimir J. van der Laan
29396bd669
Merge #15270: Pull leveldb subtree
4f2e6c8b88 Squashed 'src/leveldb/' changes from 524b7e36a8..f545dfabff (MarcoFalke)

Pull request description:

  Some windows-related fixes.

  Sanity check with:

  ```
  git fetch https://github.com/bitcoin-core/leveldb
  ./test/lint/git-subtree-check.sh src/leveldb

Tree-SHA512: ff94907ff3075b81cffb733129673a9bfd2abbe84240686b29274382b64b4e5845880236458043d6db0332bf70d12942d9c0e68b4fffab43931103d224cb59d4
2019-01-30 15:52:14 +01:00
Hennadii Stepanov
6f6514a080
Correct units for "-dbcache" and "-prune"
All dbcache-related values in the code are measured in MiB (not in
megabytes, MB) or in bytes.
The GUI "-prune" values in GB are translated to the node values in MiB
correctly. The maximum of the "-prune" QSpinBox is not limited by the
default value of 99 (GB).
Also, this improves log readability.
2019-01-30 07:17:22 +02:00
MeshCollider
72ca72e637
Merge #14711: Remove uses of chainActive and mapBlockIndex in wallet code
44de1561a Remove remaining chainActive references from CWallet (Russell Yanofsky)
db21f0264 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky)
2ffb07929 Add findFork and findBlock to the Chain interface (Russell Yanofsky)
d93c4c1d6 Add time methods to the Chain interface (Russell Yanofsky)
700c42b85 Add height, depth, and hash methods to the Chain interface (Russell Yanofsky)

Pull request description:

  This change removes uses of `chainActive` and `mapBlockIndex` globals in wallet code. It is a refactoring change which does not affect external behavior.

  This is the next step in the larger #10973 refactoring change, which removes all other accesses to node global variables from wallet code. Doing this is useful to provide a better defined interface between the wallet and node, and necessary to allow wallet and node code to run in separate processes in #10102.

Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8
2019-01-30 13:03:32 +13:00
MarcoFalke
2ca632e5b4 test: Build fuzz targets into seperate executables 2019-01-29 19:03:06 -05:00
Jonas Schnelli
2d790e82c8
Merge #14929: net: Allow connections from misbehavior banned peers
0297be61a Allow connections from misbehavior banned peers. (Gregory Maxwell)

Pull request description:

  This allows incoming connections from peers which are only banned
   due to an automatic misbehavior ban if doing so won't fill inbound.

  These peers are preferred for eviction when inbound fills, but may
   still be kept if they fall into the protected classes.  This
   eviction preference lasts the entire life of the connection even
   if the ban expires.

  If they misbehave again they'll still get disconnected.

  The main purpose of banning on misbehavior is to prevent our
   connections from being wasted on unhelpful peers such as ones
   running incompatible consensus rules.  For inbound peers this
   can be better accomplished with eviction preferences.

  A secondary purpose was to reduce resource waste from repeated
   abuse but virtually any attacker can get a nearly unlimited
   supply of addresses, so disconnection is about the best we can
   do.

  This can reduce the potential from negative impact due to incorrect misbehaviour bans.

Tree-SHA512: 03bc8ec8bae365cc437daf70000c8f2edc512e37db821bc4e0fafa6cf56cc185e9ab40453aa02445f48d6a2e3e7268767ca2017655aca5383108416f1e2cf20f
2019-01-29 13:41:04 -10:00
MarcoFalke
fa5e6ef55c
wallet: Fixup rescanblockchain result doc 2019-01-29 12:52:55 -05:00
fanquake
e1c27da303
doc: correct logging rpc return type and example 2019-01-29 23:05:52 +08:00
MarcoFalke
7275365c9b
Merge #14987: RPCHelpMan: Pass through Result and Examples
faa1522e5e RPCHelpMan: Pass through Result and Examples (MarcoFalke)

Pull request description:

  Passing the rpc result and rpc examples through `RPCHelpMan` makes it clear in what order they appear in the stringified version. Future improvements could then autoformat or autogenerate them.

Tree-SHA512: b32a5c178cc80f50a7e9b93a38e2b26d5994188ecafe9e61bbc599941b44b9b0e4e4be6413d4464fac6e8e73661a191a77d34917f2e6293de19fb59519dd4487
2019-01-29 09:55:48 -05:00
MarcoFalke
fa5ce3f10e
travis: Compile trusty with depends for now 2019-01-28 13:51:41 -05:00
MarcoFalke
fa83999d92
travis: Compile once on trusty 2019-01-28 11:40:56 -05:00
MarcoFalke
d6e700e40f
Merge #15248: rpc: Compile on GCC4.8
fa5f890aeb rpc: Compile on GCC4.8 (MarcoFalke)

Pull request description:

  GCC 4.8 is lacking some C++11 signatures (see "Adjust C++11 signatures to take a const_iterator." in GCC 4.9: 3d2b2f494d)

  Fix that by changing the code to use the pre-GCC 4.9 signature.

  Can be reverted after #13356.

  Fixes #15172 (reports on `Linux Mint 17.3 Rosa` and `CentOS Linux release 7.5.1804 (Core)`)

Tree-SHA512: 0c0b18968270ad4fcd0c2000c57485be881a461135dac3ad0bdab22c1a2292cf6b28ebeb930ccaa0290ff20ce87547fd07ab8189c4c4fb54d652a3d0bc9615f8
2019-01-28 10:39:51 -05:00
Hennadii Stepanov
a6cd50dec6
Add gitian PGP key for hebasto 2019-01-28 14:01:00 +02:00
MarcoFalke
fa5f890aeb
rpc: Compile on GCC4.8 2019-01-27 12:33:23 -05:00
Wladimir J. van der Laan
5e0c0fd62f
Merge #15254: Trivial: fixup a few doxygen comments
70e7cee960 Trivial: Doxygenize existing CBufferedFile and VectorReader comments (Ben Woosley)
9431e1b915 Trivial: fixup a few doxygen comments (Ben Woosley)

Pull request description:

  These were not declared properly, so their results are not properly
  processed. E.g.:
  https://dev.visucore.com/bitcoin/doxygen/rpcdump_8cpp.html#a994c8748aaa60fbb78009ff8a0638dea
  https://dev.visucore.com/bitcoin/doxygen/coins_8cpp.html#aa03af24ef3570144b045f4fca7a0d603
  https://dev.visucore.com/bitcoin/doxygen/wallet_2wallet_8cpp.html#a5c2a7725ff8796f03471f844ecded3d9

  > A third alternative is to use a block of at least two C++ comment lines, where each line starts with an additional slash or an exclamation mark.

  http://www.doxygen.nl/manual/docblocks.html

Tree-SHA512: c13fd48ac78f25e51b1281385747e8be4bd6e27e0a0f8704608aa5c66c16715c639f1cf27018b1bf05fc2eaed6c7b9be05a68365ffe1d88dd3f400d453b7bead
2019-01-27 16:17:58 +01:00
Amiti Uttarwar
04da9f4834 [RPC] Update getrawtransaction interface 2019-01-26 18:36:53 -08:00
MarcoFalke
b78f6c61c4
Merge #15258: Scripts and tools: Fix devtools/copyright_header.py to always honor exclusions
ad5e5a105e Scripts and tools: Drop no-longer-relevant copyright holder names (Ben Woosley)
2434ab5c2a Scripts and tools: Fix devtools/copyright_header.py to always honor exclusions (Ben Woosley)

Pull request description:

  This script compared paths relative to the report directory to test for exclusion,
  meaning the `EXCLUDE_DIRS` directory exclusions did not work properly, as
  they were relative to the project root.

  Fix this by creating absolute paths through the combination of:
  'git ls-files --full-name' and 'git rev-parse --show-toplevel'

  Once this is done, we can stop testing for the names that would otherwise
  appear when exclusion of leveldb, secp256k1, etc., did not work as intended.

Tree-SHA512: 0fa9b0a627e8ddb2d899eedee927ea8a809cb2ceee87c0920c151e5ca2103f7d8c463e3b379d5e2eb925fc3d7d8003082ffd9cbc03907ca0c448e8238e3a2684
2019-01-26 13:58:24 -05:00
MarcoFalke
fa6180188b
Pull leveldb subtree 2019-01-26 12:45:48 -05:00
MarcoFalke
4f2e6c8b88 Squashed 'src/leveldb/' changes from 524b7e36a8..f545dfabff
f545dfabff Merge #18: Use utf-8 to decode filename
f8e797a058 Use utf-8 to decode filename
2fc114812a Merge #14: Fixes to allow building with msvc.
d6eab93138 Fixes to allow building with msvc.

git-subtree-dir: src/leveldb
git-subtree-split: f545dfabff4c2e9836efed094dba99a34fbc6b88
2019-01-26 12:44:28 -05:00
MarcoFalke
fab4bed68a
[test] fuzz: make test_one_input return void
The return value is always 0 and not used, so might as well return void
2019-01-25 19:05:07 -05:00
Ben Woosley
70e7cee960
Trivial: Doxygenize existing CBufferedFile and VectorReader comments 2019-01-25 12:32:37 -08:00
MarcoFalke
faa1522e5e
RPCHelpMan: Pass through Result and Examples 2019-01-25 14:16:07 -05:00
MarcoFalke
ab46fe6ec1
Merge #15249: Docs: Update python docs to reflect that wildcard imports are disallowed
f618c58b75 Docs: Update python docs to reflect that wildcard imports are disallowed (Ben Woosley)

Pull request description:

  These have been disallowed via flake8 since: #13054

Tree-SHA512: f41651fd883e3786a7e87c4aa4c54749308e576287f2f88da3f1d8d0f59e14519d99061f1efd05b8745f495f87a14286cea576f1507d10ccd226f8cf2f2b3cc8
2019-01-25 11:53:41 -05:00
Ben Woosley
ad5e5a105e
Scripts and tools: Drop no-longer-relevant copyright holder names
Now that leveldb, secp256k1, etc. are reliably excluded, these
names will not show up in the searched files.
2019-01-24 23:46:12 -08:00
Ben Woosley
2434ab5c2a
Scripts and tools: Fix devtools/copyright_header.py to always honor exclusions
This script compared paths relative to the report directory to test for exclusion,
meaning the directory exclusions did not work properly, as they were relative to
the project root.

Fix this by creating absolute paths through the combination of:
'git ls-files --full-name' and 'git rev-parse --show-toplevel'
2019-01-24 23:46:06 -08:00
MarcoFalke
d14ef5721f
Merge #15233: Prevent mutex lock fail even if --enable-debug
b09dab0f2d Prevent mutex lock fail even if --enable-debug (Akio Nakamura)

Pull request description:

  This PR intends to resolve #15227.

  ```configure --enable-debug```  enables ```#ifdef DEBUG_LOCKORDER```.

  Then ```lockdata``` (in sync.cpp) will be initialized same as other static objects.

  But unfortunately, ```lockdata.push_lock()``` was called before its initialization (via initializing ```signatureCache``` which is declared in ```script/sigcache.cpp```) on macOS.

  This PR apply the "Construct On First Use Idiom" to ```lockdata``` to prevent it.

  edited --- fix typo.

Tree-SHA512: 59df99ef78a335b1b7ebed7207d4719ea4412900eea38739f6e8eaaba1f594e1950044851659ce83f4f69813fc96978244bd176676e1aa2277c813ede832e6fb
2019-01-25 01:11:24 -05:00
Akio Nakamura
b09dab0f2d Prevent mutex lock fail even if --enable-debug
This PR intends to resolve #15227.

"configure --debug-enabled" enables "#ifdef DEBUG_LOCKORDER".
Then "lockdata" (in sync.cpp) will be initialized same as other
static objects.

But unfortunately, lockdata.push_lock() was called before its
initialization (via initializing signatureCache which is declared
in script/sigcache.cpp) on macOS.

This PR apply the "Construct On First Use Idiom" to "lockdata"
to prevent it.
2019-01-25 13:21:59 +09:00
Ben Woosley
9431e1b915
Trivial: fixup a few doxygen comments
These were not declared properly, so their results are not properly
processed. E.g.:
https://dev.visucore.com/bitcoin/doxygen/rpcdump_8cpp.html#a994c8748aaa60fbb78009ff8a0638dea
https://dev.visucore.com/bitcoin/doxygen/coins_8cpp.html#aa03af24ef3570144b045f4fca7a0d603
https://dev.visucore.com/bitcoin/doxygen/wallet_2wallet_8cpp.html#a5c2a7725ff8796f03471f844ecded3d9
2019-01-24 19:47:07 -08:00
Ben Woosley
f618c58b75
Docs: Update python docs to reflect that wildcard imports are disallowed 2019-01-24 16:57:41 -08:00
John Newbery
65bc38d1c1 [doc] add notes on release notes 2019-01-24 11:14:43 -05:00
Wladimir J. van der Laan
72bd4ab867
Merge #15193: Default -whitelistforcerelay to off
a36d97d866 Default -whitelistforcerelay to off (Suhas Daftuar)

Pull request description:

  No one seems to use this "feature", and at any rate the behavior of relaying transactions when they violate local policy is error-prone, if we ever consider changing the ban behavior of our software from one version to the next.

  Defaulting this to off means that users who use -whitelist won't be unexpectedly surprised by this interaction.  If anyone is still relying on this feature, it can still be explicitly turned on.

Tree-SHA512: 52650ad464a728d1648f496751e3f713077ea3a1de7278ed03531b2e8723e63cf2f6f41b56c98c0f73ffa22c36e01d9170b409ab452c737aca35b7ecd7a6b448
2019-01-24 15:25:17 +01:00
Wladimir J. van der Laan
5eb32d2384
Merge #15223: Doc: add information about security to the JSON-RPC doc
5a5ea93e87 Doc: add information about security to the JSON-RPC doc (David A. Harding)

Pull request description:

  This documents some information about using the RPC interface securely, as suggested in https://github.com/bitcoin-core/bitcoincore.org/pull/637 by @luke-jr and @TheBlueMatt.  I think it should fit in well with #14458, but is not dependent on it (and shouldn't have any significant merge conflicts with it).

Tree-SHA512: e09d82c3029ed17a8bcf50722ea25a8c6c514731f3bce01908cbb6fe48bc96a3068a025beabebc602d18e1bc0dc3f2602848abc05dca1d3efe2a988ee50068c0
2019-01-24 14:18:17 +01:00
Jonas Schnelli
73a6bac9ff
Merge #15196: [test]: Update all subprocess.check_output functions to be Python 3.4 compatible
fdf82ba18 Update all subprocess.check_output functions in CI scripts to be Python 3.4 compatible (Graham Krizek)

Pull request description:

  CI is failing the `lint` stage on every Cron run (regular PR/Push runs still pass). The failure was introduced in 74ce326 and has been broken since. The Python version running in CI was downgraded to 3.4 from 3.6. There were a couple files that were using the `encoding` argument in the `subprocess.check_output` function. This was introduced in Python 3.6 and therefore broke the scripts that were using it. The `universal_newlines` argument was used as well, but in order to use it we must be able to set encoding because of issues on some BSD systems.

  To get CI to pass, I removed all `universal_newline` and `encoding` args to the `check_ouput` function. Then I decoded all `check_output` return values. This should keep the same behavior but be Python 3.4 compatible.

Tree-SHA512: f5e5885e98cf4777be9cc254446a873eedb03bdccbd8e06772a964db95e9fcf46736aa9cdcab1d8f123ea9f4947ed6020679898d8b2f47ffb1d94c21a4b08209
2019-01-23 20:43:53 -10:00
David A. Harding
5a5ea93e87
Doc: add information about security to the JSON-RPC doc 2019-01-23 18:25:44 -05:00
Jonas Schnelli
82cf6813a4
Merge #14353: REST: add blockhash call, fetch blockhash by height
42ff30ec6 [Docs] add short documentation for /rest/blockhashbyheight (Jonas Schnelli)
579d418f7 [QA] add rest tests for /rest/blockhashbyheight/<HEIGHT>.<FORMAT> (Jonas Schnelli)
eb9ef04c4 REST: add "blockhashbyheight" call, fetch blockhash by height (Jonas Schnelli)

Pull request description:

  Completes the REST interface for trivial block exploring by adding a call that allows to fetch the blockhash in the main chain by a given height.

Tree-SHA512: 94be9e56718f857279b11cc16dfa8d04f3b5a762e87ae54281b4d87247c71c844895f4944d5a47f09056bf851f4c4761ac4fbdbaaee957265d14de5c1c73e8d2
2019-01-22 19:59:02 -10:00
Wladimir J. van der Laan
94167e2b5b
Merge #15208: Qt: remove macOS launch-at-startup when compiled with > macOS 10.11, fix memory missmanagement
da6011826a Fix macOS launch-at-startup memory issue (Jonas Schnelli)
516437a1b7 Qt: remove macOS launch-at-startup option when compiled with > macOS 10.11 (Jonas Schnelli)

Pull request description:

  The launch-at-startup API Bitcoin Core uses on macOS where removed in macOS 10.11 leading to a segmentation-fault due to the weak-linking when not actively compiled against SDK 10.11 (`-mmacosx-version-min=10.11`)

  This PR removes the launch-at-startup feature on macOS when compiled with macOS min version > 10.11 (the default is always the macOS version you compile on).

  **The depends built binaries (Gitian) are not affected since we are building with min macOS 10.10.**

  Users self compiling on macOS > 10.11 can re-enable the feature by compiling with min version <= 10.11 (`CXXFLAGS="-mmacosx-version-min=10.11" CFLAGS="-mmacosx-version-min=10.11" ./configure`)

  **Isn't there a new API from Apple?**
  Yes, [there is](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html).
  It will require to create a helper application which needs to be embedded in the .app folder (needs code signing as well). Developers willing to go down that rabbit hole are welcome.

  Fixes #15142

Tree-SHA512: fa9cc4e39d5a2d2559919b7e22b7766f5e0269a361719294d4a4a2df2fd9d955e5b23b5907e68023fdeee297f652f844f3c447904bf18f9c1145348ad101c432
2019-01-22 22:53:17 +01:00
Gregory Maxwell
0297be61ac Allow connections from misbehavior banned peers.
This allows incoming connections from peers which are only banned
 due to an automatic misbehavior ban if doing so won't fill inbound.

These peers are preferred for eviction when inbound fills, but may
 still be kept if they fall into the protected classes.  This
 eviction preference lasts the entire life of the connection even
 if the ban expires.

If they misbehave again they'll still get disconnected.

The main purpose of banning on misbehavior is to prevent our
 connections from being wasted on unhelpful peers such as ones
 running incompatible consensus rules.  For inbound peers this
 can be better accomplished with eviction preferences.

A secondary purpose was to reduce resource waste from repeated
 abuse but virtually any attacker can get a nearly unlimited
 supply of addresses, so disconnection is about the best we can
 do.
2019-01-22 21:10:48 +00:00
Suhas Daftuar
a36d97d866 Default -whitelistforcerelay to off 2019-01-22 12:18:45 -05:00
Jonas Schnelli
da6011826a
Fix macOS launch-at-startup memory issue 2019-01-21 22:43:03 -10:00
Jonas Schnelli
516437a1b7
Qt: remove macOS launch-at-startup option when compiled with > macOS 10.11 2019-01-21 22:42:51 -10:00