aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
AgeCommit message (Collapse)Author
2018-03-07Merge #11372: Address encoding cleanupWladimir J. van der Laan
92f1f8b31 Split off key_io_tests from base58_tests (Pieter Wuille) 119b0f85e Split key_io (address/key encodings) off from base58 (Pieter Wuille) ebfe217b1 Stop using CBase58Data for ext keys (Pieter Wuille) 32e69fa0d Replace CBitcoinSecret with {Encode,Decode}Secret (Pieter Wuille) Pull request description: This PR contains some of the changes left as TODO in #11167 (and built on top of that PR). They are not intended for backporting. This removes the `CBase58`, `CBitcoinSecret`, `CBitcoinExtKey`, and `CBitcoinExtPubKey` classes, in favor of simple `Encode`/`Decode` functions. Furthermore, all Bitcoin-specific logic (addresses, WIF, BIP32) is moved to `key_io.{h,cpp}`, leaving `base58.{h,cpp}` as a pure utility that implements the base58 encoding/decoding logic. Tree-SHA512: a5962c0ed27ad53cbe00f22af432cf11aa530e3efc9798e25c004bc9ed1b5673db5df3956e398ee2c085e3a136ac8da69fe7a7d97a05fb2eb3be0b60d0479655
2018-03-05Merge #12516: Avoid unintentional unsigned integer wraparounds in testsWladimir J. van der Laan
2736c9e05 Avoid unintentional unsigned integer wraparounds in tests (practicalswift) Pull request description: Avoid unintentional unsigned integer wraparounds in tests. This is a subset of #11535 as suggested by @MarcoFalke :-) Tree-SHA512: 4f4ee8a08870101a3f7451aefa77ae06aaf44e3c3b2f7555faa2b8a8503f97f34e34dffcf65154278f15767dc9823955f52d1aa7b39930b390e57cdf2b65e0f3
2018-03-02Fix ListCoins test failure due to unset g_wallet_allow_fallback_feeRussell Yanofsky
New global variables were introduced in #11882 and not setting them causes: wallet/test/wallet_tests.cpp(638): error in "ListCoins": check wallet->CreateTransaction({recipient}, wtx, reservekey, fee, changePos, error, dummy) failed wallet/test/wallet_tests.cpp(679): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2] wallet/test/wallet_tests.cpp(686): error in "ListCoins": check available.size() == 2 failed [1 != 2] wallet/test/wallet_tests.cpp(705): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2] It's possible to reproduce the failure reliably by running: src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/ListCoins 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-03-01Merge #12182: Remove useless string initializationsWladimir J. van der Laan
19ac86e Remove useless string initialization. (Alin Rus) Pull request description: Tree-SHA512: 4273dd7e8ed083cc9d05fc70967465e405085b630c000f829648dd44dd0cfe2249f6af1498b02f54b4ca73833130b802488bae8eca0d4d0b803a6f0122b19e8f
2018-03-01Merge #11882: Disable default fallbackfee on mainnetWladimir J. van der Laan
3f592b8 [QA] add wallet-rbf test (Jonas Schnelli) 8222e05 Disable wallet fallbackfee by default on mainnet (Jonas Schnelli) Pull request description: Removes the default fallback fee on mainnet (but keeps it on testnet/regtest). Transactions using the fallbackfee in case the fallback fee has not been set are getting rejected. Tree-SHA512: e54d2594b7f954e640cc513a18b0bfbe189f15e15bdeed4fe02b7677f939bca1731fef781b073127ffd4ce08a595fb118259b8826cdaa077ff7d5ae9495810db
2018-02-25Disable wallet fallbackfee by default on mainnetJonas Schnelli
2018-02-25Merge #12287: Optimise lock behaviour for GuessVerificationProgress()Jonas Schnelli
90ba2df11 Fix missing cs_main lock for GuessVerificationProgress() (Jonas Schnelli) Pull request description: `GuessVerificationProgress()` needs `cs_main` due to accessing the `pindex->nChainTx`. This adds a `AssertLockHeld` in `GuessVerificationProgress()` and adds the missing locks in... * `LoadChainTip()` * `ScanForWalletTransactions()` (got missed in #11281) * GUI, `ClientModel::getVerificationProgress()` <--- **this may have GUI performance impacts**, but could be relaxed later with a cache or something more efficient. Tree-SHA512: 13302946571422375f32af8e396b9d2c1180f2693ea363aeba9e98c8266ddec64fe7862bfdcbb5a93a4b12165a61eec1e51e4e7d7a8515fa50879095dc163412
2018-02-23Avoid unintentional unsigned integer wraparounds in testspracticalswift
2018-02-19Split key_io (address/key encodings) off from base58Pieter Wuille
2018-02-19Stop using CBase58Data for ext keysPieter Wuille
2018-02-19Replace CBitcoinSecret with {Encode,Decode}SecretPieter Wuille
2018-02-17Split signrawtransaction into wallet and non-walletAndrew Chow
Splits signrwatransaction into a wallet version (signrawtransactionwithwallet) and non-wallet version (signrawtransactionwithkey). signrawtransaction is marked as DEPRECATED and will call the right signrawtransaction* command as per the parameters in order to maintain compatibility. Updated signrawtransactions test to use new RPCs
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-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-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-13Remove useless string initialization.Alin Rus
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-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-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 #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-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-08boost: drop boost threads for [alert|block|wallet]notifyCory 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-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
2018-02-08[RPC] Remove deprecated addmultisigaddress return formatJohn Newbery
2018-02-08Merge #12315: Bech32 addresses in dumpwalletWladimir J. van der Laan
45eea40 Bech32 addresses in dumpwallet (fivepiece) Pull request description: Output bech32 addresses in dumpwallet if address type is not as legacy Tree-SHA512: f6b6f788293779fe6339b94d9b792180e1d1dcb9c8e826caef8693557e1710213ba57891981c17505ace8d67b407eeca6fd9a8825757dd292cca2aa12575d15c
2018-02-07Merge #10498: Use static_cast instead of C-style casts for non-fundamental typesMarcoFalke
9ad6746ccd Use static_cast instead of C-style casts for non-fundamental types (practicalswift) Pull request description: A C-style cast is equivalent to try casting in the following order: 1. `const_cast(...)` 2. `static_cast(...)` 3. `const_cast(static_cast(...))` 4. `reinterpret_cast(...)` 5. `const_cast(reinterpret_cast(...))` By using `static_cast<T>(...)` explicitly we avoid the possibility of an unintentional and dangerous `reinterpret_cast`. Furthermore `static_cast<T>(...)` allows for easier grepping of casts. For a more thorough discussion, see ["ES.49: If you must use a cast, use a named cast"](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast) in the C++ Core Guidelines (Stroustrup & Sutter). Tree-SHA512: bd6349b7ea157da93a47b8cf238932af5dff84731374ccfd69b9f732fabdad1f9b1cdfca67497040f14eaa85346391404f4c0495e22c467f26ca883cd2de4d3c
2018-02-07Bech32 addresses in dumpwalletfivepiece
Output bech32 addresses in dumpwallet if address type is not as legacy
2018-02-06wallet: Disallow abandon of conflicted txesMarcoFalke
2018-02-05Merge #12330: Reduce scope of cs_main and cs_wallet locks in listtransactionsMarcoFalke
c409b1adac [rpc] Reduce scope of cs_main and cs_wallet locks in listtransactions (João Barbosa) Pull request description: Trivial change, no behaviour change. Benchmark done as follow: - run with `-regtest` - wallet with 5000 transactions - measured the time spent with the lock and the total time - times are an average of 100 `listtransactions --count=...` calls | `--count` | lock (ms) | total (ms) | saving | |--:|--:|--:|--:| | 10 | 0.2230 | 0.2510 | 11% | | 100 | 2.5150 | 2.8690 | 12% | | 1000 | 20.0320 | 23.3490 | 14% | | 10000 | 105.2070 | 125.5310 | 16% | Tree-SHA512: ebedfeeb4c8ad75c89128e53cae976a82967dbb5ffd129da0f7204ccf9c3c15070b3d509f3767bebd745512e410200cc546147c836e82409f95fc9b8d14fc3ed
2018-02-05[rpc] remove deprecated estimatefee RPCJohn Newbery
2018-02-04Merge #12331: Docs: Properly alphabetize output of CLI --help option.MarcoFalke
d3e467520f Properly alphabetize output of CLI --help option. (murrayn) Pull request description: The --help output of bitcoind, bitcoin-cli, bitcoin-tx, qt/bitcoin-qt, et al. is only about 90% alphabetized by option, which is kind of sloppy and occasionally misleading. This change (mostly) organizes the output alphabetically. Tree-SHA512: 3029900dbe99f03397c1cbdb5e4ac09a13bc99bafe73c6855097206e4cdd9ad70d0b5cedb5e1e520005c3e9ef1c4cd32bb9d8c98ce6918d8434fec8bf06e56c8
2018-02-02Merge #12283: Fix typosMarcoFalke
1340eda3b7 Fix typos (practicalswift) Pull request description: Fix typos. Tree-SHA512: 533a136831387ef26e9a74ba078437496bee38cc026da73fa9e6f6e7f4d5665eccac24cf3ef05e6d3af1329a1214f5ce71b039ddb8378b074e6d4408b8701f95
2018-02-01Properly alphabetize output of CLI --help option.murrayn
2018-02-02[rpc] Reduce scope of cs_main and cs_wallet locks in listtransactionsJoão Barbosa
2018-01-30Fix missing cs_main lock for GuessVerificationProgress()Jonas Schnelli
2018-01-30Merge #12276: Remove duplicate mapWallet lookupsWladimir J. van der Laan
039425c [wallet] Remove duplicate mapWallet lookups (João Barbosa) Pull request description: Tree-SHA512: 8075925d2adb64737c691e988d74a37bc326711aaee2c37327361679c051f219fa500e14cbcdb6a169352bcdbab160e11df4276b2657e19e12908ee2d4444d30
2018-01-29feebumper: Use PreconditionChecks to determine bump eligibilityMarcoFalke
2018-01-29[rpc] Mention that HD is enabled if hdmasterkeyid is presentfanquake
2018-01-28[wallet] Remove duplicate mapWallet lookupsJoão Barbosa
2018-01-28Fix typospracticalswift
2018-01-24Merge #12194: Add change type option to fundrawtransactionJonas Schnelli
16f6f59dc [qa] Test fundrawtransaction with change_type option (João Barbosa) 536ddeb17 [rpc] Add change_type option to fundrawtransaction (João Barbosa) 31dbd5af4 [wallet] Add change type to CCoinControl (João Barbosa) Pull request description: Adds a new option `change_type` to `fundrawtransaction` RPC. This is useful to override the node `-changetype` argument. The new option is exclusive to `changeAddress` option, setting both raises a RPC error. See also #11403, #12119. Tree-SHA512: 654686444f6125e37015a62f167064d54ec335701534988447be4687fa5ef9c7980a8a07cc0a03fff6ea6c4c1abf0f77a8843d535c4f3fe0bf93f968a4e676e6
2018-01-24Merge #12213: Add address type option to addmultisigaddressJonas Schnelli
f523c6bec [qa] Use address type in addmultisigaddress to avoid addwitnessaddress (João Barbosa) 886a92f25 [rpc] Add address type option to addmultisigaddress (João Barbosa) Pull request description: Adds the option `address_type` to `addmultisigaddress` and `createmultisg` RPC. This also allows to avoid `addwitnessaddress` to obtain an `p2sh-segwit` or `bech32` multsig address. Related to #12210 as this reduces `addwitnessaddress` usage. Tree-SHA512: 8f8f85dfcff66bb6c7e1e9865e37c285dead1d6dadb9672a89b92fa209d03cc35817ca1d656588c6c2146b728daaf7540b851929b640294653c62836cbefe7ee
2018-01-24initwallet: Do not translate highly technical addresstype helpMarcoFalke