aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-02-16Create getaddressinfo RPC and deprecate parts of validateaddressAndrew Chow
Moves the parts of validateaddress which require the wallet into getaddressinfo which is part of the wallet RPCs. Mark those parts of validateaddress which require the wallet as deprecated. Validateaddress will call getaddressinfo for the data that both share for right now. Moves IsMine functions to libbitcoin_common and then links libbitcoin_wallet before libbitcoin_common in order to prevent linker errors since IsMine is no longer used in libbitcoin_server.
2018-02-16[rpc] Move DescribeAddressVisitor to rpc/utilJohn Newbery
2018-02-15[rpc] split wallet and non-wallet parts of DescribeAddressVisitorJohn Newbery
2018-02-15Merge #12427: Make signrawtransaction accept P2SH-P2WSH redeemscriptsWladimir J. van der Laan
5f605e1 Make signrawtransaction accept P2SH-P2WSH redeemscripts (Pieter Wuille) Pull request description: This is a quick fix for #12418, which is a regression in 0.16. It permits specifying just the inner redeemscript to let `signrawtransaction` succeed. This inner redeemscript is already reported by `addmultisigaddress` & co. #11708 uses a different approach, where `listunspent` reports both inner & outer redeemscript, but requires both to be provided to `signrawtransaction`. Part of #11708 is still needed even in combination with this PR however, as currently the inner redeemscript isn't reported by `listunspent`. Tree-SHA512: a6fa2b2661ce04db25cf029dd31da39c0b4811d43692f816dfe0f77b4159b5e2952051664356a579f690ccd58a626e0975708afcd7ad5919366c490944e3a9a5
2018-02-15Merge #12349: shutdown: fix crash on shutdown with reindex-chainstateWladimir J. van der Laan
ceaefdd fix possible shutdown assertion with -reindex-shutdown (Cory Fields) Pull request description: Fixes the assertion error reported here: https://github.com/bitcoin/bitcoin/pull/12349#issuecomment-365095741 Tree-SHA512: db8e2a275f92a99df7f17852d00eba6df996e412aa3ed3853a9ea0a8cb9800760677532efd52f92abbf2cdcc4210957a87a5f919ac998d46c205365a7a7dffca
2018-02-15Merge #12422: util: Make LockDirectory thread-safe, consistent, and fix ↵Wladimir J. van der Laan
OpenBSD 6.2 build 1d4cbd2 test: Add unit test for LockDirectory (Wladimir J. van der Laan) fc888bf util: Fix multiple use of LockDirectory (Wladimir J. van der Laan) Pull request description: Wrap the `boost::interprocess::file_lock` in a `std::unique_ptr` inside the map that keeps track of per-directory locks. This fixes a build issue with the clang 4.0.0+boost-1.58.0p8 version combo on OpenBSD 6.2, and should have no effect otherwise. Also add a unit test, make the function thread-safe, and fix Linux versus Windows behavior inconsistency. Meant to fix #12413. Tree-SHA512: 1a94c714c932524a51212c46e8951c129337d57b00fd3da5a347c6bcf6a947706cd440f39df935591b2079995136917f71ca7435fb356f6e8a128c509a62ec32
2018-02-15Merge #12356: Fix 'mempool min fee not met' debug outputWladimir J. van der Laan
bb00c95 Consistently use FormatStateMessage in RPC error output (Ben Woosley) 8b8a1c4 Add test for 'mempool min fee not met' rpc error (Ben Woosley) c04e0f6 Fix 'mempool min fee not met' debug output (Ben Woosley) Pull request description: Output the value that is tested, rather than the unmodified fee value. Prompted by looking into: #11955 Tree-SHA512: fc0bad47d4af375d208f657a6ccbad6ef7f4e2989ae2ce1171226c22fa92847494a2c55cca687bd5a1548663ed3313569bcc31c00d53c0c193a1b865dd8a7657
2018-02-15test: Add unit test for LockDirectoryWladimir J. van der Laan
Add a unit test for LockDirectory, introduced in #11281.
2018-02-15util: Fix multiple use of LockDirectoryWladimir J. van der Laan
This commit fixes problems with calling LockDirectory multiple times on the same directory, or from multiple threads. It also fixes the build on OpenBSD. - Wrap the boost::interprocess::file_lock in a std::unique_ptr inside the map that keeps track of per-directory locks. This fixes a build issue with the clang 4.0.0+boost-1.58.0p8 version combo on OpenBSD 6.2, and should have no observable effect otherwise. - Protect the locks map using a mutex. - Make sure that only locks that are successfully acquired are inserted in the map. - Open the lock file for appending only if we know we don't have the lock yet - The `FILE* file = fsbridge::fopen(pathLockFile, "a");` wipes the 'we own this lock' administration, likely because it opens a new fd for the locked file then closes it.
2018-02-15Merge #12426: qt: Initialize members in WalletModelWladimir J. van der Laan
fa27623 qt: Initialize members in WalletModel (MarcoFalke) Pull request description: This prevents segfaults (or errors when running qt in valgrind) ``` Conditional jump or move depends on uninitialised value(s) WalletModel::checkBalanceChanged() (walletmodel.cpp:156) Tree-SHA512: 38c8c03c7fa947edb3f1c13eab2ac7a62ef8f8141603c2329a7dc5821a887a349af8014dc739b762e046f410f44a9c6653b6930f08b53496cf66381cadc06246
2018-02-15Merge #12415: Interrupt loading thread after shutdown requestWladimir J. van der Laan
2e9406c Interrupt loading thread after shutdown request (João Barbosa) Pull request description: This change (currently) avoids loading the mempool if shutdown is requested. Tree-SHA512: 3dca3a6ea5b09bd71db0974584d93dfe81819bc0bdbb4d9b6fa0474755306d1403f6c058ecb8211384493a8f7ca3a9134173db744b7344043cfc7d79286c8fd4
2018-02-14Merge #11733: qt: Remove redundant locksWladimir J. van der Laan
d6f3a73 Remove redundant locks (practicalswift) Pull request description: Remove redundant locks: * ~~`FindNode(...)` is locking `cs_vNodes` internally~~ * `SetAddressBook(...)` is locking `cs_wallet` internally * `DelAddressBook(...)` is locking `cs_wallet` internally **Note to reviewers:** From what I can tell these locks are redundantly held from a data integrity perspective (guarding specific variables), and they do not appear to be needed from a data consistency perspective (ensuring a consistent state at the right points). Review thoroughly and please let me know if I'm mistaken :-) Tree-SHA512: 7e3ca2d52fecb16385dc65051b5b20d81b502c0025d70b0c489eb3881866bdd57947a9c96931f7b213f5a8a76b6d2c7b084dff0ef2028a1e9ca9ccfd83e5b91e
2018-02-14Merge #11866: Do not un-mark fInMempool on wallet txn if ATMP fails.Wladimir J. van der Laan
6ef86c9 Do not un-mark fInMempool on wallet txn if ATMP fails. (Matt Corallo) Pull request description: Irrespective of the failure reason, un-marking fInMempool out-of-order is incorrect - it should be unmarked when TransactionRemovedFromMempool fires. Clean up of #11839, which I think was the wrong fix. Tree-SHA512: 580731297eeac4c4c99ec695e15b09febf62249237bc367fcd1830fc811d3166f9336e7aba7f2f6f8601960984ae22cebed781200db0f04e7cd2008db1a83f64
2018-02-14Merge #12409: rpc: Reject deprecated reserveChangeKey in fundrawtransactionWladimir J. van der Laan
fa5f518 rpc: Reject deprecated reserveChangeKey in fundrawtransaction (MarcoFalke) Pull request description: Tree-SHA512: 8506d1494b13c4582b1379e3b8c3906016f1980ebe847727a43a90e7bb9f71b896a1792bc97a8dc7320ccce0534050eb04f92a6f82f811d08efa74a98b3e43f0
2018-02-13Make signrawtransaction accept P2SH-P2WSH redeemscriptsPieter Wuille
2018-02-13Merge #12424: Fix rescan test failure due to unset g_address_type, g_change_typePieter Wuille
b7f6002ed5 Fix rescan test failure due to unset g_address_type, g_change_type (Russell Yanofsky) Pull request description: New global variables were introduced in #11403 and not setting them causes: ``` test_bitcoin: wallet/wallet.cpp:4259: CTxDestination GetDestinationForKey(const CPubKey&, OutputType): Assertion `false' failed. unknown location(0): fatal error in "importwallet_rescan": signal: SIGABRT (application abort requested) ``` It's possible to reproduce the failure reliably by running: ``` src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/importwallet_rescan ``` Failures happen nondeterministically because boost test framework doesn't run tests in a specified order, and tests that run previously can set the global variables and mask the bug. This is similar to bug #12150. Example travis failure is https://travis-ci.org/bitcoin/bitcoin/jobs/340642010 Tree-SHA512: ab40662b3356892b726f1f552e22d58d86b5e982538741e52b37ee447a0c97c76c24ae543687edf2e25d9dd925722909d37abfae95d93bf09e23fa245a4c3351
2018-02-13qt: Initialize members in WalletModelMarcoFalke
2018-02-13Fix rescan test failure due to unset g_address_type, g_change_typeRussell Yanofsky
New global variables were introduced in #11403 and not setting them causes: test_bitcoin: wallet/wallet.cpp:4259: CTxDestination GetDestinationForKey(const CPubKey&, OutputType): Assertion `false' failed. unknown location(0): fatal error in "importwallet_rescan": signal: SIGABRT (application abort requested) It's possible to reproduce the failure reliably by running: src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/importwallet_rescan Failures happen nondeterministically because boost test framework doesn't run tests in a specified order, and tests that run previously can set the global variables and mask the bug.
2018-02-13Merge #11966: clientversion: Use full commit hash for commit-based version ↵Wladimir J. van der Laan
descriptions a71c56a clientversion: Use full commit hash for commit-based version descriptions (Luke Dashjr) Pull request description: git keeps changing the number of digits in abbreviated hashes, resulting in the GitHub archive hash changing because we include it here. To workaround this and avoid hashes that become increasingly ambiguous later on, just include the full commit hash when building from git. This has no effect on tagged releases. (Cleanly mergable back to 0.10 without backport) Tree-SHA512: b0be5391fadd16fbc9bbeffe1574a61c95931cbf6dea885d7e3cfcd3474b89e71767b1b55b4eeeeb66e4e119e78ff579cd9d206366d36928a209a31e1c1eed75
2018-02-13fix possible shutdown assertion with -reindex-shutdownCory Fields
Credit @eklitzke for reproducing.
2018-02-12Fix Windows build errors introduced in #10498practicalswift
Fixes #12386
2018-02-12Merge #12193: RPC: Consistently use UniValue.pushKV instead of ↵MarcoFalke
push_back(Pair()) (karel-3d) 91986ed206 scripted-diff: Use UniValue.pushKV instead of push_back(Pair()) (Karel Bilek) a570098021 Squashed 'src/univalue/' changes from 07947ff2da..51d3ab34ba (MarcoFalke) Pull request description: Rebased version of #11386 by karel-3d. Closes: #11386 Tree-SHA512: f3a81447e573c17e75813f4d41ceb34b9980eac81efdd98ddb149d7c51f792be7e2b32239b6ea7e6da68af23897afa6b4ce3f4e8070f9c4adf5105bf6075f2a0
2018-02-12Interrupt loading thread after shutdown requestJoão Barbosa
2018-02-12Merge #12296: wallet: Only fee-bump non-conflicted/non-confirmed txesJonas Schnelli
faca18dcf feebumper: Use PreconditionChecks to determine bump eligibility (MarcoFalke) 718f05cab move more bumpfee prechecks to feebumper::PreconditionChecks (Gregory Sanders) Pull request description: This only affects the gui. Fee-bumping of transactions that are already confirmed or are already conflicted by other transactions should not be offered by the gui. Tree-SHA512: 4acf8087c69fbe5bd67be0485cdb4055e985bbf84acc420aa786ad31e2dc6c2572baaac1d359af10a6907790f626edca690285d9a46ae5440900ea12624c634f
2018-02-12Merge #12351: Libraries: Use correct type ; avoid compiler warnings.Wladimir J. van der Laan
a25cb0f Use ptrdiff_t type to more precisely indicate usage and avoid compiler warnings. (murrayn) Pull request description: ptrdiff_t is a more strictly correct type, and gets rid of compiler warnings. Tree-SHA512: 39718a5cdc10e698f14185f4622a9b439728bce619bd8b3a86f2b99ed5b056cf5a8545a3e5c4bc8a6a01b845fb73510036cee5e6d2629c58df26be692a957fba
2018-02-12Merge #12393: Fix a-vs-an typosWladimir J. van der Laan
11376b5 Fix a-vs-an typos (practicalswift) Pull request description: Fix a-vs-an typos. Tree-SHA512: 2cf74c15656a20ec13d2da7d86a39d14e634db368833d92da06a78d1266950accfc4fcc89cfecdaadd46e6b48b17e6fad29080428e564871e78482c53f3e855c
2018-02-12Merge #12381: Remove more boost threadsWladimir J. van der Laan
004f999 boost: drop boost threads for [alert|block|wallet]notify (Cory Fields) 0827267 boost: drop boost threads from torcontrol (Cory Fields) ba91724 boost: remove useless threadGroup parameter from Discover (Cory Fields) f26866b boost: drop boost threads for upnp (Cory Fields) Pull request description: This doesn't completely get rid of boost::thread, but this batch should be easy to review, and leaves us with only threadGroup (scheduler + scriptcheck) remaining. Note to reviewers: The upnp diff changes a bunch of whitespace, it's much more clear with 'git diff -w' Tree-SHA512: 5a356798d0785f93ed143d1f0afafe890bc82f0d470bc969473da2d2aa78bcb9b096f7ba11b92564d546fb447d4bd0d347e7842994ea0170aafd53fda7e0a66e
2018-02-12Merge #12392: Fix ignoring tx data requests when fPauseSend is set on a peerWladimir J. van der Laan
c4af738 Fix ignoring tx data requests when fPauseSend is set on a peer (Matt Corallo) Pull request description: This resolves a bug introduced in 66aa1d58a158991a8014a91335b5bc9c00062f56 where, if when responding to a series of transaction requests in a getdata we hit the send buffer limit and set fPauseSend, we will skip one transaction per call to ProcessGetData. Bug found by Cory Fields (@theuni). Probably worth slipping into 0.16 :/. Tree-SHA512: a9313cef8ac6da31eb099c9925c8401a638220cf7bc9b7b7b83151ecae4b02630f2db45ef6668302b9bb0f38571afbd764993427f1ec9e4d74d9a3be6647d299
2018-02-12Merge #12401: Reset pblocktree before deleting LevelDB fileWladimir J. van der Laan
a8b5d20 Reset pblocktree before deleting LevelDB file (Sjors Provoost) Pull request description: #11043 repaced: ``` delete pblocktree; pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReset); ``` With: ``` pblocktree.reset(new CBlockTreeDB(nBlockTreeDBCache, false, fReset)); ``` This is problematic because `new CBlockTreeDB` tries to delete the existing file, which will fail with `LOCK: already held by process` if it's still open. That's the case for QT. When QT finds a problem with the index it will ask the user if they want to reindex. At that point it has already opened `blocks/index`. It then runs this [while loop](https://github.com/bitcoin/bitcoin/blob/v0.16.0rc3/src/init.cpp#L1415) again with `fReset = 1`, resulting in the above error. This change makes that error go away, presumably because `reset()` without an argument closes the file. Tree-SHA512: fde8b546912f6773ac64da8476673cc270b125aa2d909212391d1a2001b35c8260a8772126b99dfd76b39faaa286feb7c43239185fe584bd4dc2bc04a64044ce
2018-02-11Reset pblocktree before deleting LevelDB fileSjors Provoost
2018-02-11Fix a-vs-an typospracticalswift
2018-02-10rpc: Reject deprecated reserveChangeKey in fundrawtransactionMarcoFalke
2018-02-10scripted-diff: Use UniValue.pushKV instead of push_back(Pair())Karel Bilek
-BEGIN VERIFY SCRIPT- git grep -l "push_back(Pair" | xargs sed -i "s/push_back(Pair(\(.*\)));/pushKV(\1);/g" -END VERIFY SCRIPT-
2018-02-10univalue: Bump subtreeMarcoFalke
2018-02-10Merge #12128: Refactor: One CBaseChainParams should be enoughWladimir J. van der Laan
1687cb4 Refactor: One CBaseChainParams should be enough (Jorge Timón) Pull request description: There's no need for class hierarchy with CBaseChainParams, it is just a struct with 2 fields. This starts as a +10-43 diff Tree-SHA512: 0a7dd64ab785416550b541787c6083540e4962d76b6cffa806bb3593aec2daf1752dfe65ac5cd51b34ad5c31dd8292c422b483fdd2d37d0b7e68725498ed4c2d
2018-02-09Merge #11761: [docs] initial QT documentationWladimir J. van der Laan
c8edc2c [docs] initial QT documentation, move Qt Creator instructions (Sjors Provoost) Pull request description: I'll update this as I figure out how everything is tied together, but I think it's a useful enough start. Tree-SHA512: d96e5c9ba8ccc3a1b92a0894a8a8449317100eebb14e5d390b51793534458f50eac296cf2945fccf81b85aff23fa32d91d6015a0a76ada4f7091a400d7508ae5
2018-02-08Fix ignoring tx data requests when fPauseSend is set on a peerMatt Corallo
This resolves a bug introduced in 66aa1d58a158991a8014a91335b5bc9c00062f56 where, if when responding to a series of transaction requests in a getdata we hit the send buffer limit and set fPauseSend, we will skip one transaction per call to ProcessGetData. Bug found by Cory Fields (@theuni).
2018-02-08Merge #12225: Mempool cleanupsWladimir J. van der Laan
669c943 Avoid leaking prioritization information when relaying transactions (Suhas Daftuar) e868b22 fee estimator: avoid sorting mempool on shutdown (Suhas Daftuar) 0975406 Correct mempool mapTx comment (Suhas Daftuar) Pull request description: Following up on #12127 and #12118, this cleans up a comment that was left incorrect in txmempool.h, and addresses a couple of the observations @TheBlueMatt made about an unnecessary use of `queryHashes()` and a small information leak when prioritizing transactions. Left undone is nuking queryHashes altogether; that would require changing the behavior of the `getrawmempool` rpc call, which I think I might be in favor of doing, but wanted to save for its own PR. Tree-SHA512: c97d10b96dcd6520459287a4a2eda92774173757695100fcfe61e526aef86f394507c331d17f9e0c14b496c33ec46198a0f165a847762ca50f7c6780b993f162
2018-02-08Refactor: One CBaseChainParams should be enoughJorge Timón
2018-02-08boost: drop boost threads for [alert|block|wallet]notifyCory Fields
2018-02-08boost: drop boost threads from torcontrolCory Fields
2018-02-08boost: remove useless threadGroup parameter from DiscoverCory Fields
2018-02-08boost: drop boost threads for upnpCory Fields
2018-02-08Merge #12333: Make CWallet::ListCoins atomicWladimir J. van der Laan
2f960b5 [wallet] Indent only change of CWallet::AvailableCoins (João Barbosa) 1beea7a [wallet] Make CWallet::ListCoins atomic (João Barbosa) Pull request description: Fix a potencial race in `CWallet::ListCoins`. Replaces `cs_main` and `cs_wallet` locks by assertions in `CWallet::AvailableCoins`. Tree-SHA512: 09109f44a08b4b53f7605d950ab506d3f748490ab9aed474aa200e93f7b0b9f96f9bf60abe1c5f658240fd13d9e3267c0dd43fd3c1695d82384198ce1da8109f
2018-02-08[wallet] Indent only change of CWallet::AvailableCoinsJoão Barbosa
2018-02-08[wallet] Make CWallet::ListCoins atomicJoão Barbosa
2018-02-08Consistently use FormatStateMessage in RPC error outputBen Woosley
This will include the error code and debug output as well as the reason string. See #11955 for the motivation.
2018-02-08Fix 'mempool min fee not met' debug outputBen Woosley
Output the value that is tested, rather than the unmodified fee value.
2018-02-08Merge #12282: wallet: Disallow abandon of conflicted txesWladimir J. van der Laan
fa795cf wallet: Disallow abandon of conflicted txes (MarcoFalke) Pull request description: Abandon transactions that are already conflicted is a noop, so don't try and return false/throw instead. Tree-SHA512: fd2af4149bd2323f7f31fe18685c763790b8589319b4e467b464ab456d5e8971501ab16d124e57a22693666b06ae433ac3e59f0fd6dfbd2be2c6cae8be5bcbd8
2018-02-08Merge #12336: Remove deprecated rpc optionsWladimir J. van der Laan
db1cbcc [RPC] Remove deprecated addmultisigaddress return format (John Newbery) cb28a0b [RPC] Remove deprecated createmultisig object (John Newbery) ed45c82 [tests] Remove test for deprecated createmultsig option (John Newbery) d066a1c [rpc] Remove deprecated getmininginfo RPC option (John Newbery) c6f09c2 [rpc] remove deprecated estimatefee RPC (John Newbery) a8e437a [tests] Remove estimatefee from rpc_deprecated.py test (John Newbery) a5623b1 [tests] Remove tests for deprecated estimatefee RPC (John Newbery) d119f2e [tests] Fix style warnings in feature_fee_estimation.py (John Newbery) Pull request description: There were some RPC/RPC options deprecated in v0.16. Those can now be removed from master since v0.16 has been branched. - `estimatefee` RPC has been removed. The `feature_fee_estimation.py` test has been updated to remove the RPC, but doesn't yet have good coverage of the replacement RPC `estimatesmartfee`. Improving the test coverage should be done in a new PR. (#11031) - the `errors` field returned by `getmininginfo` has been deprecated and replaced by a `warning` field. (#10858) - providing addresses as inputs to `createmultisig` has been deprecated. Users should use `addmultisigaddress` instead (#11415) - The return format from `addmultisigaddress` has changed (#11415) `getwitnessaddress` was also deprecated in v0.16 and can be removed, but many tests are using that RPC, so it's a larger job to remove. It should be removed in a separate PR (possibly after #11739 and #11398 have been merged and the segwit test code tidied up) Tree-SHA512: 8ffaa5f6094131339b9e9e468e8b141de4b144697d2271efa2992b80b12eb97849ade3da8df5c1c9400ed4c04e6a029926550a3e5846d2029b644f9e84ac7124