aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-01-03Don't label transactions "Open" while catching upHennadii Stepanov
Since the default `nSequence` is `0xFFFFFFFE` and locktime is enabled, the checking `wtx.is_final` is meaningless until the syncing has completed.
2018-12-16[Qt] Restore < Qt5.6 compatibility for addActionJonas Schnelli
2018-12-16Merge #14969: tests: Fix cuckoocache_tests TSAN failure introduced in 14935.Wladimir J. van der Laan
d98a29ec408590e54f405a7f8d232cd9dc5b14da Fix cuckoocache_tests TSAN failure introduced in #14935. Fixes #14967. (practicalswift) Pull request description: Fix cuckoocache_tests TSAN failure introduced in #14935. Fixes #14967. Tree-SHA512: aabbfa3ab41d9f498151a9b50a2a875fd51ed609bb54d89292114f59392aae57c85fdd5b7a04b589fbf598aaf736b425a6f62b12c806a1fa23bdd45d2d2accfb
2018-12-15Merge #14573: qt: Add Window menuJonas Schnelli
95a5a9fcc qt: Remove ellipsis from sending/receiving addresses (João Barbosa) a96c0df35 qt: Add Window menu (João Barbosa) 9ea38d022 qt: Allow to inspect RPCConsole tabs (João Barbosa) Pull request description: Overall this PR does the following: - add top level menu Window - add Minimize and Zoom actions to Window menu - move Sending/Receiving address to Window - remove Help->Debug window - add one menu entry for each debug window tab This removes the access to address book from the File menu. With wallet support: <img width="522" alt="screenshot 2018-12-11 at 00 33 05" src="https://user-images.githubusercontent.com/3534524/49770451-5bec0800-fcdc-11e8-91d6-f8f850ead92d.png"> Without wallet support: <img width="593" alt="screenshot 2018-12-11 at 12 55 21" src="https://user-images.githubusercontent.com/3534524/49802183-19f6ac80-fd44-11e8-9973-36fcfb4f129e.png"> Tree-SHA512: 4fb03702efe18df7bae33950e462940162abe634c55d0214b8920812127b763234cc9b73f27b3702502a37b6d49bdd6c50b7c8d9a3daea75cecb0136556dd1ea
2018-12-15Fix cuckoocache_tests TSAN failure introduced in #14935. Fixes #14967.practicalswift
2018-12-14Merge #14935: tests: Test for expected return values when calling functions ↵MarcoFalke
returning a success code c84c2b8c92 tests: Test for expected return values when calling functions returning a success code (practicalswift) Pull request description: Test for expected return values when calling functions returning a success code (instead of discarding the return values). **Note to reviewers:** The following commands can be used to verify that the only text fragments added in this PR are `BOOST_CHECK(`, `!` and `)` : ``` $ git diff HEAD~1 | grep -E '^[\-][^\-]' | cut -b2- > before.txt $ git diff HEAD~1 | grep -E '^[\+][^\+]' | cut -b2- > after.txt $ cat after.txt | sed 's/BOOST_CHECK(//g' | sed 's/));/);/g' | tr -d '!' > after-sed.txt $ diff -u before.txt after-sed.txt $ ``` Tree-SHA512: ff0863ef2046a2eda3c44e9c6b9aedfe167881f2fa58db29fef859416831233ef6502a3a11fd2322bc1a924db83df8d4a5c5879298007f2a7b085e2a7286af70
2018-12-14Merge #14821: Replace CAffectedKeysVisitor with descriptor based logicMeshCollider
0e75f44a0 Replace CAffectedKeysVisitor with descriptor based logic (Pieter Wuille) Pull request description: It seems we don't need a custom visitor pattern anymore to find what keys are affected by a script. Instead, infer the descriptor, and see which keys it expands to. Tree-SHA512: 8a52f61fb74e8ebfd8d02e759629e423ced6bd7d9a9ee7c4bdd2cca8465bc27b951cc69c8d835244a611ba55c6d22f83b81acef05487cb988c88c0951b797699
2018-12-13test: Make g_insecure_rand_ctx thread_localMarcoFalke
2018-12-13Merge #14834: validation: assert that pindexPrev is non-null when requiredWladimir J. van der Laan
fbaaf782cea54dc433e72129ee1088b3169cdfd4 validation: assert that pindexPrev is non-null when required (Karl-Johan Alm) Pull request description: In `ContextualCheckBlock`, we are checking if `pindexPrev == nullptr` conditionally at the start, but then assume it is non-`null` later. This removes the latter assumption. Tree-SHA512: 95f1e9dc839b2cc0e099d155e6180634ece8c6760d00b53e7d27128762e64c92e82d98a5f4a5786b48a4851b17cdbb4b667d3b6a99adb651256e2032de67d05c
2018-12-13Merge #14940: test: Add test for truncated pushdata scriptWladimir J. van der Laan
fa694f706c37a1c512a7c346591a63c5e09ee239 test: Add tests for truncated scripts (MarcoFalke) Pull request description: Previously not covered by any test Tree-SHA512: 9f99659bdf3947271074938456a2fe64f5b39fc868e9aa474cec199a536ae5d7428f1cfa7f361936b71b09ee4c426261e6b25668fa77b8416b30dbe4ddb357f0
2018-12-13Merge #14624: Some simple improvements to the RNG codeWladimir J. van der Laan
e414486d56b9f06af7aeb07ce13e3c3780c2b69b Do not permit copying FastRandomContexts (Pieter Wuille) 022cf47dd7ef8f46e32a184e84f94d1e9f3a495c Simplify testing RNG code (Pieter Wuille) fd3e7973ffaaa15ed32e5aeadcb02956849b8fc7 Make unit tests use the insecure_rand_ctx exclusively (Pieter Wuille) 8d98d426116f0178612f14d1874d331042c4c4b7 Bugfix: randbytes should seed when needed (non reachable issue) (Pieter Wuille) 273d02580aa736b7ccea8fce51d90541665fdbd1 Use a FastRandomContext in LimitOrphanTxSize (Pieter Wuille) 3db746beb407f7cdd9cd6a605a195bef1254b4c0 Introduce a Shuffle for FastRandomContext and use it in wallet and coinselection (Pieter Wuille) 8098379be5465f598220e1d6174fc57c56f9da42 Use a local FastRandomContext in a few more places in net (Pieter Wuille) 9695f31d7544778853aa373f0aeed629fa68d85e Make addrman use its local RNG exclusively (Pieter Wuille) Pull request description: This improves a few minor issues with the RNG code: * Avoid calling `GetRand*()` functions (which currently invoke OpenSSL, later may switch to using our own RNG pool) inside loops in addrman, networking code, `KnapsackSolver`, and `LimitOrphanSize` * Fix a currently unreachable bug in `FastRandomContext::randbytes`. * Make a number of simplifications to the unit tests' randomness code (some tests unnecessarily used their own RNG or the OpenSSL one, instead of using the unit test specific `insecure_rand_ctx`). * As a precaution, make it illegal to copy a `FastRandomContext`. Tree-SHA512: 084c70b533ea68ca7adc0186c39f0b3e0a5c0ae43a12c37286e5d42086e056a8cd026dde61b12c0a296dc80f87fdc87fe303b9e8e6161b460ac2086cf7615f9d
2018-12-13Merge #14741: doc: Indicate -rpcauth option password hashing algWladimir J. van der Laan
dcb70b152292a8df9fe834bacdf231ea848819b1 Indicate -rpcauth option password hashing alg (Carl Dong) Pull request description: By indicating the password hashing algorithm, users of bitcoin distributions without the script in `share/rpcauth` and users who don't want to rely on said script can use alternative means to generate the password hash. Question for reviewers: perhaps we should also indicate that it is specifically a HMAC-SHA-256 of the _**UTF-8**_ encoding of their password? Tree-SHA512: 86b546c2e78699fa253da0c1e76b21ef60e9b6a5778826ac5136e764d70e3213044cc05cdb4786ba27968781647c46e358a823bbc2db7d45d041d291ee03b83c
2018-12-13tests: Test for expected return values when calling functions returning a ↵practicalswift
success code
2018-12-12Do not permit copying FastRandomContextsPieter Wuille
2018-12-12Simplify testing RNG codePieter Wuille
2018-12-12Make unit tests use the insecure_rand_ctx exclusivelyPieter Wuille
2018-12-12Bugfix: randbytes should seed when needed (non reachable issue)Pieter Wuille
2018-12-12Use a FastRandomContext in LimitOrphanTxSizePieter Wuille
2018-12-12Introduce a Shuffle for FastRandomContext and use it in wallet and coinselectionPieter Wuille
2018-12-12Use a local FastRandomContext in a few more places in netPieter Wuille
2018-12-12Make addrman use its local RNG exclusivelyPieter Wuille
2018-12-12test: Add tests for truncated scriptsMarcoFalke
2018-12-12Merge #14908: test: Removed implicit CTransaction constructor calls from ↵MarcoFalke
tests and benchmarks. 8db0c3d42b Removed implicit CTransaction conversion from benchmaks (lucash-dev) ed61abedb2 Removed implicit CTransaction constructor from tests (lucash-dev) Pull request description: This PR was split from #14906 and is a prerequisite for it. It updates tests and benchmarks, removing all implicit calls to `CTransaction(CMutableTransaction&)` constructors. This will make possible making the constructor explicit in the next PR. The original rationale for making the constructor explicit: - Conversion constructors should not be explicit unless there's a strong reason for it (in the opinion of, for example, https://google.github.io/styleguide/cppguide.html, and https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Ro-conversion. Let me know your take on this). - This particular conversion is very costly -- it implies a serialization plus hash of the transaction. - Even though `CTransaction` and `CMutableTransaction` represent the same data, they have very different use cases and performance properties. - Making it explicit allows for easier reasoning of performance trade-offs. - There has been previous performance issues caused by unneeded use of this implicit conversion. - This PR creates a map for places to look for possible refactoring and performance gains (this benefit still holds if the PR is not merged). Tree-SHA512: de8073aa6ff8a3153bcbe10818616677ecf9598e4978d8a0b4c39a262e71c36be5679cec08554c760d1f011ba6d37350318248eef15f6d9b86f9e4462b2de0d2
2018-12-12Merge #13076: Fix ScanForWalletTransactions to return an enum indicating ↵MeshCollider
scan result: success / failure / user_abort bd3b0361d Add stop_block out arg to ScanForWalletTransactions (Ben Woosley) 3002d6cf3 Return a status enum from ScanForWalletTransactions (Ben Woosley) bb24d6865 Make CWallet::ScanForWalletTransactions args and return value const (Ben Woosley) Pull request description: Return the failed block as an out arg. Fixes #11450. /cc #12275 Tree-SHA512: 6a523e5425ebfe24e664a942ae21c797ccc1281c25b1bf8d02ad95c19dae343fd8051985ef11853474de7628fd6bed5f15190fbc087c3466ce6fdecab37d72a9
2018-12-12Merge #14646: Add expansion cache functions to descriptors (unused for now)MeshCollider
26879509f Add comments to descriptor tests (Pieter Wuille) 82df4c64f Add descriptor expansion cache (Pieter Wuille) 1eda33aab [refactor] Combine the ToString and ToPrivateString implementations (Pieter Wuille) 24d3a7b3a [refactor] Use DescriptorImpl internally, permitting access to new methods (Pieter Wuille) 6be0fb4b3 [refactor] Add a base DescriptorImpl with most common logic (Pieter Wuille) Pull request description: This patch modifies the internal `Descriptor` class to optionally construct and use an "expansion cache". Such a cache is a byte array that encodes all information necessary to expand a `Descriptor` a second time without access to private keys, and without the need to perform expensive BIP32 derivations. For all currently defined descriptors, the cache simply contains a concatenation of all public keys used. This is motivated by the goal of importing a descriptor into the wallet and using it as a replacement for the keypool, where it would be impossible to expand descriptors if they use hardened derivation. Tree-SHA512: f531a0a82ec1eecc30b78ba8a31724d1249826b028cc3543ad32372e1aedd537f137ab03dbffc222c5df444d5865ecd5cec754c1ae1d4989b6e9baeaffade32a
2018-12-11Removed implicit CTransaction conversion from benchmakslucash-dev
2018-12-11Removed implicit CTransaction constructor from testslucash-dev
2018-12-11qt: Remove ellipsis from sending/receiving addressesJoão Barbosa
Considering https://stackoverflow.com/a/637708 the ellipsis in these menu actions should be removed.
2018-12-11qt: Add Window menuJoão Barbosa
2018-12-11qt: Allow to inspect RPCConsole tabsJoão Barbosa
2018-12-10Merge #14877: rpc: Document default values for optional argumentsMarcoFalke
fa0c24c96e rpc: Document default values for optional arguments (MarcoFalke) Pull request description: Tree-SHA512: e1f5ea67d7ac67526ae87bffaeb308a9ad68632e161fe0148cd431a340bb7a30def18f1dbc7e98c6c1c269ac8942fd5d5334c85c48e4fb1cead70a42536b6eef
2018-12-10Merge #14885: rpc: Assert named arguments are unique in RPCHelpManMarcoFalke
e09a5875ca rpc: Assert named arguments are unique in RPCHelpMan (João Barbosa) Pull request description: Prevents an obvious mistake. Tree-SHA512: 32c24a1934b17ab6f0d5cd31bdf0388e93ee5156ccc1b4f78eb9fd7f1d4b27a4b978b594ff11812bc9f20987c9fc36bf4497ddaedf18cf6bcbea19c050571334
2018-12-09Merge #14801: qt: Use window() instead of obsolete topLevelWidget()Wladimir J. van der Laan
0b4a5786bb5442a309c22e534e62ab1082588300 Use window() instead of obsolete topLevelWidget() (Hennadii Stepanov) Pull request description: `QWidget::topLevelWidget()` is obsolete since at least Qt 4.8. Refs: - https://doc-snapshots.qt.io/4.8/qwidget-obsolete.html#topLevelWidget - https://doc.qt.io/qt-5.9/qwidget-obsolete.html#topLevelWidget Tree-SHA512: 45a79a3f11acd24bbf335603e60cb46545f4c9ce9b16280117676797a611c4422525abd39ad6784a7bc459926e3f5120b49a170403ff60ba4788d679862e3ff0
2018-12-07rpc: Document default values for optional argumentsMarcoFalke
2018-12-07rpc: Assert named arguments are unique in RPCHelpManJoão Barbosa
2018-12-07Merge #14890: rpc: Avoid creating non-standard raw transactionsWladimir J. van der Laan
fa4c8679ed94f215ce895938f7c3c169a2ce101e rpc: Avoid creating non-standard raw transactions (MarcoFalke) Pull request description: Multiple OP_RETURN outputs in a transaction are not standard and unlikely to be relayed, so avoid creating them. Apart from that, the logic was broken in that it duplicated the same hex-data for each data output: Closes #14868. Tree-SHA512: b08d08062b5622e8a7b497e490ccaf53b06e844c863fda3bf3f932a98684a809e8341aeb98232059a795afb32d8770a6c5591a66f8e6ee372b672af245607887
2018-12-07Merge #14854: qt: Cleanup SplashScreen classWladimir J. van der Laan
7d1b60ce931d5944576fc726b0ef6b9a10ef8793 Cleanup SplashScreen class (Hennadii Stepanov) Pull request description: Cleaning up after replacing the `QSplashScreen` base class with the `QWidget` class (#4941 by @laanwj). cc @jonasschnelli Tree-SHA512: 72e2d67905d85247a11ae6a884f74f710f765adf20db7d1daf0927e6990687e836b486c4ff93bc6dabc3759ed667acfe1d69c8b94fae7181ab271a3fa7a0229a
2018-12-07Merge #14480: refactor: Drop boost::this_thread::interruption_point and ↵Wladimir J. van der Laan
boost::thread_interrupted in main thread b7df96f4565064bcb7cbbf7e2507e03bdcf339f0 refactor: Drop boost::this_thread::interruption_point and boost::thread_interrupted in main thread (Chun Kuan Lee) Pull request description: This PR drops useless `boost::this_thread::interruption_point` and `boost::thread_interrupted` catch. They are only executed in main thread. Tree-SHA512: a980d098c1a8238e4f0da9493731d7e69b9ca8e010103f442722d0d4cce471cc40a1fafd5f05535ad0e18899b6cf7563ee20e4025f7c7bc15182a0058c028922
2018-12-07Merge #14863: refactor: Add and use HaveTxsDownloaded() where appropriateWladimir J. van der Laan
fa4fc8856b239059421a8e507b3e3e7f4b379a72 validation: Add and use HaveTxsDownloaded where appropriate (MarcoFalke) Pull request description: `nChainTx` is an implementation detail that shouldn't be exposed without a wrapper that comes with appropriate documentation. Tree-SHA512: 56ab7378c2ce97794498724c271f861de982de69099e90ec09632a26230ae6fded3c59668adb378bd64dcb8ef714769b970210977b88a53fc7550774ddba3d59
2018-12-06rpc: Avoid creating non-standard raw transactionsMarcoFalke
2018-12-06Merge #14783: gui: Fix boost::signals2::no_slots_error in early calls to ↵MarcoFalke
InitWarning 6bbdb2077e squashme: connect thru node interface (João Barbosa) a0f8df365d qt: Call noui_connect to prevent boost::signals2::no_slots_error in early calls to InitWarning (João Barbosa) Pull request description: Adding the following to `bitcoin.conf` ``` [xxx] disablewallet=1 ``` And running `bitcoin-qt` gives: ``` libc++abi.dylib: terminating with uncaught exception of type boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::signals2::no_slots_error> >: boost::signals2::no_slots_error ``` Fixes regression in #14708. Tree-SHA512: 7c158376fad6ebcd80fc0dbe549d5b6e893fb82e7dc1e455825633d7f91b14dc34493487cab7642152e88f9eaf99bfa91988972d600e9fb289cf26afd64aff8a
2018-12-06Merge #14670: http: Fix HTTP server shutdownWladimir J. van der Laan
28479f926f21f2a91bec5a06671c60e5b0c55532 qa: Test bitcond shutdown (João Barbosa) 8d3f46ec3938e2ba17654fecacd1d2629f9915fd http: Remove timeout to exit event loop (João Barbosa) e98a9eede2fb48ff33a020acc888cbcd83e24bbf http: Remove unnecessary event_base_loopexit call (João Barbosa) 6b13580f4e3842c11abd9b8bee7255fb2472b6fe http: Unlisten sockets after all workers quit (João Barbosa) 18e968581697078c36a3c3818f8906cf134ccadd http: Send "Connection: close" header if shutdown is requested (João Barbosa) 02e1e4eff6cda0bfc24b455a7c1583394cbff6eb rpc: Add wait argument to stop (João Barbosa) Pull request description: Fixes #11777. Reverts #11006. Replaces #13501. With this change the HTTP server will exit gracefully, meaning that all requests will finish processing and sending the response, even if this means to wait more than 2 seconds (current time allowed to exit the event loop). Another small change is that connections are accepted even when the server is stopping, but HTTP requests are rejected. This can be improved later, especially if chunked replies are implemented. Briefly, before this PR, this is the order or events when a request arrives (RPC `stop`): 1. `bufferevent_disable(..., EV_READ)` 2. `StartShutdown()` 3. `evhttp_del_accept_socket(...)` 4. `ThreadHTTP` terminates (event loop exits) because there are no active or pending events thanks to 1. and 3. 5. client doesn't get the response thanks to 4. This can be verified by applying ```diff // Event loop will exit after current HTTP requests have been handled, so // this reply will get back to the client. StartShutdown(); + MilliSleep(2000); return "Bitcoin server stopping"; } ``` and checking the log output: ``` Received a POST request for / from 127.0.0.1:62443 ThreadRPCServer method=stop user=__cookie__ Interrupting HTTP server ** Exited http event loop Interrupting HTTP RPC server Interrupting RPC tor: Thread interrupt Shutdown: In progress... torcontrol thread exit Stopping HTTP RPC server addcon thread exit opencon thread exit Unregistering HTTP handler for / (exactmatch 1) Unregistering HTTP handler for /wallet/ (exactmatch 0) Stopping RPC RPC stopped. Stopping HTTP server Waiting for HTTP worker threads to exit msghand thread exit net thread exit ... sleep 2 seconds ... Waiting for HTTP event thread to exit Stopped HTTP server ``` For this reason point 3. is moved right after all HTTP workers quit. In that moment HTTP replies are queued in the event loop which keeps spinning util all connections are closed. In order to trigger the server side close with keep alive connections (implicit in HTTP/1.1) the header `Connection: close` is sent if shutdown was requested. This can be tested by ``` bitcoind -regtest nc localhost 18443 POST / HTTP/1.1 Authorization: Basic ... Content-Type: application/json Content-Length: 44 {"jsonrpc": "2.0","method":"stop","id":123} ``` Summing up, this PR: - removes explicit event loop exit — event loop exits once there are no active or pending events - changes the moment the listening sockets are removed — explained above - sends header `Connection: close` on active requests when shutdown was requested which is relevant when it's a persistent connection (default in HTTP 1.1) — libevent is aware of this header and closes the connection gracefully - removes event loop explicit break after 2 seconds timeout Tree-SHA512: 4dac1e86abe388697c1e2dedbf31fb36a394cfafe5e64eadbf6ed01d829542785a8c3b91d1ab680d3f03f912d14fc87176428041141441d25dcb6c98a1e069d8
2018-12-06Merge #14831: Scripts and tools: Use #!/usr/bin/env bash instead of #!/bin/bash.Wladimir J. van der Laan
688f665a5e526fda0fb797bf617412fe9cbe64fd Scripts and tools & Docs: Used #!/usr/bin/env bash instead of obsolete #!/bin/bash, added linting for .sh files shebang and updated the Developer Notes. (vim88) Pull request description: As it was discussed in [#13510](https://github.com/bitcoin/bitcoin/pull/13510), it is better to use `#!/usr/bin/env bash` instead of `#!/bin/bash`. Tree-SHA512: 25f71eb9a6a0cdc91568b5c6863205c5fe095f77a69e633503a2ac7805bd9013af8538e538c0c666ce96a28e3f43ce7a8df5f08d4ff007723bb588d85674f2da
2018-12-06Merge #14838: Use const in COutPoint classWladimir J. van der Laan
cf4b0327ed92ca8a1533cdf6c2b0015fd9b56397 Use std::numeric_limits<UNSIGNED>::max()) instead of (UNSIGNED)-1 (practicalswift) 6b82fc59eb19004e54f910261a40d5e1b9e44b42 Use const in COutPoint class (Hennadii Stepanov) Pull request description: Refactoring: - all cases of using `(uint32_t) -1` in `COutPoint` class are replaced with const; - also all remaining instances of `(UNSIGNED)-1` transformed to `std::numeric_limits<UNSIGNED>::max()` (by @practicalswift). Tree-SHA512: fc7fe9838b6e5136d8b97ea3d6f64c4aaa1215f4369832df432cab017396620bb6e30520a64180ceab6de222562ac11eab243a78dfa5a658ba018835a34caa19
2018-12-05Merge #14796: rpc: Pass argument descriptions to RPCHelpManMarcoFalke
fabca42c68 RPCHelpMan: Add space after colons in extended description (MarcoFalke) fafd040f73 rpc: Add description to fundrawtransaction vout_index (MarcoFalke) 1db0096f61 rpc: Pass argument descriptions to RPCHelpMan (MarcoFalke) Pull request description: This will normalize the type names and formatting for the rpc arguments Tree-SHA512: 6ab344882f0fed36046ab4636cb2fa5d2479c6aae22666ca9a0d067edbb9eff8de98010ad97c8ce40ab532d15d1ae67120a561b0bf3da837090d7de427679f4f
2018-12-04RPCHelpMan: Add space after colons in extended descriptionMarcoFalke
Also, add doxygen comment to ToDescriptionString
2018-12-04Use std::numeric_limits<UNSIGNED>::max()) instead of (UNSIGNED)-1practicalswift
2018-12-04rpc: Add description to fundrawtransaction vout_indexMarcoFalke
2018-12-04validation: Add and use HaveTxsDownloaded where appropriateMarcoFalke
2018-12-04Merge #14840: Remove duplicate libconsensus linking in test makeWladimir J. van der Laan
b14948e2e Remove duplicate libconsensus linking in test make (Amir Abrams) Pull request description: `LIBBITCOIN_CONSENSUS` is linked twice in Makefile.test.include Tree-SHA512: d4240e6f15f62ec1500021760af5155c6ce3898d1ca8da463ad85e2bff4435aa3b9204505ef889149509ae959d44dd845914671bc3d7df61e89aa3ab5e1aa751