Commit Graph

14850 Commits

Author SHA1 Message Date
John Newbery cef03198dc [tests] fixups from set_test_params()
Github-Pull: #11215
Rebased-From: 3918d93f3c
2017-10-03 18:45:11 +02:00
John Newbery 82bf6fc6d4 [tests] Functional tests must explicitly set num_nodes
Github-Pull: #11121
Rebased-From: 7148b74dc3
2017-10-03 18:44:16 +02:00
John Newbery 801d2ae924 [tests] don't override __init__() in individual tests
Almost all test scripts currently need to override the __init__()
method. When they do that they need to call into super().__init__() as
the base class does some generic initialization.

This commit makes the base class __init__() call into set_test_params()
method. Individual test cases can override set_test_params() to setup
their test parameters.

Github-Pull: #11121
Rebased-From: 5448a1471d
2017-10-03 18:43:43 +02:00
John Newbery bb5e7cb308 [tests] Avoid passing around member variables in test_framework
Github-Pull: #11121
Rebased-From: 6cf094a022
2017-10-03 18:43:29 +02:00
John Newbery 4d3ba18386 [tests] TestNode: separate add_node from start_node
Separates the act of creating a TestNode object from starting the node.
The test_framework now keeps track of its list of TestNodes, and test
writers can call start_node() and stop_node() without having to update
the self.nodes list.

Github-Pull: #11121
Rebased-From: 36b6268670
2017-10-03 18:43:15 +02:00
John Newbery 11a5992c90 [tests] fix - use rpc_timeout as rpc timeout
Github-Pull: #11121
Rebased-From: be2a2ab6a6
2017-10-03 18:42:57 +02:00
Cristian Mircea Messel 847c75ec64 Add getmininginfo functional test
Github-Pull: #11150
Rebased-From: 4f2905b76b
2017-10-03 18:41:34 +02:00
Jorge Timón 2a5d099e47 RPC: gettxout: Slightly improve doc and tests
Github-Pull: #10859
Rebased-From: 6d2d2eb493
2017-10-03 18:40:05 +02:00
Russell Yanofsky 2cb720ae61 Acquire cs_main lock before cs_wallet during wallet initialization
CWallet::MarkConflicted may acquire the cs_main lock after
CWalletDB::LoadWallet acquires the cs_wallet lock during wallet initialization.
(CWalletDB::LoadWallet calls ReadKeyValue which calls CWallet::LoadToWallet
which calls CWallet::MarkConflicted). This is the opposite order that cs_main
and cs_wallet locks are acquired in the rest of the code, and so leads to
POTENTIAL DEADLOCK DETECTED errors if bitcoin is built with -DDEBUG_LOCKORDER.

This commit changes CWallet::LoadWallet (which calls CWalletDB::LoadWallet) to
acquire both locks in the standard order. It also fixes some tests that were
acquiring wallet and main locks out of order and failed with the new locking in
CWallet::LoadWallet.

Error was reported by Luke Dashjr <luke-jr@utopios.org> in
https://botbot.me/freenode/bitcoin-core-dev/msg/90244330/

Github-Pull: #11126
Rebased-From: de9a1db2ed
2017-10-03 18:35:39 +02:00
Wladimir J. van der Laan b278a43646 rpc: Write authcookie atomically
Use POSIX rename atomicity at the `bitcoind` side to create a working
cookie atomically:

- Write `.cookie.tmp`, close file
- Rename `.cookie.tmp` to `.cookie`

This avoids clients reading invalid/partial cookies as in #11129.

Github-Pull: #11131
Rebased-From: 82dd7195e1
2017-10-03 18:34:30 +02:00
John Newbery 716066dbea [tests] Add bitcoin_cli.py test script
Github-Pull: #10798
Rebased-From: c6ec4358a7
2017-10-03 18:31:44 +02:00
John Newbery 016b9ada21 [tests] add TestNodeCLI class for calling bitcoin-cli for a node
Github-Pull: #10798
Rebased-From: b23549f6e6
2017-10-03 18:31:40 +02:00
MarcoFalke 5398f205e3 qa: Move wait_until to util
Github-Pull: #11068
Rebased-From: 08ce33f8e9
2017-10-03 18:29:48 +02:00
John Newbery 1d80d1e319 [tests] fix timeout issues from TestNode
Fixes a couple of bugs from the introduction of TestNode:

