aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-07-17Merge #10831: Batch flushing operations to the walletdb during top up and ↵Wladimir J. van der Laan
increase keypool size. b0e8e2d Print one log message per keypool top-up, not one per key. (Gregory Maxwell) 41dc163 Increase wallet default keypool size to 1000. (Gregory Maxwell) 30d8f3a Pushdown walletdb though CWallet::AddKeyPubKey to avoid flushes. (Gregory Maxwell) 3a53f19 Pushdown walletdb object through GenerateNewKey/DeriveNewChildKey. (Gregory Maxwell) Pull request description: This carries the walletdb object from top-up through GenerateNewKey/DeriveNewChildKey/CWallet::AddKeyPubKey, which allows us to avoid the flush on destruction until the top up finishes instead of flushing the wallet for every key. This speeds up adding keys by well over 10x on my laptop (actually something like 17x), I wouldn't be surprised if it were an even bigger speedup on spinning rust. Then it increases the keypool size to 1000. I would have preferred to use 10,000 but in the case where the user creates a new wallet and then turns on encryption it seems kind of dumb to have >400KB of marked-used born unencrypted keys just laying around. (Thanks to Matt for cluesticking me on how to bypass the crypter spaghetti) Tree-SHA512: 868303de38fce4c3f67d7fe133f765f15435c94b39d252d7450b5fee5c607a3cc2f5e531861a69d8c8877bf130e0ff4c539f97500a6bc0ff6d67e4a42c9385c7
2017-07-17Merge #10832: init: Factor out AppInitLockDataDirectory and fix startup core ↵Wladimir J. van der Laan
dump issue dba485d init: Factor out AppInitLockDataDirectory (Wladimir J. van der Laan) Pull request description: Alternative to #10818, alternative solution to #10815. After this change: All the AppInit steps before and inclusive AppInitLockDataDirectory must not have Shutdown() called in case of failure. Only when AppInitMain fails, Shutdown should be called. Changes the GUI and bitcoind code to consistently do this. Tree-SHA512: 393e1a0ae05eb8e791025069e3ac4f6f3cdeb459ec63feda85d01cf6696ab3fed7632b6a0ac3641b8c7015af51d46756b5bba77f5e5f0c446f0c2dea58bbc92e
2017-07-17Print one log message per keypool top-up, not one per key.Gregory Maxwell
2017-07-17Increase wallet default keypool size to 1000.Gregory Maxwell
2017-07-17Pushdown walletdb though CWallet::AddKeyPubKey to avoid flushes.Gregory Maxwell
This prevents the wallet from being flushed between each and every key during top-up. This results in a >10x speed-up for the top-up.
2017-07-17Merge #10834: Remove declaration of unused method: void ↵MarcoFalke
UpdatedTransaction(const uint256 &) e061d8d Remove declaration of unused function: void UpdatedTransaction(const uint256 &) (practicalswift) Pull request description: Remove declaration of unused method: `void UpdatedTransaction(const uint256 &)` Removed in 9fececb2cbabc52cc375b84bf840fac018cc8121. Tree-SHA512: a328e00ccecc2a31cda7e204ab8c29ea34811afc2090f3dfd88d6d58543761dba8a289585d30b98e05236c67b1a04844e556a3b05d6e8e706233bc502f31af1d
2017-07-17init: Factor out AppInitLockDataDirectoryWladimir J. van der Laan
Alternative to #10818, alternative solution to #10815. After this change: All the AppInit steps before and inclusive AppInitLockDataDirectory must not have Shutdown() called in case of failure. Only when AppInitMain fails, Shutdown should be called. Changes the GUI and bitcoind code to consistently do this.
2017-07-17Merge #10837: Fix resource leak on error in GetDevURandomWladimir J. van der Laan
a8ae0b2 Fix resource leak (Dag Robole) Pull request description: Fixes a potential file handle leak when size of entropy is invalid Tree-SHA512: 692d24daaf370bba1f842925b037275126f9494f54769650bcf5829c794a0fb8561a86f42347bdf088a484e4f107bce7fa14cd7bdbfb4ecfbeb51968953da3ae
2017-07-17Merge #10803: Explicitly search for bdb5.3.Wladimir J. van der Laan
1cc251f Explicitly search for bdb5.3. (Patrick Strateman) Pull request description: Some systems do not symlink the major version to the minor version. Tree-SHA512: 09c030f08442cbe54928a6d20bec31aae2662facf60b859ff9febd84f0711f68d7f920b84fb015764585b305d48faf74c5fe9c3c6a713a0809b78ec066187dd9
2017-07-17Merge #10706: Improve wallet fee logic and fix GUI bugsWladimir J. van der Laan
11590d3 Properly bound check conf_target in wallet RPC calls (Alex Morcos) fd29d3d Remove checking of mempool min fee from estimateSmartFee. (Alex Morcos) 2fffaa9 Make QT fee displays use GetMinimumFee instead of estimateSmartFee (Alex Morcos) 1983ca6 Use CoinControl to pass custom fee setting from QT. (Alex Morcos) 03ee701 Refactor to use CoinControl in GetMinimumFee and FeeBumper (Alex Morcos) ecd81df Make CoinControl a required argument to CreateTransaction (Alex Morcos) Pull request description: This builds on #10589 (first 5 commits from that PR, last 5 commits are new) The first couple commits refactor to use the CCoinControl class to pass fee calculation parameters around. This allows for fixing the buggy interaction in QT between the global payTxFee which can be modified by the RPC call settxfee or temporarily modified by the QT custom fee settings. Before these changes the GUI could sometimes send a transaction with a recently set payTxFee and not respect the settings displayed in the GUI. After these changes, using the GUI does not involve the global transaction confirm target or payTxFee. The prospective fee displays in the smart fee slider and the coin control dialog are changed to use the fee calculation from GetMinimumFee, this simplifies the code and makes them slightly more correct in edge cases. Maxing the fee calculation with the mempool min fee is move from estimateSmartFee to GetMinimumFee. This fixes a long standing bug, and should be tagged for 0.15 as it is holding up finalizing the estimatesmartfee RPC API before release. Tree-SHA512: 4d36a1bd5934aa62f3806d380fcafbef73e9fe5bdf190fc5259a3e3a13349e5ce796e50e7068c46dc630ccf56d061bce5804f0bfe2e082bb01ca725b63efd4c1
2017-07-17Merge #10330: [wallet] fix zapwallettxes interaction with persistent mempoolMarcoFalke
4c3b538 [logs] fix zapwallettxes startup logs (John Newbery) e7a2181 [wallet] fix zapwallettxes interaction with persistent mempool (John Newbery) ff7365e [tests] fix flake8 warnings in zapwallettxes.py (John Newbery) Pull request description: zapwallettxes previously did not interact well with persistent mempool. zapwallettxes would cause wallet transactions to be zapped, but they would then be reloaded from the mempool on startup. This commit softsets persistmempool to false if zapwallettxes is enabled so transactions are actually zapped. This PR also fixes the zapwallettxes.py functional test, which did not properly test this feature. The test line: ```py assert_raises(JSONRPCException, self.nodes[0].gettransaction, [txid3]) #there must be a expection because the unconfirmed wallettx0 must be gone by now ``` is not actually testing the presence of the transaction since the RPC is being called incorrectly (with an array instead of a string). The `assert_raises()` passes since an assert is raised, but it's not the one the test writer had in mind! Fixes #9710 . Tree-SHA512: e3236efc7a2fd2b3bf1d9e2e8a7726d470c57f5d95cf41b7bde264edc8817bd36a6f3feff52f8de8db0ef64b7247c88b24e7ff7cefaa706cba86fe4e2135a508
2017-07-16Merge #10842: Fix incorrect Doxygen tag (@ince → @since). Doxygen ↵MarcoFalke
parameter name matching. 2c2e90d Fix incorrect Doxygen tag (@ince → @since). Make Doxygen parameter names match actual parameter names. (practicalswift) Pull request description: Doxygen fixes: * Fix incorrect Doxygen tag (`@ince` → `@since`). * Make Doxygen parameter names match actual parameter names. Tree-SHA512: cb1d37a7d15a90d24affaf5c2bcf462663f0b0c13868bb25401e5d8cb303fcb41e53fdeee8012b2271a509112ef98fc0c070b4194f42cd55361f7e6bc7996342
2017-07-16Merge #10739: test: Move variable `state` down where it is usedMarcoFalke
5618b7d Do not shadow upper local variable `state`. (Pavel Janík) Pull request description: Tests added in #10192 emit few shadowing warnings: ``` test/txvalidationcache_tests.cpp:268:26: warning: declaration shadows a local variable [-Wshadow] test/txvalidationcache_tests.cpp:296:26: warning: declaration shadows a local variable [-Wshadow] test/txvalidationcache_tests.cpp:357:26: warning: declaration shadows a local variable [-Wshadow] ``` Remove shadowing declarations and reuse the upper local declaration as in other already present test cases. Tree-SHA512: 1e3c52cf963f8f33e729900c8ecdcd5cc6fe28caa441ba53c4636df9cc3d1a351ca231966d36384589f1340ae8ddd447424c2ee3e8527d334d0412f0d1a10c8f
2017-07-16Fix incorrect Doxygen tag (@ince → @since). Make Doxygen parameter names ↵practicalswift
match actual parameter names.
2017-07-16Merge #10735: Avoid static analyzer warnings regarding uninitialized argumentsPieter Wuille
6835cb0ab Avoid static analyzer warnings regarding uninitialized arguments (practicalswift) Pull request description: Avoid static analyzer warnings regarding _"Function call argument is a pointer to uninitialized value"_ in cases where we are intentionally using such arguments. This is achieved by using `f(b.begin(), b.end())` (`std::array<char, N>`) instead of `f(b, b + N)` (`char b[N]`). Rationale: * Reduce false positives by guiding static analyzers regarding our intentions. Before this commit: ```shell $ clang-tidy-3.5 -checks=* src/bench/base58.cpp bench/base58.cpp:23:9: warning: Function call argument is a pointer to uninitialized value [clang-analyzer-core.CallAndMessage] EncodeBase58(b, b + 32); ^ $ clang-tidy-3.5 -checks=* src/bench/verify_script.cpp bench/verify_script.cpp:59:5: warning: Function call argument is a pointer to uninitialized value [clang-analyzer-core.CallAndMessage] key.Set(vchKey, vchKey + 32, false); ^ $ ``` After this commit: ```shell $ clang-tidy-3.5 -checks=* src/bench/base58.cpp $ clang-tidy-3.5 -checks=* src/bench/verify_script.cpp $ ``` Tree-SHA512: 5814a320ca8b959d0954bb64393424bcad73f942d2e988de1cd6788f39153b93900325532f2e340de02d740a3953385d212ae08e7ec72bb4c394a40475f251df
2017-07-16Merge #10844: Use range based for loopPieter Wuille
d0413c670 Use range based for loop (René Nyffenegger) Pull request description: Instead of iterating over 0 .. 1 and then deciding on an actual desired value, use a range based for loop for the desired value. Tree-SHA512: 0a7a4a80516c9f16cf97fa7d257088b8386360e19b93c4deac3d745b6270ea452c513821686d7d14a159a235763e034f9b14eef222ca15f7eb71c37bd1c2c380
2017-07-16Merge #10840: Remove duplicate includePieter Wuille
c53369cc2 Remove duplicate include (practicalswift) Pull request description: Remove duplicate include. Introduced in 5c643241e5d98992c0d5487b65e9c7b6d8005d1a. Tree-SHA512: c273cb60824b3a2b2bdebdc4fc84b309d66042d616ccfc9a7b1ee55380af0ab7d1ae059391b3b46063847087a1985e2491d4ce203a31a2b1c586e8fd531d9336
2017-07-16Merge #10766: Building Environment: Set ARFLAGS to crPieter Wuille
912da1dcc Use AC_ARG_VAR to set ARFLAGS. (René Nyffenegger) Pull request description: Override the default of ARFLAGS of `cru` to `cr`. When building, ar produces a warning for each archive, for example ``` AR libbitcoin_server.a /usr/bin/ar: `u' modifier ignored since `D' is the default (see `U') ``` Since `u` is the default anyway, it cannot hurt to remove it. Tree-SHA512: 7466764f847b70f0f67db25dac87a7794477abf1997cb946682f394fe80ae86ac3ed52cbadb35f0c18a87467755bde5a5158430444cd26fb60fa363cc7bd486d
2017-07-16Merge #10820: Use cpuid intrinsics instead of asm codePieter Wuille
674848fe1 Clarify entropy source (Pieter Wuille) a9e82f651 Use cpuid intrinsics instead of asm code (Pieter Wuille) Pull request description: Less platform-specific code is better. Tree-SHA512: 14f1b9accd9882859acdf516d2ada7ccb0ad92a3b3edf95b9cb8a8e514d4b1748d4555bcfb560779792c4f664f920d681ae42e9cebd0e6410f13f94c3a8729a0
2017-07-16Use range based for loopRené Nyffenegger
Instead of iterating over 0 .. 1 and then deciding on an actual desired value, use a range based for loop for the desired value.
2017-07-16Remove duplicate includepracticalswift
2017-07-16Pushdown walletdb object through GenerateNewKey/DeriveNewChildKey.Gregory Maxwell
This is needed but not sufficient for batching the wallet flushing when topping up the keypool.
2017-07-15Merge #10235: Track keypool entries as internal vs external in memoryPieter Wuille
d40a72ccb Clarify *(--.end()) iterator semantics in CWallet::TopUpKeyPool (Matt Corallo) 28301b978 Meet code style on lines changed in the previous commit (Matt Corallo) 4a3fc3562 Track keypool entries as internal vs external in memory (Matt Corallo) Pull request description: This is an alternative version of #10184. As @jonasschnelli points out there, the performance regressions are pretty minimal, but given that this is a pretty simple, mechanical change, its probably worth doing. Tree-SHA512: e83f9ebf2998f8164d1b2eebe5e6dcdeadea8c30b7612861f830758c08bf4093cd6a67b3bcfa9cfcb139e5e0b106fc8898a975fc69f334981aefc756568ab613
2017-07-15Use AC_ARG_VAR to set ARFLAGS.René Nyffenegger
The user can set ARFLAGS in the ./configure step with ./configure ARFLAGS=... If he chooses not to do so, ARFLAGS will be set to cr.
2017-07-15Merge #10812: [utils] Allow bitcoin-cli's -rpcconnect option to be used with ↵Pieter Wuille
square brackets 5c643241e [utils] allow square brackets for ipv6 addresses in bitcoin-cli (John Newbery) fe4fabaf1 [refactor] move SplitHostPort() into utilstrencodings (John Newbery) Pull request description: bitcoin-cli's `-rpcconnect` can accept ipv6 addresses (as long as the libevent version is new enough), but fails to parse ipv6 with square brackets. This PR makes `bitcoin-cli` parse ipv6 in square brackets correctly. `bitcoin-cli -rpcconnect=[::1] <command>` should now be equivalent to `bitcoin-cli -rpcconnect=::1 <command>` This is useful so the `bitcoin-cli` option can now be in the same format as the `bitcoind` option. Doesn't include tests. I have a branch that fully tests `bitcoin-cli`, but that's queued behind several intermediate PRs. - first commit moves `SplitHostPort()` from libbitcoin_common into libbitcoin_util - second commit adds proper ipv6 parsing to bitcoin-cli Tree-SHA512: 249d409f10360c989474283341f458cc97364a56a7d004ae6d5f13d8bffe3a51b5dc2484d42218848e2d42cd9c0b13a1b92e94ea19b209f7e91c875c208d8409
2017-07-15Fix resource leakDag Robole
2017-07-15[logs] fix zapwallettxes startup logsJohn Newbery
2017-07-15Merge #10760: Avoid dereference-of-casted-pointerPieter Wuille
0aadc11fd Avoid dereference-of-casted-pointer (Pieter Wuille) Pull request description: And prefer a static_cast to the intended reference type. Tree-SHA512: e83b20023a4dca6029b46f7040a8a6fd54e1b42112ec0c87c3c3b567ed641de97a9e2335b57a2efb075491f641e5b977bc226a474276bea0c3c3c71d8d6ac54d
2017-07-15[wallet] fix zapwallettxes interaction with persistent mempoolJohn Newbery
zapwallettxes previously did not interact well with persistent mempool. zapwallettxes would cause wallet transactions to be zapped, but they would then be reloaded from the mempool on startup. This commit softsets persistmempool to false if zapwallettxes is enabled so transactions are actually zapped.
2017-07-15[tests] fix flake8 warnings in zapwallettxes.pyJohn Newbery
2017-07-15Merge #10807: getbalance example covers at least 6 confirmsPieter Wuille
228987d84 getbalance example covers at least 6 confirms (Gregory Sanders) Tree-SHA512: 328d60b007ee75d809f4d28a7d9e5537d3c1446bd30c4c2ae57c690b8e83f6287cbcd3d8c955e8ba07ab62e27f9d27497c55219ff14fd5af7759dec465673fa2
2017-07-15Remove declaration of unused function: void UpdatedTransaction(const uint256 &)practicalswift
2017-07-15Merge #10833: Fix typosPieter Wuille
0189d8ed1 Fix typos (practicalswift) Tree-SHA512: bac96ab13964e7579c93d63fc7550eb091c316767cc33f2a52c18cd786537650668799603414d418680a5e04516abf1e304b10d5f4ad48a5dcba24b3f09a0387
2017-07-15Fix typospracticalswift
2017-07-15Avoid static analyzer warnings regarding uninitialized argumentspracticalswift
Avoid static analyzer warnings regarding "Function call argument is a pointer to uninitialized value" in cases where we are intentionally using such arguments. This is achieved by using ... `f(b.begin(), b.end())` (`std::array<char, N>`) ... instead of ... `f(b, b + N)` (`char b[N]`) Rationale: * Reduce false positives by guiding static analyzers regarding our intentions. Before this commit: ``` $ clang-tidy-3.5 -checks=* src/bench/base58.cpp bench/base58.cpp:23:9: warning: Function call argument is a pointer to uninitialized value [clang-analyzer-core.CallAndMessage] EncodeBase58(b, b + 32); ^ $ clang-tidy-3.5 -checks=* src/bench/verify_script.cpp bench/verify_script.cpp:59:5: warning: Function call argument is a pointer to uninitialized value [clang-analyzer-core.CallAndMessage] key.Set(vchKey, vchKey + 32, false); ^ $ ``` After this commit: ``` $ clang-tidy-3.5 -checks=* src/bench/base58.cpp $ clang-tidy-3.5 -checks=* src/bench/verify_script.cpp $ ```
2017-07-14Properly bound check conf_target in wallet RPC callsAlex Morcos
2017-07-14Remove checking of mempool min fee from estimateSmartFee.Alex Morcos
This check has been moved to the wallet logic GetMinimumFee. The rpc call to estimatesmartfee will now no longer return a result maxed with the mempool min fee, but automated fee calculations from the wallet will produce the same result as before and coincontrol and sendcoins dialogs in the GUI will correctly display the right prospective fee. changes to policy/fees.cpp include a big whitespace indentation change.
2017-07-14Make QT fee displays use GetMinimumFee instead of estimateSmartFeeAlex Morcos
Remove helper function (CalculateEstimateType) for determining whether estimates should be conservative or not, now that this is only called once from GetMinimumFee and incorporate the logic directly there.
2017-07-14Use CoinControl to pass custom fee setting from QT.Alex Morcos
This fixes buggy behavior where we were temporarily setting and unsetting the global payTxFee when trying to send a transaction with a custom fee from the GUI. The previous behavior was inconsistent depending on the order of using the RPC call settxfee and clicking various radio buttons in the sendcoinsdialog. The new behavior is that transactions sent with the GUI will always use either the smartfee slider value or the custom fee set on the GUI and they will not affect the global defaults which are only for RPC and initial GUI values.
2017-07-14Refactor to use CoinControl in GetMinimumFee and FeeBumperAlex Morcos
Improve parameter precedence in coin_control
2017-07-14Make CoinControl a required argument to CreateTransactionAlex Morcos
2017-07-14Merge #10769: [Qt] replace fee slider with a Dropdown, extend conf. targetsPieter Wuille
2aef1f182 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90e3 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
2017-07-14Merge #10816: Properly forbid -salvagewallet and -zapwallettxes for multi ↵Pieter Wuille
wallet. dd97a529a Properly forbid -salvagewallet and -zapwallettxes for multi wallet. (Alex Morcos) Tree-SHA512: dcde8f854ae957b4d3af4bcf1b811e0b6e9b93602764f86499e46a28d304cd4ee93ba058c03f6ca74ccb60e1310c83e53b698c64d93e5503115377655b80d44d
2017-07-14Clarify *(--.end()) iterator semantics in CWallet::TopUpKeyPoolMatt Corallo
2017-07-14Meet code style on lines changed in the previous commitMatt Corallo
2017-07-14Track keypool entries as internal vs external in memoryMatt Corallo
This resolves a super minor performance regressions in several keypool-handling functions
2017-07-14Merge #10808: Avoid some new gcc warnings in 15Pieter Wuille
c73b8be24 Explicitly initialize prevector::_union to avoid new warning (Matt Corallo) 1016dacfa Fix signed/unsigned comparison warning introduced in c8e29d7ff0. (Matt Corallo) Tree-SHA512: d1574b0fdc9bfddc3517c382d34418b1d8ed80c81d2f6fd19378c064af8d7704fb84ef8b740ff97f7ec7609bd6de76348921fcc227e1ce97127947a0d22c7887
2017-07-14Explicitly initialize prevector::_union to avoid new warningMatt Corallo
Warning from gcc 7.1 is ./prevector.h:450:25: warning: '*((void*)(&<anonymous>)+8).prevector<28, unsigned char>::_union.prevector<28, unsigned char>::direct_or_indirect::<anonymous>.prevector<28, unsigned char>::direct_or_indirect::<unnamed struct>::indirect' may be used uninitialized in this function [-Wmaybe-uninitialized]
2017-07-14Merge #10618: Remove confusing MAX_BLOCK_BASE_SIZE.Pieter Wuille
3babbcb48 Remove confusing MAX_BLOCK_BASE_SIZE. (Gregory Maxwell) Tree-SHA512: 361293fc4e1e379cd5a0908ed0866a00e1c7a771bdf02fded158fca21b492a29c7a67fea0d13dc40b2a04204c89823bf1836fe5b63a17c9747751b9c845a3527
2017-07-14Merge #10819: Fix uninitialized atomic variablesPieter Wuille
465279114 Fix uninitialized atomic variables (João Barbosa) Tree-SHA512: 5dd8924bc8743a094abdbc2464b835a0e7fd4948c102ea7c2251c6330bea5615c4459ba322a656fd6ac5f8d695b69d3709d225ddccef226cf8afc7de5e3d3019