Commit Graph

16071 Commits

Author SHA1 Message Date
Jesse Cohen
bb79aaf93a Fix concurrency-related bugs in ActivateBestChain
If multiple threads are invoking ActivateBestChain, it was possible to have
them working towards different tips, and we could arrive at a less work tip
than we should.  Fix this by introducing a ChainState lock which must
be held for the entire duration of ActivateBestChain to enforce
exclusion in ABC.

Github-Pull: #13023
Rebased-From: a3ae8e68739023e5dba9e5cb190e707ed4603316
2018-05-24 13:55:57 -04:00
Matt Corallo
0948153ea6 Do not unlock cs_main in ABC unless we've actually made progress.
Technically, some internal datastructures may be in an inconsistent
state if we do this, though there are no known bugs there. Still,
for future safety, its much better to only unlock cs_main if we've
made progress (not just tried a reorg which may make progress).

Github-Pull: #13023
Rebased-From: ecc3c4a019e6db30e208b8554b1a3658dcb9a80a
2018-05-24 13:55:52 -04:00
Suhas Daftuar
c71e535aec Bugfix: ensure consistency of m_failed_blocks after reconsiderblock
Github-Pull: #13199
Rebased-From: 11fa6bb66e8c1562305d034903a0dc6aee6eea20
2018-05-24 13:55:49 -04:00
Wladimir J. van der Laan
50b2c9e0df
Merge #13253: [0.16] Further Backports
acdf433822 Hold cs_main while calling UpdatedBlockTip() and ui.NotifyBlockTip (Jesse Cohen)
5ff571e90c [wallet] [tests] Test disallowed multiwallet params (John Newbery)
4c14e7b67c [wallet] Fix zapwallettxes/multiwallet interaction. (John Newbery)
4087dd08e7 RPC Docs: gettxout*: clarify bestblock and unspent counts (David A. Harding)
b8aacd660e [qa] Handle disconnect_node race (Suhas Daftuar)

Pull request description:

  Backports:
  - #13201 [qa] Handle disconnect_node race
  - #13184 RPC Docs: gettxout*: clarify bestblock and unspent counts
  - #13030 [bugfix] [wallet] Fix zapwallettxes/multiwallet interaction.
  - #12988 Hold cs_main while calling UpdatedBlockTip() signal

  to the 0.16 branch.

Tree-SHA512: 8f65002bbafaf9c436f89051b2d79bf6a668fbd07bd317c64af238ed4a7c8efe776864b739a7f2869f1e3daa16f2f4366a85f41b188f9c454879d2c7b309be50
2018-05-24 10:31:36 +02:00
Wladimir J. van der Laan
5d8de76257
wallet: Exit SyncMetaData if there are no transactions to sync
Instead of crash with an assertion error, simply exit the function
`SyncMetaData` if there is no metadata to sync.

Fixes #13110.

Github-Pull: #13265
Rebased-From: b0d2ca9fb66d793e3c0f2e6ede811f1b16c33a9f
Tree-SHA512: 67e446e9ced901e37003a9661b6abea268e2ea648ac3b076d91c8d996de96bed389839a09d579a6562d930bcf501a091eb67454f474aae1174108a8650502072
2018-05-18 14:20:10 +02:00
Jesse Cohen
acdf433822
Hold cs_main while calling UpdatedBlockTip() and ui.NotifyBlockTip
Ensures that callbacks are invoked in the order in which the chain is updated
Resolves #12978

GitHub-Pull: #12988
Rebased-From: d86edd3
2018-05-18 14:10:39 +08:00
John Newbery
5ff571e90c
[wallet] [tests] Test disallowed multiwallet params
Add a test to check that bitcoind fails to start when specifying
-zapwallettxes, -salvagewallet and -upgradewallet when running in
multiwallet mode.

GitHub-Pull: #13030
Rebased-From: 1f83839
2018-05-18 14:09:34 +08:00
John Newbery
4c14e7b67c
[wallet] Fix zapwallettxes/multiwallet interaction.
-zapwallettxes should be disallowed when starting bitcoin in multiwallet
mode.