- test scripts were no longer able to specify a custom timeout for
starting a node. Therefore tests with nodes that take a long time to
start up (eg pruning.py) would fail.
- the test for whether a node has failed on start up was broken
by changing 'assert x is None' to 'assert not x'. Since
subprocess.poll() can return None (indicating the node is still running)
or 0 (indicating the node exited with return code 0), this was a
regression.

Github-Pull: #11077
Rebased-From: 2b4ea520b7
2017-10-03 18:29:34 +02:00
Wladimir J. van der Laan c276c1e1d1 test: Increase initial RPC timeout to 60 seconds
When running the tests locally with a parallelism of 4 on an otherwise
busy system, RPC can take quite a wait to come up.

Change the timeout to 60 seconds just to be safe.

Github-Pull: #11091
Rebased-From: c1470a058f
2017-10-03 18:23:41 +02:00
practicalswift 50bd3f626d Avoid returning a BIP9Stats object with uninitialized values
Uninitialized data potentially used in `rpc/blockchain.cpp`:

```
static UniValue BIP9SoftForkDesc(const Consensus::Params& consensusParams, Consensus::DeploymentPos id)
{
    ...
    const ThresholdState thresholdState = VersionBitsTipState(consensusParams, id);
    ...
    if (THRESHOLD_STARTED == thresholdState)
    {
        UniValue statsUV(UniValue::VOBJ);
        BIP9Stats statsStruct = VersionBitsTipStatistics(consensusParams, id);
        statsUV.push_back(Pair("period", statsStruct.period));
        statsUV.push_back(Pair("threshold", statsStruct.threshold));
        statsUV.push_back(Pair("elapsed", statsStruct.elapsed));
        statsUV.push_back(Pair("count", statsStruct.count));
        statsUV.push_back(Pair("possible", statsStruct.possible));
        rv.push_back(Pair("statistics", statsUV));
    }
    ...
    return rv;
}
```

Github-Pull: #10957
Rebased-From: 3eb53b8671
2017-10-03 18:19:35 +02:00
John Newbery fc2aa09cf3 [tests] Introduce TestNode
TestNode is a class responsible for all state related to a bitcoind node
under test. It stores local state, is responsible for tracking the
bitcoind process and delegates unrecognised messages to the RPC
connection.

This commit changes start_nodes and stop_nodes to start and stop the
bitcoind nodes in parallel, making test setup and teardown much faster.

Github-Pull: #10711
Rebased-From: 7897338918
2017-10-03 18:18:17 +02:00
Karl-Johan Alm 9e8aae31c1 [wallet] Close DB on error.
Github-Pull: #11017
Rebased-From: 03bc719a85
2017-10-03 18:15:46 +02:00
Wladimir J. van der Laan fb7b529384
doc: Release notes for 0.15.0.1
Tree-SHA512: ce2e874659ea59fa3f1f34a02ed910f655db2ec5b030ef40f89dca0b90932a3b579768db4e7f30773ca9cbbf72891369efe34fdbf111669c3bb583e8c69eda85
2017-09-15 16:00:59 +02:00
Wladimir J. van der Laan f266f2668b
qt: Translations update pre-0.15.0.1
Tree-SHA512: 942fbba8a959ec5430afeecbb663731944fd646fa3b997252e599d835faff12f329d1b70509b161275c3c88845de031357c8317d7f7c801e24be488912cf4035
2017-09-15 15:38:06 +02:00
Wladimir J. van der Laan 7123b95bea
doc: Bump manpages to 0.15.0.1
Tree-SHA512: 8097788934031d0ef47ebac8ddda10e4d124c14e8d0ccee697faba971a68ad7bfcc2f838ae53b1110719ade879743187d170c4d2e69446343c6e2e89febf633c
2017-09-15 15:20:37 +02:00
Wladimir J. van der Laan 843233277d
build: Bump version to 0.15.0.1
Tree-SHA512: 7ee9ff3941737aae3086cabcd792c6a00054e911045b4ee198bdc03ffed01328bce504bf7d4fb177e78da8c01812d1a5081dca13e767433aa9ac441e979102e6
2017-09-15 14:59:07 +02:00
Matt Corallo 46c8d23dad
Fix Qt 0.14.2->0.15.0 segfault if "total at least" is selected
A button was removed, so now button(1) is nullptr

