aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-05qa: Pad scriptPubKeys to get minimum sized txsMarcoFalke
2018-05-05Policy to reject extremely small transactionsJohnson Lau
A transaction with 1 segwit input and 1 P2WPHK output has non-witness size of 82 bytes. Anything smaller than this have unnecessary malloc overhead and are not relayed/mined.
2018-05-05Add transaction tests for constant scriptCodeJohnson Lau
Tests showing that CONST_SCRIPTCODE is applied only to non-segwit transactions
2018-05-05Add constant scriptCode policy in non-segwit scriptsJohnson Lau
This disables OP_CODESEPARATOR in non-segwit scripts (even in an unexecuted branch), and makes a positive FindAndDelete result invalid. This ensures that the scriptCode serialized in SignatureHash() is always the same as the script passing to the EvalScript.
2018-05-04Merge #13165: doc: Mention good first issue list in CONTRIBUTING.mdMarcoFalke
a508091c59 doc: Mention good first issue list in CONTRIBUTING.md (fanquake) Pull request description: Tree-SHA512: a954cda62d6dc8ab78809565be392a1c9f55c543e8d5c1a5a8588c0062e1a11bd4968991646e4aa5bd9b9761b1765fde4ceab8fea7a973148122ff249d728b92
2018-05-04doc: Mention good first issue list in CONTRIBUTING.mdfanquake
2018-05-03Merge #12639: Reduce cs_main lock in listunspentWladimir J. van der Laan
a59dac3 refactor: Avoid extra lookups of mapAddressBook in listunspent RPC (João Barbosa) d76962e rpc: Reduce cs_main lock in listunspent (João Barbosa) Pull request description: On my system, where the wallet has 10000 unspents, the `cs_main` lock duration changed from 191ms to 36ms. The loop that generates the response takes around 155ms. So, the lock duration is reduced to around 20%. Tree-SHA512: ddaae591f39da59a9d1a8e9ffe773d857687789476f566ca273d310ad531da6dacff80cac69f3334c601c251ac7c5ed4136656c725aa3d611c6bbf734111946e
2018-05-03Merge #13148: logging: Fix potential use-after-free in LogPrintStr(...)Wladimir J. van der Laan
0bd4cd3 logging: remove unused return value from LogPrintStr (practicalswift) 76f344d logging: Fix potential use-after-free in LogPrintStr(...) (practicalswift) Pull request description: Fix potential use-after-free in `LogPrintStr(...)`. `freopen(…)` frees `m_fileout`. Tree-SHA512: ceee1f659c10a21525aa648377afeea0a37016339f5269dea54850ba3b475aa316f4931081655717b65f981598fdc9d79a1e79e55f7084c242eeb7bf372bc4b6
2018-05-03Merge #13154: Trivial: s/SetBestChain/ChainStateFlushed in comments after #13106Wladimir J. van der Laan
21f5680 Trivial: s/SetBestChain/ChainStateFlushed in comments after #13106 (Russell Yanofsky) Pull request description: Tree-SHA512: 373896dd73c3ba202739433b22320a4b7ea6dc80ef84547b4ed72c7ae0d6746b109c8b1879359c43374d1816fe384cc31b24b87879ddefe993887140c2f0df9c
2018-05-03refactor: Avoid extra lookups of mapAddressBook in listunspent RPCJoão Barbosa
2018-05-03rpc: Reduce cs_main lock in listunspentJoão Barbosa
2018-05-03Merge #12729: Get rid of ambiguous OutputType::NONE valueWladimir J. van der Laan
1e46d8a Get rid of ambiguous OutputType::NONE value (Russell Yanofsky) Pull request description: Based on suggestion by @sipa https://github.com/bitcoin/bitcoin/pull/12119#issuecomment-357982763 After #12119, the NONE output type was overloaded to refer to either an output type that couldn't be parsed, or to an automatic change output mode. This change drops the NONE enum and uses a simple bool to indicate parse failure, and a new CHANGE_AUTO enum to refer the change output type. This change is almost a pure refactoring except it makes RPCs reject empty string ("") address types instead of treating them like they were unset. This simplifies the parsing code a little bit and could prevent RPC usage mistakes. It's noted in the release notes. Follows up #12408 by @MarcoFalke Followups for future PRs: - [ ] Add explicit support for specifying "auto" in `ParseOutputType` as suggested by promag and sipa: https://github.com/bitcoin/bitcoin/pull/12729#issuecomment-374799567 and https://github.com/bitcoin/bitcoin/pull/12729#discussion_r175969481 - [ ] Add wallet `AddressChangeType` method to complement `TransactionChangeType`: https://github.com/bitcoin/bitcoin/pull/12729#discussion_r175969618. Tree-SHA512: 8b08b272bcb177a0a9e556dcd965840a7fe601ef83ca97938b879c9b1a33b5b3f96939e1bceef11ba7c644ac21bfd6c1dbc6ca715cd1da4ace50475240e4ee48
2018-05-03Merge #12507: Interrupt rescan on shutdown requestWladimir J. van der Laan
c4fda76 wallet: Interrupt rescan on shutdown request (João Barbosa) Pull request description: Fixes #10987. Here are the steps to test the feature: 1. start bitcoind, generate a couple of transactions and then stop: ``` bitcoind -regtest -printtoconsole bitcoin-cli -regtest generate 100 ``` 2. apply the following patch ```diff diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 2478d67ce..8f8cea40c 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1671,6 +1671,7 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock } while (pindex && !fAbortRescan && !ShutdownRequested()) { + MilliSleep(500); if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0) { double gvp = 0; { ``` 3. start bitcoind with rescan flag, interrupt with CTRL+C and the output should look like: ``` bitcoind -regtest -printtoconsole -rescan ... ^C2018-02-22 01:00:55 AddToWallet e8bfb4501b630ad2acb91e88ab0112a779766536d2c564b04faae45ae90e18f7 2018-02-22 01:00:55 Rescan interrupted by shutdown request at block 5. Progress=1.000000 2018-02-22 01:00:55 rescan 1774ms 2018-02-22 01:00:55 setKeyPool.size() = 1995 2018-02-22 01:00:55 mapWallet.size() = 10145 2018-02-22 01:00:55 mapAddressBook.size() = 3 2018-02-22 01:00:55 Shutdown: In progress... 2018-02-22 01:00:55 scheduler thread interrupt 2018-02-22 01:00:55 Shutdown: done ``` Tree-SHA512: f9bebe2cdacf0359b6cbfcbc48ac2818a3ae7aa7822ff0c2c0de4ca2fff7c88493380b74a1c5ff2ce1de01fe605b0e5ef3576f124ea9cff8ef25a9e762477b92
2018-05-02Merge #12928: qt: Initialize non-static class members that were previously ↵Wladimir J. van der Laan
neither initialized where defined nor in constructor 3fdc5fe Make sure initialization occurs in the constructor (practicalswift) 1e7813e Remove redundant initializations from the constructor (practicalswift) f131872 Initialize non-static class members where they are defined (practicalswift) 73bc1b7 Initialize editStatus and autoCompleter. Previously not initialized where defined or in constructor. (practicalswift) Pull request description: Initialize variables previously neither defined where defined nor in constructor: * `editStatus` * `autoCompleter` Also; initialize non-static class members where they are defined in accordance with developer notes. Tree-SHA512: 84f0cb87ec8394ed7641bfa0731be2ec72e6a920e00ae206ff89e2e7c960358f603c52878311b24601a33aa7cba6ea4f9a78a8ade88112dea0f41efb08e84e25
2018-05-02Trivial: s/SetBestChain/ChainStateFlushed in comments after #13106Russell Yanofsky
2018-05-02Merge #13153: Add missing newlines to debug loggingWladimir J. van der Laan
4b75dcf devtools: Make linter check LogPrint calls (MarcoFalke) ff2ad2d Add missing newlines to LogPrint debug logging (Wladimir J. van der Laan) Pull request description: ~~Don't we have a linter that should catch these?~~ Tree-SHA512: 1a58eca01ded9c1719e943c09447deeb59bb06dba00528cf460eefe857fdf95b42671fbdebc87cdd2f51e931e86942d06587ffd097cbb0d8dd9eb7a0ba17a8f0
2018-05-02devtools: Make linter check LogPrint callsMarcoFalke
2018-05-02Add missing newlines to LogPrint debug loggingWladimir J. van der Laan
The linter only checked `LogPrintf`, not `LogPrint`. Fix the remaining cases.
2018-05-02Make sure initialization occurs in the constructorpracticalswift
2018-05-02Merge #13106: Simplify semantics of ChainStateFlushed callbackWladimir J. van der Laan
9cb6cdc Simplify semantics of ChainStateFlushed callback (Matt Corallo) 50b6533 scripted-diff: Rename SetBestChain callback ChainStateFlushed (Matt Corallo) Pull request description: Previously, ChainStateFlushed would fire either if a full flush completed (which can happen due to memory limits, forced flush, or on its own DATABASE_WRITE_INTERVAL timer) *or* on a ChainStateFlushed-specific DATABASE_WRITE_INTERVAL timer. This is both less clear for clients (as there are no guarantees about a flush having actually happened prior to the call), and reults in extra flushes not clearly intended by the code. We drop the second case, providing a strong guarantee without removing the periodit timer-based flushing. This is a follow-up to discussion in #11857. Tree-SHA512: 22ba3a0954d265d28413dbf87040790ca5b439820ee7bbadab14028295ec190de82ce5cd664426c82e58b706dc84278868026fa8d066702eb6e6962c9ace1f8e
2018-05-02wallet: Interrupt rescan on shutdown requestJoão Barbosa
2018-05-02Merge #13146: rpcauth: Make it possible to provide a custom passwordWladimir J. van der Laan
2a89b0c rpcauth: Make it possible to provide a custom password (Wladimir J. van der Laan) Pull request description: This adds the functionality to specify a custom password to `rpcauth.py`, as well as makes the code (IMO) easier to understand. Tree-SHA512: 458d54cc258e16917c0f0ce5ae1c3d6c0c03b5ab931011bf3feb09a3474f1511c38ec45822a4af2aadeaca522a002ba04a564849dd3f42fa6f36dd21b0cba093
2018-05-02logging: remove unused return value from LogPrintStrpracticalswift
`LogPrintStr` returns the number of characters printed. This number is doubled if both logging to console and logging to file is enabled. As the return value is never used, I've opted to remove it instead of try to fix it. Credit: @laanwj
2018-05-02logging: Fix potential use-after-free in LogPrintStr(...)practicalswift
2018-05-02rpcauth: Make it possible to provide a custom passwordWladimir J. van der Laan
This adds the functionality to specify a custom password to `rpcauth.py`, as well as makes the code (IMO) easier to understand.
2018-05-02Merge #13141: [doc] qt: fixes broken link on readmeWladimir J. van der Laan
12ad33a [doc] qt: fixes broken link on readme (marcoagner) Pull request description: I was reading qt files and just fixed a trivial mistake on its readme file. "#use-qt-Creator-as IDE" should be "#using-qt-creator-as-ide" Tree-SHA512: b2610821370dd7cac86725750ce7fd7a9e414c175e525f2e53e87302363c2a4a86206e0f9ce1d02657c751c395a33f0505953a94fd8124ea1943e39bb0711777
2018-05-01[doc] qt: fixes broken link on readmemarcoagner
2018-05-01Merge #13136: [tests] Fix flake8 warnings in several wallet functional testsMarcoFalke
a533834d50 [tests] Fix flake8 warnings in several wallet functional tests (John Newbery) Pull request description: Fixes flake8 warnings in several wallet functional tests. Several wallet functional tests need rewrite to remove the accounts API (#13075). To prepare for that, I fixed all the flake8 warnings in those tests. #13075 is blocked on a bitcoind bug. This PR is just the flake8 fixes so we're not completely blocked. Tree-SHA512: 2dc1d589b2f8f4318083a681e487532d0f8f3d57e8bc8f37b660b728ffc33329b88e9251eb223104aea89f293c3f4074ca700fe690e645617326b859da3e93c3
2018-05-01[tests] Fix flake8 warnings in several wallet functional testsJohn Newbery
This commit fixes flake8 warnings in the following functional tests: - wallet_listreceivedby.py - wallet_basic.py - wallet_txn_clone.py - wallet_listsinceblock.py - wallet_import_rescan.py - wallet_listtransactions.py - wallet_importprunedfunds.py - wallet_txn_doublspend.py
2018-05-01Revert #12769: Add systemd service to bitcoind in debian packageWladimir J. van der Laan
After discussion with Matt on IRC, this is not ready for prime time until 2019 and shouldn't have been ACKed and merged. - Revert "Add systemd service for bitcoind" This reverts commit 2a87b1b07c5c4f8b9b34747c5f254c2ae1e824bf. - Revert "Sync contrib/debian from Matt Corallo's PPA" This reverts commit 9085532d35207c4a7690812ae82e476cf518d451. Tree-SHA512: 439f4ccc3e196011af448b220adf26b0e653ac589bf4cfbbc276c1500c9d08f209c9d6101e4d232857779d9f25164cfb222ed30e3d63de116f9121e6ebde31c3
2018-05-01Merge #12769: Add systemd service to bitcoind in debian packageWladimir J. van der Laan
2a87b1b Add systemd service for bitcoind (ctp-tsteenholdt) 9085532 Sync contrib/debian from Matt Corallo's PPA (ctp-tsteenholdt) Pull request description: On suggestion from @TheBlueMatt I have updated `contrib/debian` files to include a systemd service in the `bitcoind` build. Tested and working on Ubuntu 16.04 and 17.10. This fixes Issue #12758 Tree-SHA512: b6137fafee940c7410df1242c8716a87f47c5bc60eb8df3ad0184a50c2d67ef3f2728761c742670a0ad546ab6e7ad60472a721350cd6280b3bcbdc582e50ee07
2018-05-01Merge #12384: [Docs] Add version footnote to tor.mdWladimir J. van der Laan
39d2911 [Docs] Add version footnote to tor.md (Damian Williamson) Pull request description: [Docs] Add version footnote to tor.md Added note to section 2, part -edits to `/etc/tor/torrc`- indicating this is only required for Tor version 0.2.7.0 and older, since section 3 states it is valid for Tor version 0.2.7.1 and newer. Added ref link from section 2 version footnote to section 3. Re-styled headings to work on GitHub -alternate heading style markup creation issue with numbered headings and thus headings and automatic heading links are broken- Ref: [Issue# 12376](https://github.com/bitcoin/bitcoin/issues/12376) Signed-off-by: Damian Williamson \<willtech@live.com.au\> Tree-SHA512: 439f4ccc3e196011af448b220adf26b0e653ac589bf4cfbbc276c1500c9d08f209c9d6101e4d232857779d9f25164cfb222ed30e3d63de116f9121e6ebde31c3
2018-05-01Merge #13133: Remove python2 from configure.acMarcoFalke
457c2da2ac Remove python2 from configure.ac (Chun Kuan Lee) Pull request description: Tree-SHA512: 6777fe86276156bb2af092bcd679b18ce9dd71258fe843b591bb8a2fc9276ffd8803396adb6f9d8af07289ff85b344b808966d13064329e3449bb66fa0655731
2018-05-01Remove python2 from configure.acChun Kuan Lee
2018-05-01[Docs] Add version footnote to tor.mdDamian Williamson
Added note to section 2, part -edits to `/etc/tor/torrc`- indicating this is only required for Tor version 0.2.7.0 and older, since section 3 states it is valid for Tor version 0.2.7.1 and newer. Added ref link from section 2 version footnote to section 3. Re-styled headings to work on GitHub -alternate heading style markup creation issue with numbered headings and thus headings and automatic heading links are broken- Ref: [Issue# 12376](https://github.com/bitcoin/bitcoin/issues/12376) Signed-off-by: Damian Williamson <willtech@live.com.au>
2018-04-30Merge #12954: util: Refactor logging code into a global objectPieter Wuille
8c2d695c4a util: Store debug log file path in BCLog::Logger member. (Jim Posen) 8e7b961388 scripted-diff: Rename BCLog::Logger member variables. (Jim Posen) 1eac317f25 util: Refactor GetLogCategory. (Jim Posen) 3316a9ebb6 util: Encapsulate logCategories within BCLog::Logger. (Jim Posen) 6a6d764ca5 util: Move debug file management functions into Logger. (Jim Posen) f55f4fcf05 util: Establish global logger object. (Jim Posen) Pull request description: This is purely a refactor with no behavior changes. This creates a new class `BCLog::Logger` to encapsulate all global logging configuration and state. Tree-SHA512: b34811f54a53b7375d7b6f84925453c6f2419d21179379ee28b3843d0f4ff8e22020de84a5e783453ea927e9074e32de8ecd05a6fa50d7bb05502001aaed8e53
2018-04-30Merge #13130: [tests] Fix race in rpc_deprecated.pyMarcoFalke
a95bf6422a [tests] Fix race in rpc_deprecated.py (John Newbery) Pull request description: Fixes a block generation race introduced in 3576ab1261. Tree-SHA512: 044d7cff5087d0e5e950fa80d20dec6427416697820e8748bc30f4d4e6f7ff0753a44eed398432f8c33ed79948a42fb65f9f5926aa6fbd14224e8bf6b12a54ed
2018-04-30[tests] Fix race in rpc_deprecated.pyJohn Newbery
Fixes a block generation race.
2018-04-30Merge #13028: Make vpwallets usage thread safeWladimir J. van der Laan
e2f58f4 wallet: Make vpwallets usage thread safe (João Barbosa) Pull request description: This PR turns the functions introduced in #13017 thread safe. This is required to correctly support dynamically loading wallets, which is implemented in #10740. Tree-SHA512: efaa09e501636cf957aa33de83719ce09dc0c2a19daff741a94ef10d6b7ba5dee538355b80c96ead995140f99f5df0c92fb0e22ae1adb8f397eb478280c8d8c7
2018-04-30Merge #13105: [qa] Add --failfast option to functional test runnerWladimir J. van der Laan
58f9a0a Use --failfast when running functional tests on Travis (James O'Beirne) bf720c1 Add --failfast option to functional test runner (James O'Beirne) Pull request description: Add the option (`--failfast`) to stop the functional test runner's execution when it encounters the first failure. Also cleans up run_test's arguments list ([no more mutable default for `args`](http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments)) and call site. Tree-SHA512: e854b1b1634bf613ae8ae88e715df1460982fa68db9d785aafeb5eccf5bf324c7f20dded2ca6840ebf18a28347ecac2138d6c7592507b34939b02609ef55e1b3
2018-04-30Merge #13124: [doc] nit: descendent should be spelled descendant even in the ↵Wladimir J. van der Laan
release-notes 9b78ef3 nit: descendent should be spelled descendant even in the release-notes (mryandao) Pull request description: Tree-SHA512: 842b675dd648461c03f1bf4081856baae75d663d37609e24ee5100361672c500a94302cfa1f7505993c56194f8184e0658d5174c7994cfb3fabe6003a9514610
2018-04-30nit: descendent should be spelled descendant even in the release-notesmryandao
2018-04-30Merge #13109: [rpc] nit: fix typo for entry description stringWladimir J. van der Laan
f7c414d nit: fix typo for entry description string (mryandao) Pull request description: #12240 Tree-SHA512: 2940c383069912b04d6fdbc1f0834970cae8ed725beb606916ee27501d8f6e1b3938647babb26137440166de3a9ac745048e306696d13817775eb406adb31f4a
2018-04-30Merge #13119: Remove script to clean up datadirsJonas Schnelli
fa85de9ff Remove script to clean up datadirs (MarcoFalke) Pull request description: This reverts commit 33c055c4f1eca07bd914a5b40a21f92ad82dde9f. (#2295) Tree-SHA512: 0f0dceaf7912cbfa6e64ac55177592e39b99d2aa59d47609c853093ea2e93f5d80d0390f65f26535d5a94e576c55737fdb8c9e463679e9c790656b95b1b58b36
2018-04-30nit: fix typo for entry description stringmryandao
2018-04-29Remove script to clean up datadirsMarcoFalke
This reverts commit 33c055c4f1eca07bd914a5b40a21f92ad82dde9f. (#2295)
2018-04-29util: Store debug log file path in BCLog::Logger member.Jim Posen
This breaks the cyclic between logging and util.
2018-04-29scripted-diff: Rename BCLog::Logger member variables.Jim Posen
-BEGIN VERIFY SCRIPT- sed -i "s/fileout/m_fileout/" src/logging.h src/logging.cpp sed -i "s/mutexDebugLog/m_file_mutex/" src/logging.h src/logging.cpp sed -i "s/vMsgsBeforeOpenLog/m_msgs_before_open/" src/logging.h src/logging.cpp sed -i "s/logCategories/m_categories/" src/logging.h src/logging.cpp sed -i "s/fPrintToConsole/m_print_to_console/" src/logging.h src/logging.cpp src/init.cpp sed -i "s/fPrintToDebugLog/m_print_to_file/" src/logging.h src/logging.cpp src/init.cpp src/test/test_bitcoin.cpp src/bench/bench_bitcoin.cpp sed -i "s/fLogTimestamps/m_log_timestamps/" src/logging.h src/logging.cpp src/init.cpp sed -i "s/fLogTimeMicros/m_log_time_micros/" src/logging.h src/logging.cpp src/init.cpp sed -i "s/fReopenDebugLog/m_reopen_file/" src/logging.h src/logging.cpp src/init.cpp sed -i "s/fStartedNewLine/m_started_new_line/" src/logging.h src/logging.cpp -END VERIFY SCRIPT-
2018-04-29util: Refactor GetLogCategory.Jim Posen
Changing parameter types from pointers to references and uint32_t to BCLog::LogFlags simplies calling code.
2018-04-27Merge #13077: Add compile time checking for all cs_KeyStore runtime locking ↵MarcoFalke
assertions 66dc662c8a Add compile time checking for all cs_KeyStore runtime locking assertions (practicalswift) Pull request description: Add compile time checking for all `cs_KeyStore` runtime locking assertions. This PR is a subset of #12665. The PR was broken up to make reviewing easier. The intention is that literally all `EXCLUSIVE_LOCKS_REQUIRED`/`LOCKS_EXCLUDED`:s added in this PR should follow either directly or indirectly from `AssertLockHeld(…)`/`AssertLockNotHeld(…)`:s already existing in the repo. Consider the case where function `A(…)` contains `AssertLockHeld(cs_foo)` (without first locking `cs_foo` in `A`), and that `B(…)` calls `A(…)` (without first locking `cs_main`): * It _directly_ follows that: `A(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation. * It _indirectly_ follows that: `B(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation. Tree-SHA512: 84ee5459e7f75f9affaa4275cb760576ab0e26da8a48b9a4a59b51a25418fe4b862ba832cb01312479a8c9b0e38ee8b6c4076bcbbd73213346d09ec2057fc9f1