GitHub-Pull: #13030
Rebased-From: 3476e3c
2018-05-17 10:50:28 +08:00
David A. Harding
4087dd08e7
RPC Docs: gettxout*: clarify bestblock and unspent counts
GitHub-Pull: #13184
Rebased-From: f30e9be
2018-05-17 10:50:28 +08:00
Suhas Daftuar
b8aacd660e
[qa] Handle disconnect_node race
Several tests call disconnect_nodes() on each node-pair in rapid
succession, resulting in a race condition if a node disconnects a peer
in-between the calculation of the nodeid's to disconnect and the
invocation of the disconnectnode rpc call.  Handle this.

GitHub-Pull: #13201
Rebased-From: 09c6699
2018-05-17 10:50:28 +08:00
Wladimir J. van der Laan
feba12fe85
Merge #12967: [0.16] Backports
8fca086 List support for BIP173 in bips.md (Pieter Wuille)
9645aa6 Remove blockmaxsize option from init.cpp (fanquake)
7847b92 Default to defining endian-conversion DECLs in compat w/o config (Matt Corallo)
1720eb3 qt:Show the entire Window when double clicking on taskbar (Chun Kuan Lee)
e055bc0 depends: Fix Qt build with XCode 9.3 (fanquake)
0684cf9 Avoid launching as admin when NSIS installer ends. (JeremyRand)
e802c22 [config] Remove blockmaxsize option (John Newbery)
f118a7a Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251)
f60e84d Limit the number of IPs we use from each DNS seeder (e0)

Pull request description:

  Backports:
  - #12626 Limit the number of IPs addrman learns from each DNS seeder
  - #12650 gui: Fix issue: "default port not shown correctly in settings dialog"
  - #12756 [config] Remove blockmaxsize option
  - #12985 Windows: Avoid launching as admin when NSIS installer ends.
  - #12946 depends: Fix Qt build with XCode 9.3
  - #12998 Default to defining endian-conversion DECLs in compat w/o config
  - #12999 qt: Show the Window when double clicking the taskbar icon
  - #13064 List support for BIP173 in bips.md

  to the 0.16 branch.

Tree-SHA512: 3e6b47c54b2cd2bdd81fbc6176cb31e46423f6e05988984d3a09b3535e3cee101ffb071cf753a4beff3c9f0521eb5de4b7c0424a3e97da801d56b4015847ac0f
2018-05-16 13:41:02 +02:00
Pieter Wuille
8fca086d69
List support for BIP173 in bips.md 2018-05-03 10:02:34 +08:00
fanquake
9645aa6262 Remove blockmaxsize option from init.cpp 2018-05-01 20:57:58 +08:00
Matt Corallo
7847b92605 Default to defining endian-conversion DECLs in compat w/o config
While this isn't a supported build configuration, some build
systems need to build without going through our autotools steps,
so defaulting to something sane may make it easier to build.

Specifically, this fixes the inability to build
rust-bitcoinconsensus on some non-x86 platforms. It needs to build
without our autotools/configure steps to ensure correct compile
args are passed from the rust build system to gcc. Converting the
args from the rust build system to gcc would be a lot of
unmaintainable work.

GitHub-Pull: #12998
Rebased-From: 150b2f0
2018-04-26 23:43:54 +08:00
Chun Kuan Lee
1720eb3018 qt:Show the entire Window when double clicking on taskbar
GitHub-Pull: #12999
Rebased-From: 67bf2aa
2018-04-26 23:43:54 +08:00
fanquake
e055bc0fdf depends: Fix Qt build with XCode 9.3
GitHub-Pull: #12946
Rebased-From: 5b4fc3e
2018-04-26 23:43:54 +08:00
JeremyRand
0684cf9b58 Avoid launching as admin when NSIS installer ends.
The Bitcoin Core NSIS script runs with elevated privileges.  Unfortunately, this means that it launches Bitcoin Core itself with elevated privileges when the user chooses to launch Bitcoin Core at the end of the installation procedure.  This commit works around the issue by having explorer.exe launch Bitcoin Core.  Seems to be a similar approach to what http://nsis.sourceforge.net/ShellExecAsUser_plug-in does, but without a plugin.