Github-Pull: #11332
Rebased-From: cdaf3a1f9e
Tree-SHA512: 0a49bf4e9ab08e5869170c8a212da60c9a6b90c36427d788de384aa4be6d87bb5e00a21edf78eed34f81bbc554b6f15565bb9b493dafcbfe9d6f4664d7424d9d
2017-09-15 09:56:11 +02:00
Wladimir J. van der Laan 7c53587101
doc: Clean out release notes on 0.15 branch
Prepare for 0.15.1

Tree-SHA512: d306369ebf2090dd3f74ead6ca6b9f3f2d56bcde6eb6aaab22ac38a5f7ab6cdf3da1142ad6fe266f793f27bbed4247397375f6177f2c7ccc1a57de9acaa5a181
2017-09-14 16:17:21 +02:00
Wladimir J. van der Laan 3751912e8e
Merge #11295: doc: Old fee_estimates.dat are discarded by 0.15.0
fa120bd01 doc: Old fee_estimates.dat are discarded by 0.15.0 (MarcoFalke)

Pull request description:

Tree-SHA512: b4b1cb3efa307a7a0c37b8cc0a35f8fd31c8268747be59efba6530c36ba6423d9fb37e752782c7ebd5bc22a4aa1d2730b0e9ab560239fb2874afd42197ed9fd0
2017-09-11 00:13:03 +02:00
MarcoFalke fa120bd01c doc: Old fee_estimates.dat are discarded by 0.15.0 2017-09-10 04:24:12 +02:00
Pieter Wuille 5f2cf88c23
Merge #11292: travis: filter out pyenv
0ced455b9 travis: filter out pyenv (Cory Fields)

Pull request description:

  Backport of #11271

Tree-SHA512: 34fa201051e4bc3600c2ee6121380c93f03a0639361e4955cdc22af0f95b787a3eb590a5246133377357c803dbb5d17a543672b382de8afa2226e480b63e7555
2017-09-08 16:54:01 -07:00
Cory Fields 0ced455b99 travis: filter out pyenv 2017-09-08 16:20:13 -07:00
Wladimir J. van der Laan adcc788f2a
Merge #11279: doc: Add missing contributors to release notes
fad16a90b doc: Add missing contributors to release notes (MarcoFalke)

Pull request description:

  Guido Vranken via commit 9fe1f6b

Tree-SHA512: 9f5c860ed8e23ad679e8c9e9392a66b7ee25c7be84d256855ef65caf335a8e819c7146be47d90686e61450d2501ed96b04b813860725856619088a4378dbfa90
2017-09-08 00:38:04 +02:00
Wladimir J. van der Laan d4c9d00e7e
doc: Add PRs list to release notes
Tree-SHA512: 1dd5e19a2ece38002da1d4bcf017a0a1a3ab2dc8b31fe7b3e7ebc6fef58de4547abbff3fb6555496da1ecf1f9a0cc941f980b053a0376a776e8301de3834aac1
2017-09-07 23:52:48 +02:00
Wladimir J. van der Laan 134d824193
Merge #11255: Release Notes: Fix SHA256-with-SSE4 PR link
58f1e54cb Release Notes: Fix SHA256-with-SSE4 PR link (Janus Troelsen)

Pull request description:

Tree-SHA512: 7f3dc2a1fb1e602fa947f4a00e39f4958eabeb47800b5b85a2035568258f0679c026d7ffe377c9256a97019b174868db82fd4aaac9c218bed145ba86f56330b1
2017-09-06 18:38:29 +02:00
Janus Troelsen 58f1e54cbf Release Notes: Fix SHA256-with-SSE4 PR link 2017-09-06 12:30:44 +02:00
MarcoFalke fad16a90b2 doc: Add missing contributors to release notes
Guido Vranken via commit 9fe1f6b
2017-09-01 15:14:37 +02:00
Wladimir J. van der Laan 48790e0efa
Merge #11180: [release-notes.md] Remove alias
a461cf4 Update release-notes.md (kallewoof)

Pull request description:

  They're the same person.

Tree-SHA512: dcdcf18d57db87445ce09d5e20ea17b0cb0653e749028b2662d708e2798e38296f0598210fb196bf3255a6bfd0837724e56419c39ebe9564406f11296c40be68
2017-08-28 17:05:28 +02:00
kallewoof a461cf4e37 Update release-notes.md 2017-08-29 00:00:43 +09:00
Wladimir J. van der Laan 29a3cb2378
qt: Translation update pre-rc3
Tree-SHA512: d813ef923d804722bc161cc62e09ee003b386c0abf2d513ede671e9f14ac4c3df749a9f23ddcba9400fcc335dbef6540e47a212dca8ddc0a3d73aee01f098754
2017-08-28 10:29:10 +02:00
Matt Corallo e8ad101e5b
Changing -txindex requires -reindex, not -reindex-chainstate
Github-Pull: #11108
Rebased-From: cd0ea48742
Tree-SHA512: 0fbd50b1343eec14301ee9c2fc76e48dcb1610ce1ddbf3cccbd937e2c0d1bbdfc4920fbc05e7e560c424e0ed7367d6ad3595a1bd38dea669bcbd1c838f522d8e
2017-08-28 10:18:58 +02:00
Alex Morcos 5b059a833e
Output a bit more information for fee calculation report.
Github-Pull: #11145
Rebased-From: 6af49dddea
Tree-SHA512: 7245c6f7ed81cf3913e351ff1df7f74f4be7abe0ae8be312e4862c9875e2943b0b11136bc9999191cdf03468fdac5d41e294bb59b657605c22643b102e37c070
2017-08-28 10:14:58 +02:00
Alex Morcos e51bb71e4a
Fix rounding errors in calculation of minimum change size
Github-Pull: #11145
Rebased-From: a54c7b94f8
Tree-SHA512: d9abb9794edbf7e52450c63d183a4f28e9a3621a670b7f21af92407be096363b44a356818f2abbea11c168d123c04852bd0b60f1cd9d423aefbf4ae831f8567d
2017-08-28 10:14:55 +02:00
MarcoFalke 0a6af47ffa
[doc] build-windows: Mention that only trusty works
Github-Pull: #11119
Rebased-From: fa14b67970
Tree-SHA512: a790a5d37a06a691f2536763a504ead5b06b94708ba07f3b94bedbb76b0201825be3dcd95343512d7a6211089be2abc3f1e0957ed27055426e6943d4bdb6fbd9
2017-08-28 10:00:15 +02:00
Wladimir J. van der Laan 0d3e8183fa
Merge #11102: Trivial: Fix typo in release-notes.md
9c76cf5 Trivial: Fix typo in release-notes.md (jbarcelo)

Pull request description:

  getmempooolentry -> getmempoolentry (twice)

Tree-SHA512: 4e52d4decf4a6b0ae6ef6f3b52fed2c2fafe63d72a3b5868f172c479a9463f28eaada29b6364a5e5ca5afe021155ee97cc9a23208d2a96c4ecccebccc173bb0e
2017-08-21 12:41:18 +02:00
Wladimir J. van der Laan 28b978b19e
qt: Update translations pre-rc2
New locales:

- bn
- bs
- de_DE
- en_AU
- en_US
- es_419
- he_IL
- id
- ja_JP
- my
- nb_NO
- nl_NL
- si
- te
- th