h/t to "UK" at https://mdb-blog.blogspot.se/2013/01/nsis-lunch-program-as-user-from-uac.html?showComment=1410158039989#c2463780017054126736 for the sample code.

Fixes #7990.

GitHub-Pull: #12985
Rebased-From: 7d8a8cc
2018-04-26 23:43:54 +08:00
John Newbery
e802c22947 [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.

GitHub-Pull: #12756
Rebased-From: 4757c04
2018-04-26 23:43:54 +08:00
251
f118a7a35b Fix illegal default addProxy and addrSeparateProxyTor settings.
GitHub-Pull: #12650
Rebased-From: 40c5886
2018-04-26 23:43:54 +08:00
e0
f60e84dba4 Limit the number of IPs we use from each DNS seeder
A risk exists where a malicious DNS seeder eclipses a node by returning an enormous number of IP addresses. In this commit we mitigate this risk by limiting the number of IP addresses addrman learns to 256 per DNS seeder.

GitHub-Pull: #12626
Rebased-From: 46e7f80
2018-04-26 23:43:54 +08:00
MarcoFalke
9ea62a3dc4
Merge #13049: [0.16] qa: Backports
41c29f6d1d qa: Fix python TypeError in script.py (MarcoFalke)
7460945e0b [qa] Delete cookie file before starting node (Suhas Daftuar)
0a76ed232a qa: Cache only chain and wallet for regtest datadir (MarcoFalke)
6c26df06ad [qa] Ensure bitcoind processes are cleaned up when tests end (Suhas Daftuar)
df38b130d9 [tests] Test starting bitcoind with -h and -version (John Newbery)
4bdb0ce517 [tests] Fix intermittent rpc_net.py failure. (John Newbery)
0e98f96e42 test: Use wait_until in tests where time was used for polling (Ben Woosley)
1286f3e49a test: Use wait_until to ensure ping goes out (Ben Woosley)
cfebd400ef [test] Round target fee to 8 decimals in assert_fee_amount (Karl-Johan Alm)

Pull request description:

  Similar to #12967 this contains all relevant bugfixes and improvements to the functional test suite.

  I didn't include fixes to make the tests run on Windows, since that is still an ongoing effort and doesn't seem worth to backport.

  As all of these are clean cherry-picks, I suggest reviewers redo the cherry-picks to get the same branch and then run the extended test suite.

Tree-SHA512: 70e1bc28d5572f93796f1ac4d97d77e8146869c15dcc1e3b65a730fa2641283050f769cefd9791d800c758e0a92f11fd55ed0797ccec87b897c7e701d0187f34
2018-04-24 10:02:56 -04:00
MarcoFalke
41c29f6d1d qa: Fix python TypeError in script.py
Github-Pull: #12475
Rebased-From: fa41d68a2e3f2148c3539a11b61ff835e3141c0d
2018-04-20 18:38:41 -04:00
Suhas Daftuar
7460945e0b [qa] Delete cookie file before starting node
If a cookie file exists in a datadir prior to node startup, it must have
been leftover from a prior unclean shutdown. As bitcoind will overwrite
it anyway, delete it before starting up to prevent the test framework
from inadvertently trying to connect using stale credentials.

Github-Pull: #12902
Rebased-From: 75d0e4c5444249f0cf81ed0494e2c2717170b695
2018-04-20 18:38:41 -04:00
MarcoFalke
0a76ed232a qa: Cache only chain and wallet for regtest datadir
Github-Pull: #12638
Rebased-From: fa2310572f4cfcd3322409ce7e37dde155fc4bc9
2018-04-20 18:38:41 -04:00
Suhas Daftuar
6c26df06ad [qa] Ensure bitcoind processes are cleaned up when tests end
Github-Pull: #12904
Rebased-From: e36a0c08529bccc695ec71a7ec1df89367cc1628
2018-04-20 18:38:41 -04:00
John Newbery
df38b130d9 [tests] Test starting bitcoind with -h and -version
Github-Pull: #12843
Rebased-From: 63048ec73d790ecbcfe3186f2520dac4460f56e3
2018-04-20 18:38:41 -04:00
John Newbery
4bdb0ce517 [tests] Fix intermittent rpc_net.py failure.
rpc_net.py would intermittently fail on Travis, probably
due to assuming that two consecutive RPC calls were atomic.
Fix this by only testing that amounts are bounded above and
below rather than equal.

Github-Pull: #12804
Rebased-From: 5a67c0524e5dc98d0e387f189545bc99863916d4
2018-04-20 18:38:41 -04:00
Ben Woosley
0e98f96e42 test: Use wait_until in tests where time was used for polling
Github-Pull: #12553
Rebased-From: 81b0822772169cb697b5994f49398e619d61a12d
2018-04-20 18:38:41 -04:00
Ben Woosley
1286f3e49a test: Use wait_until to ensure ping goes out
Intermittent failure evident here:
https://travis-ci.org/bitcoin/bitcoin/jobs/344021180

Github-Pull: #12545
Rebased-From: 0eb84f30d80847b7392ad42b2d916eaf5923a63c
2018-04-20 18:38:41 -04:00
Karl-Johan Alm
cfebd400ef [test] Round target fee to 8 decimals in assert_fee_amount
The output would produce arbitrary number of decimal points, sometimes resulting in 9 decimals:
AssertionError: Fee of 0.00000415 BTC too low! (Should be 0.000006175 BTC)
The above looks like the expected fee is 6175 sats when in reality it's 618.

Github-Pull: #12486
Rebased-From: 42e1b5d9797b65d3ce13a7cbace15fbedbcd4018
2018-04-20 14:58:48 -04:00
Wladimir J. van der Laan
845838c445
Merge #12636: backport: #11995 Fix Qt build with Xcode 9
f3b8d85 devtools: Exclude patches from lint-whitespace GitHub-Pull: #12442 Rebased-From: fafbf7f (MarcoFalke)
686cb86 [Depends] Fix Qt build with Xcode 9.2 (fanquake)

Pull request description:

  GitHub-Pull: #11995
  Rebased-From: 2b1f794

Tree-SHA512: 73d1c0a87fd135f3ad8bb737b97037ef047e582c41a7473833e82776957caf372fcd0caa764fc4eed792e9998e214ae829bad5535db6d589827085a74b0fa6f4
2018-03-14 16:16:59 +01:00
MarcoFalke
f3b8d85b4b devtools: Exclude patches from lint-whitespace
GitHub-Pull: #12442
Rebased-From: fafbf7f
2018-03-14 21:46:45 +08:00
Wladimir J. van der Laan
46ca8f383e
Merge #12648: [0.16] test: Update trusted git root
faf316a43 test: Update trust git root (Wladimir J. van der Laan)

Pull request description:

  Marco Falke's old key expired, causing a travis error while verifying
  commits 36afd4db44 and before:

      gpg: Good signature from "Marco Falke <marco.falke@tum.de>" [unknown]
      gpg:                 aka "Marco Falke <falke.marco@gmail.com>" [unknown]
      gpg: Note: This key has expired!
      Primary key fingerprint: B8B3 F1C0 E58C 15DB 6A81  D30C 3648 A882 F431 6B9B
        Subkey fingerprint: FE09 B823 E6D8 3A3B C798  3EAA 2D7F 2372 E50F E137

  Update the trusted root commit to the commit after that, to fix
  this issue.

  (cherry picked from commit 7deba93bdc76616011a9f493cbc203d60084416f)

Tree-SHA512: c86cc23d087af54a1448545c122fc67a0c556b5eac8ac7d16eeec8c42d8d0d81b7b5041f9a175787604aa47883b68403cfa01c10a52db64e35be52e559b20ec8
2018-03-13 16:18:15 +01:00
fanquake
686cb86002 [Depends] Fix Qt build with Xcode 9.2
GitHub-Pull: #11995
Rebased-From: 2b1f794
2018-03-12 06:59:48 +08:00
Wladimir J. van der Laan
faf316a43f
test: Update trust git root
Marco Falke's old key expired, causing a travis error while verifying
commits 36afd4db44 and before:

    gpg: Good signature from "Marco Falke <marco.falke@tum.de>" [unknown]
    gpg:                 aka "Marco Falke <falke.marco@gmail.com>" [unknown]
    gpg: Note: This key has expired!
    Primary key fingerprint: B8B3 F1C0 E58C 15DB 6A81  D30C 3648 A882 F431 6B9B
      Subkey fingerprint: FE09 B823 E6D8 3A3B C798  3EAA 2D7F 2372 E50F E137

Update the trusted root commit to the commit after that, to fix
this issue.

(cherry picked from commit 7deba93bdc76616011a9f493cbc203d60084416f)
2018-03-08 10:53:38 -05:00
MarcoFalke
60086ddc34
Merge #12637: backport: #12556 fix version typo in getpeerinfo RPC call help
e730b82b07 fix version typo (Tamas Blummer)

Pull request description:

  GitHub-Pull: #12556
  Rebased-From: d16bfaa

Tree-SHA512: b6626fabdd5f493016334ada0182565c7f834a22dc08dc846c71a190e61193dd4e28754e67b20086d9afeab9a58e38c3621c614eadf368b2d35b9c08a843356a
2018-03-07 16:14:40 -05:00
Tamas Blummer
e730b82b07 fix version typo
GitHub-Pull: #12556
Rebased-From: d16bfaa
2018-03-07 11:40:14 -05:00
MarcoFalke
72a3290c90
Merge #12585: [0.16] depends: Switch to downloading expat from GitHub
25afebc2ba depends: Switch expat download to GitHub (fanquake)

Pull request description:

  @droark [mentioned](https://github.com/bitcoin/bitcoin/pull/12402#issuecomment-370098383) the expat download was failing when trying to gitian build 0.16.
  I tried locally and also saw issues:
  ```
  make download
  Checksum missing or mismatched for expat source. Forcing re-download.
  Fetching expat-2.2.1.tar.bz2 from https://downloads.sourceforge.net/project/expat/expat/2.2.1
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  100   652  100   652    0     0    361      0  0:00:01  0:00:01 --:--:--     0
  /Users/xxx/Github/bitcoin/depends/work/download/expat-2.2.1/expat-2.2.1.tar.bz2.temp: FAILED
  shasum: WARNING: 1 computed checksum did NOT match
  Fetching expat-2.2.1.tar.bz2 from https://bitcoincore.org/depends-sources
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  curl: (22) The requested URL returned error: 404 Not Found
  make[1]: *** [/Users/xxx/Github/bitcoin/depends/sources/download-stamps/.stamp_fetched-expat-expat-2.2.1.tar.bz2.hash] Error 22
  make: *** [download-linux] Error 2
  ```
  This switches to downloading from GitHub, as we are doing in master.

Tree-SHA512: 0e3072ce4d8fee3e2bc434afc7469968c21e01ca35aa2ccbffc25f8e9b00af2e4a5f3f9e4cd5c0cd8e72a10b16205236eb0536380849109a739c09358dbc1394
2018-03-05 08:01:18 -05:00
fanquake
25afebc2ba
depends: Switch expat download to GitHub 2018-03-03 11:58:25 +08:00
Wladimir J. van der Laan
a17fecfdf0
Merge #12518: [0.16] Bump leveldb subtree
835a21b Squashed 'src/leveldb/' changes from c521b3ac65..64052c76c5 (MarcoFalke)

Pull request description:

  The leveldb bump is the same branch/commit as in #12451

Tree-SHA512: 585a55747c75e990c9fd73399e98e548c01bef8b960c0a99844326de43663d004d2211b4689518f2d3e51cc48a732e9c92082939c356793143db411224fa75fa
2018-03-01 19:42:33 +01:00
Wladimir J. van der Laan
ea2e39fd20
qt: Remove faulty and unnecessary en_US translation
This faulty translation contained Chinese messages, and as en_US is our
source language, having a separate translation for it is pointless, remove it.

Tree-SHA512: 8493876926355890aa3b713851ed53d37ffe601280f7e0f45461abfe9671af10dc5c6ce966adb89b663486a46df43b0a36b797da7e1cd719597a7e15914bd4a2
2018-02-27 15:51:22 +01:00
Wladimir J. van der Laan
01f931b928
test: Add missing signal.h header
util_tests.cpp needs to include the signal.h header on FreeBSD.

Reported by denis2342 on IRC.

Github-Pull: #12447
Rebased-From: dd7e42cbb4390788705031ffa0bc893d26f0597e
Tree-SHA512: 10ead029bb59f5d69e37b5679c710f22d64051de26e1ec8342eec4e4dec4d76249e16dff78d192972bcb8d139d99c7555a7cb2fe43b2b911103eab6d6f943b79
2018-02-27 10:49:44 +01:00
Wladimir J. van der Laan
5d41110c74
doc: Clear out release notes post-0.16.0
Moved to: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.16.0.md

Tree-SHA512: 6619521357a1baa5df2d4deb9e75784f6f48711a7b5d5120cf02b47a80e242e41dcf34dadfd1b257bbdcd883c7dd216d36fbfff24abcf03c590bbf0f6bbec520
2018-02-27 10:48:39 +01:00
Henrik Jonsson
b0f692f81e
[depends] Allow depends system to support armv7l
Github-Pull: #12474
Rebased-From: ac91ea64c2b1daec8fee0bfde443c18cf87595ae
Tree-SHA512: 61020cab59532738bc876fc4591923a5b48fee7c5729419bc42654d714cd6cad685e6482e199a17bb57ea97edcd129a15561939d55fa40661d8f051329942bdb
2018-02-23 17:14:13 +01:00
Wladimir J. van der Laan
4b4d7eb255
doc: Remove note about temporary file from release notes
About time, before tagging final.

Tree-SHA512: d54d77a501d227183be7b136025e5ac5e883cd140867368aa552aae89680d536f35f7619f58506069b083c7f718506d42f871fb95e2dcb76ab01cd2159c664be
2018-02-22 20:20:48 +01:00
MarcoFalke
faa6dd27b1
Bump leveldb subtree 2018-02-16 08:59:28 -05:00
MarcoFalke
835a21b424 Squashed 'src/leveldb/' changes from c521b3ac65..64052c76c5
64052c76c5 Merge #15: Add filename to corruption errors
135ed0fb4e Add filename to corruption errors

git-subtree-dir: src/leveldb
git-subtree-split: 64052c76c567cff3dad32d1db0ef969d97b5882f
2018-02-16 08:59:04 -05:00
Wladimir J. van der Laan
a8e62a8426
doc: Update release notes from wiki for rc3
Tree-SHA512: ff0f10dc9672771a941a1bcbf098e7b17ced4c34bd47a1394f16ca0e6f5f4e74e3db4960b2f0a1e7f489e7c438104c32da7754304fc3d64ff29947405e680e1f
2018-02-15 23:32:28 +01:00
Wladimir J. van der Laan
51093478c0
qt: Pre-rc4 translations update
Tree-SHA512: b209b5d404395c8031d92f332885f3ec8f8d040090b0afe55a8b915192c040494c387060cc8da4dd25bdb06d2633f8d42adae27a83933704cccf31d26ad0717c
2018-02-15 23:04:45 +01:00
Pieter Wuille
3762ac127a
Make signrawtransaction accept P2SH-P2WSH redeemscripts
Github-Pull: #12427
Rebased-From: 5f605e172baee35421eb20736601befdd8cad796
Tree-SHA512: caf8c4e1806757d705493de30eea4f6a146a334ca6f6c93bc74cda43abda391b8406dd8ed6765fcde8eb86b3fb55689547ab69a30f34fca0d7896ea8c4e1db67
2018-02-15 22:38:14 +01:00