Tree-SHA512: af4e9d0107122e3da7da8ee4952e01a731ed04f13e83ed1979ace24d29c437a83cc23453d8f0b2160829df02c2ffbff0ce749083f82c4d4695c69a3c7feeebed
2017-08-21 10:48:17 +02:00
jbarcelo 9c76cf50fb Trivial: Fix typo in release-notes.md
getmempooolentry -> getmempoolentry (twice)
2017-08-21 10:41:04 +02:00
Cory Fields 129b03ff62
gitian: quick hack to fix version string in releases
Release version strings were broken in Gitian by 7522. This is a minimal fix
suitable for 0.15.

After this, we should fix up version handling for good so that gitian packages
the correct string in the release tarball, so that git is not required to get
the tag name.

Github-Pull: #11097
Rebased-From: 4452829b10
Tree-SHA512: 40071b97b2207b2262aef0b4802cb231ccafbff0ed04b5945a64dceda8bdbb2ea71bf6a546e1d03533612edfdc55dedd413da967cba0b1bbd3f9139ec3572f60
2017-08-21 09:49:18 +02:00
Andrew Chow 07164bbead
Pass serialization flags and whether to include hex to TxToUniv
Github-Pull: #11027
Rebased-From: 6bbdafcdc4
Tree-SHA512: 8ed049a0945c4f56c518aef6d60efebda5cde09ef63d8e472b363821170d71fb4d16414b360824d7537fc7c7b5e5277bbbd092a20899446e97c188ab8df58c1b
2017-08-21 09:49:16 +02:00
Andrew Chow eb9c21ed79
Only return hex field once in getrawtransaction
The hex is already returned in TxToUniv, no need to give it out a
second independent time in getrawtransaction itself.

Github-Pull: #11027
Rebased-From: e029c6e709
Tree-SHA512: 4f7892431ddb9b59bcc59756890b97a20d046d1d4898f8a80c564223e1cde1c922da403cea4b8ae79d70741d1a9ff337f077043e5bb538cdc4d34fbe09301240
2017-08-21 09:49:14 +02:00
John Newbery 6ab120cc6c
[wallet] Add logging to MarkReserveKeysAsUsed
Github-Pull: #11044
Rebased-From: 67ceff4039
Tree-SHA512: 850c5b1010c84e164edf24a83ae36e46309b2eb7a67854bad509265ed590ba67d5f743a8416590da6ecca85fe4bda7f20e8c3152e422638eb7898db11a416af7
2017-08-21 09:49:12 +02:00
John Newbery 4ef8374559
[wallet] Remove keypool_topup_cleanups
Unused function. Mostly reverts c25d90f125

c25d90f... was merged as part of PR 11022 but is not required.

Github-Pull: #11044
Rebased-From: 1221f60c94
Tree-SHA512: da229b128bee5f124c009a1a2adfb4fa879366c81789824c426c9ce5209c835888a7e6cfeb1724551320a98cd08406a605372f84487a0d289cd6e02f9ac3ea21
2017-08-21 09:49:10 +02:00
Wladimir J. van der Laan 2b59cfb1f7
doc: Update build-openbsd for 6.1
- Bump "updated for"
- Fix link to boost (haenet mirror is broken)
- Upgrade boost version to 1.64

Github-Pull: #11080
Rebased-From: 5be6e9b4f9
Tree-SHA512: 72877bf32e4f38fb530946c065c23edd683a0da379c33fa3eee4fbeb51e2c97171f5d33ebe1e77f25c3e14779d94e8198cc8fbb6e1055a1024638458ef7cc032
2017-08-21 09:49:08 +02:00
Jonas Schnelli 9fe1f6bd89
Add length check for CExtKey deserialization
Github-Pull: #11081
Rebased-From: 07685d1bc1
Tree-SHA512: 7f6b9ca6714d059d500531eb842c1c25edfa04ecba0ea1d9a28010fced657c066cea67d2016bbaa9b96c431a05ca9c0dcf2ba301898ecf96a65a4e01aac7fae9
2017-08-21 09:49:05 +02:00