aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
AgeCommit message (Collapse)Author
2018-04-27Merge #13090: Remove Safe mode (achow101)Wladimir J. van der Laan
d8e9a2a Remove "rpc" category from GetWarnings (Wladimir J. van der Laan) 7da3b0a rpc: Move RPC_FORBIDDEN_BY_SAFE_MODE code to reserved section (Wladimir J. van der Laan) 2ae705d Remove Safe mode (Andrew Chow) Pull request description: Rebase of #10563. Safe mode was [disabled by default and deprecated in 0.16](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.16.0.md#safe-mode-disabled-by-default), so probably should be removed for 0.17. > Rationale: > > Safe mode is useless. It only disables some RPC commands when large work forks are detected. Nothing else is affected by safe mode. It seems that very few people would be affected by safe mode. The people who use Core as a wallet are primarily using it through the GUI, which safe mode does not effect. In the GUI, transactions will still be made as normal; only a warning is displayed. > > I also don't think that we should be disabling RPC commands or any functionality in general. If we do, it should be done consistently, which safe mode is not. If we want to keep the idea of a safe mode around, I think that the current system needs to go first before a new system can be implemented. Tree-SHA512: 067938f47ca6e879fb6c3c4e21f9946fd7c5da3cde67ef436f1666798c78d049225b9111dc97064f42b3bc549d3915229fa19ad5a634588f381e34fc65d64044
2018-04-26Merge #13002: Do not treat bare multisig outputs as IsMine unless watchedWladimir J. van der Laan
7d0f80b Use anonymous namespace instead of static functions (Pieter Wuille) b61fb71 Mention removal of bare multisig IsMine in release notes (Pieter Wuille) 9c2a8b8 Do not treat bare multisig as IsMine (Pieter Wuille) 08f3228 Optimization: only test for witness scripts at top level (Pieter Wuille) 3619735 Track difference between scriptPubKey and P2SH execution in IsMine (Pieter Wuille) ac6ec62 Switch to a private version of SigVersion inside IsMine (Pieter Wuille) 19fc973 Do not expose SigVersion argument to IsMine (Pieter Wuille) fb1dfbb Remove unused IsMine overload (Pieter Wuille) 952d821 Make CScript -> CScriptID conversion explicit (Pieter Wuille) Pull request description: Currently our wallet code will treat bare multisig outputs (meaning scriptPubKeys with multiple public keys + `OP_CHECKMULTISIG` operator in it) as ours without the user asking for it, as long as all private keys in it are in our wallet. This is a pointless feature. As it only works when all private keys are in one place, it's useless compared to single key outputs (P2PK, P2PKH, P2WPKH, P2SH-P2WPKH), and worse in terms of space, cost, UTXO size, and ability to test (due to lack of address format for them). Furthermore, they are problematic in that producing a list of all `scriptPubKeys` we accept is not tractable (it involves all combinations of all public keys that are ours). In further wallet changes I'd like to move to a model where all scriptPubKeys that are treated as ours are explicit, rather than defined by whatever keys we have. The current behavior of the wallet is very hard to model in such a design, so I'd like to get rid of it. I think there are two options: * Remove it entirely (do not ever accept bare multisig outputs as ours, unless watched) * Only accept bare multisig outputs in situations where the P2SH version of that output would also be acceptable This PR implements the first option. The second option was explored in #12874. Tree-SHA512: 917ed45b3cac864cee53e27f9a3e900390c576277fbd6751b1250becea04d692b3b426fa09065a3399931013bd579c4f3dbeeb29d51d19ed0c64da75d430ad9a
2018-04-26Remove Safe modeAndrew Chow
2018-04-24Merge #12909: wallet: Make fee settings to be non-static membersWladimir J. van der Laan
fac0db0 wallet: Make fee settings non-static members (MarcoFalke) Pull request description: The wallet header defined some globals (they were called "settings"), that should be class members instead. This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc `settxfee` for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case) Tree-SHA512: 4ab6ec2f5c714742396ded5e451ec3b1ceb771e3696492de29889d866de4365b3fbe4a2784d085c8b8bd11b1ebb8a1fec99ab2c62eee716791cfc67c0cf29e1b
2018-04-24Merge #12953: Deprecate accountsWladimir J. van der Laan
cead28b [docs] Add release notes for deprecated 'account' API (John Newbery) 72c9575 [wallet] [tests] Add tests for accounts/labels APIs (John Newbery) 109e05d [wallet] [rpc] Deprecate wallet 'account' API (John Newbery) 3576ab1 [wallet] [rpc] Deprecate account RPC methods (John Newbery) 3db1ba0 [tests] Set -deprecatedrpc=accounts in tests (John Newbery) 4e671f0 [tests] Rename rpc_listtransactions.py to wallet_listtransactions.py (John Newbery) a28b907 [wallet] [rpc] Remove duplicate entries in rpcwallet.cpp's CRPCCommand table (John Newbery) Pull request description: Deprecate all accounts functionality and make it only accessible by using `-deprecatedrpc=accounts`. Accounts specific RPCs, account arguments, and account related results all require the `-deprecatedrpc=accunts` startup option now in order to see account things. Several wallet functional tests use the accounts system. Those tests are unchanged, except to start the nodes with `-deprecatedrpc=accounts`. We can slowly migrate those tests to use the 'label' API instead of the 'account' API before accounts are fully removed. Tree-SHA512: 89f4ae2fe6de4a1422f1817b0997ae22d63ab5a1a558362ce923a3871f3e42963405d6573c69c27f1764679cdee5b51bf52202cc407f1361bfd8066d652f3f37
2018-04-23Merge #13030: [bugfix] [wallet] Fix zapwallettxes/multiwallet interaction.Wladimir J. van der Laan
1f83839 [wallet] [tests] Test disallowed multiwallet params (John Newbery) 3476e3c [wallet] Fix zapwallettxes/multiwallet interaction. (John Newbery) Pull request description: `-zapwallettxes` should be disallowed when starting bitcoin in multiwallet mode. There's code in `WalletInit::ParameterInteraction()` to disallow `-zapwallettxes` when running in multiwallet mode. This code functioned as expected when passing the parameter `-zapwallettxes=1`, but not when passing the parameter `-zapwallettxes` (ie without the value specified). Fix that and add a test. The new test in the _[wallet] [tests] Test disallowed multiwallet params_ commit reproduces the bug and should fail against master. Fixes #12505 Tree-SHA512: 6cd921717e9c7d2773ca84c946c310c2adec8430e37cbecdb33a620f510db3058a72bd328411812ba415111bc52a3367b332c9d15a37a92ccfd7ae785d2f32ab
2018-04-23wallet: Make fee settings non-static membersMarcoFalke
2018-04-19[wallet] Fix zapwallettxes/multiwallet interaction.John Newbery
-zapwallettxes should be disallowed when starting bitcoin in multiwallet mode.
2018-04-18Make CScript -> CScriptID conversion explicitPieter Wuille
2018-04-18wallet: Add HasWalletsJoão Barbosa
2018-04-18wallet: Add AddWallet, RemoveWallet, GetWallet and GetWalletsJoão Barbosa
With these new functions all vpwallets usage are removed and vpwallets is now a static variable (no external linkage).
2018-04-18refactor: Drop CWalletRef typedefJoão Barbosa
2018-04-18Merge #13007: test: Fix dangling wallet pointer in vpwalletsWladimir J. van der Laan
d41a420 test: Fix dangling wallet pointer in vpwallets (João Barbosa) Pull request description: Tree-SHA512: 83e4ec571f1675b3dab6f7606f29d6fae495d998b4e5794ff14315943783d4518cfa66eba4113293e349eb74aa22a024b21272fdb29c212477edb4c09aec9fa7
2018-04-17test: Fix dangling wallet pointer in vpwalletsJoão Barbosa
2018-04-17Merge #12949: tests: Avoid copies of CTransactionMarcoFalke
fae58eca93 tests: Avoid copies of CTransaction (MarcoFalke) Pull request description: Avoid the copy (or move) constructor of `CTransaction` in test code, whereever a simple reference can be used instead. Tree-SHA512: 8ef2077a277d6182996f4671722fdc01a90909ae7431c1e52604aab8ed028910615028caf9b4cb07a9b15fdc04939dea2209cc3189dde7d38271256d9fe1076c
2018-04-17[wallet] [rpc] Deprecate wallet 'account' APIJohn Newbery
This commit finalizes the deprecation of the wallet 'accounts' API by removing all account arguments and return values. RPC behaviour is slightly different if the 'accounts' or 'labels' API is being used. Those behaviour changes are fully documented in the RPC help text.
2018-04-17[wallet] [rpc] Deprecate account RPC methodsJohn Newbery
All account RPC methods are now deprecated and can only be called if bitcoind has been started with the -deprecatedrpc=accounts switch. Affected RPC methods are: - getaccount - getaccountaddress - getaddressesbyaccount - getreceivedbyaccount - listaccouts - listreceivedbyaccount - move - setaccount
2018-04-17Merge #12977: Refactor g_wallet_init_interface to const referenceWladimir J. van der Laan
6ec78f1 wallet: Refactor g_wallet_init_interface to const reference (João Barbosa) 1936125 wallet: Make WalletInitInterface members const (João Barbosa) Pull request description: Tree-SHA512: c382156a38d4c6beaa6c48f911d7b314542b9500d88724b2b3029dae4491cb1e60e10628f6632d1366818ccf343f494650b3171593b5450149544ba198f49bb5
2018-04-16[wallet] [rpc] Remove duplicate entries in rpcwallet.cpp's CRPCCommand tableJohn Newbery
Remove duplicate listreceivedby{account,label} methods.
2018-04-13Merge #11200: Allow for aborting rescans in the GUIJonas Schnelli
ae1d2b030 Give an error when rescan is aborted by the user (Andrew Chow) 69b01e6f8 Add cancel button to rescan progress dialog (Andrew Chow) Pull request description: A cancel button is added to the `showProgress` dialog that is used only for rescans. When clicked, `AbortRescan` is called directly to cancel the rescan. Rescans triggered from the debug console will now be cancelable by clicking the cancel button. Rescans triggered by a command (e.g. `importmulti`) will now give an error indicating that the rescan was aborted by the user (either by the `abortrescan` command or by clicking cancel). Tree-SHA512: 4bb14998766de686e2318fbc9805758eccf5dbe628a7257d072c9ae2fb4f61303a0876f49988d6e5eddb261969b8a307c81c0c2df0a42ae909a43d738af3dc1b
2018-04-13wallet: Refactor g_wallet_init_interface to const referenceJoão Barbosa
2018-04-13wallet: Make WalletInitInterface members constJoão Barbosa
2018-04-12Give an error when rescan is aborted by the userAndrew Chow
2018-04-12Add cancel button to rescan progress dialogAndrew Chow
Adds a cancel button to the rescan progress dialog. When it is clicked, AbortRescan is called to abort a rescan
2018-04-12Merge #12803: Make BaseSignatureCreator a pure interfaceWladimir J. van der Laan
be67831 Make DummySignatureCreator a singleton (Pieter Wuille) 190b8d2 Make BaseSignatureCreator a pure interface (Pieter Wuille) Pull request description: * Removes the `m_provider` field from `BaseSignatureCreator`. Instead both a `SigningProvider` (which provides keys and scripts) and a `BaseSignatureCreator` (which implements the transaction-specific (or other) signing logic) are passed into and down in `ProduceSignature`, making the two concepts orthogonal. * Makes `BaseSignatureCreator` a pure interface without constructor, making it easier to implement new derivations of it (for example for message signing). * As `DummySignatureCreator` now becomes a stateless object, turn it into a singleton `DUMMY_SIGNATURE_CREATOR`. Tree-SHA512: 5f1f4512e4ea7d02a31df7b9ede55008efa716c5b74a2630ca1c2fc6599584d8bf5f5641487266127f4b3788033803539fbd22b03ef1219c83c10da2d3da3dcd
2018-04-12Merge #12888: debug log number of unknown wallet records on loadWladimir J. van der Laan
72ec5b7 debug log number of unknown wallet records on load (Gregory Sanders) Pull request description: This would have saved me some time during wallet debugging, with minimal logging clutter. Tree-SHA512: e11a4d73a5b1d2bd73fe7b75b62fdfa127e21b8641c5b0c76f14ecd292ab374c0d4749f6bd99919b2b3e9cb00c3b5e8179386eb39ac656698306b3b545ee79f1
2018-04-11Merge #12837: rpc: fix type mistmatch in `listreceivedbyaddress`MarcoFalke
05c03d1249 rpc: fix type mistmatch in listreceivedbyaddress (joemphilips) Pull request description: `txids` filed in return value is supposed be `string` but it was `numeric` in the help message Tree-SHA512: 7d860994c2d1d9149b41fd7afefc1a44460eede5a023070fcc18b0a4a19a26c5eec5abd157038c15fe7d50a3390bdaf7a4823279129eb1458b0d3c6141a533ee
2018-04-11tests: Avoid copies of CTransactionMarcoFalke
2018-04-11debug log number of unknown wallet records on loadGregory Sanders
2018-04-11Merge #12925: wallet: Logprint the start of a rescanWladimir J. van der Laan
cab0824 Logprint the start of a rescan (Jonas Schnelli) Pull request description: Right now, there is no log entry when a rescan starts which is confusing especially when a "still rescanning" log entry appears after the log-update timeout of 60s or when user manually aborts the rescan. This PR adds a log entry when a rescan starts. Tree-SHA512: 8712605af6fd60950bf3904cfb586da6022e44b3da6f3155fe4f02aae16df6044bc504b3d48945ea6d7fe768f0c6cb3282a2e2251d14bf3b7f1dcbd12568b05e
2018-04-11Merge #12920: test: Fix sign for expected valuesWladimir J. van der Laan
c55aa4f test: Fix sign for expected values (Karl-Johan Alm) Pull request description: A number of `BOOST_CHECK_EQUAL` calls would result in warnings about signs. This PR fixes signedness for all expectation values, sometimes resulting in `int` → `unsigned int`. No other code changes besides adding/removing `U` to/from values. Running `make &> make_output_...` on master versus on this PR: ``` $ wc make_output_* 1464 5925 90357 make_output_master 613 1469 28370 make_output_signfixed ``` More than halves the output lines from compiling. Tree-SHA512: b06c9fb81704fd32a6a61fe7b2ceb5f1bb381e9873d79e13d7e4d26bbd9b67c9725a84e6fb2903bcda775aea2a792e544b0799d36735c19f5d1c7225e8c6d14e
2018-04-11Merge #12892: [wallet] [rpc] introduce 'label' API for walletWladimir J. van der Laan
41ba061 [docs] Add release notes for wallet 'label' API. (John Newbery) 189e0ef [wallet] [rpc] introduce 'label' API for wallet (Wladimir J. van der Laan) Pull request description: Add label API to wallet RPC. This is one step towards #3816 ("Remove bolt-on account system") although it doesn't actually remove anything yet. These initially mirror the account functions, with the following differences: - These functions aren't DEPRECATED in the help - Help mentions 'label' instead of accounts. In the language used, labels are associated with addresses, instead of addresses associated with labels. (unlike with accounts.) - Labels have no balance - No balances in `listlabels` - `listlabels` has no minconf or watchonly argument - Like in the GUI, labels can be set on any address, not just receiving addreses - Unlike accounts, labels can be deleted. Being unable to delete them is a common annoyance (see #1231). Currently only by reassigning all addresses using `setlabel`, but an explicit call `deletelabel` which assigns all address to the default label may make sense. Tree-SHA512: 45cc313c68ad529ce3a15c02181d2ab0083a7e14fe824e2cde34972713fecce512e3d4b9aa46db5355f2baa857c44b234d4fe9709225bc23c7ebbc0e03febbf5
2018-04-11test: Fix sign for expected valuesKarl-Johan Alm
A number of BOOST_CHECK_EQUAL calls would result in warnings about signs.
2018-04-10[wallet] [rpc] introduce 'label' API for walletWladimir J. van der Laan
Add label API to wallet RPC. This is one step towards #3816 ("Remove bolt-on account system") although it doesn't actually remove anything yet. These initially mirror the account functions, with the following differences: - These functions aren't DEPRECATED in the help - Help mentions 'label' instead of accounts. In the language used, labels are associated with addresses, instead of addresses associated with labels. (unlike with accounts.) - Labels have no balance - No balances in `listlabels` - `listlabels` has no minconf or watchonly argument - Like in the GUI, labels can be set on any address, not just receiving addreses - Unlike accounts, labels can be deleted. Being unable to delete them is a common annoyance (see #1231). Currently only by reassigning all addresses using `setlabel`, but an explicit call `deletelabel` which assigns all address to the default label may make sense. Thanks to Pierre Rochard for test fixes.
2018-04-10Merge #12731: Support serialization as another type without castingWladimir J. van der Laan
818dc74 Support serialization as another type without casting (Pieter Wuille) Pull request description: This adds a `READWRITEAS(type, obj)` macro which serializes `obj` as if it were converted to `const type&` when `const`, and to `type&` when non-`const`. No actual cast is involved, so this only works when this conversion can be done automatically. This makes it usable in serialization code that uses a single implementation for both serialization and deserializing, which doesn't know the constness of the object involved. This is a redo of #12712, using a slightly different interface. Tree-SHA512: 262f0257284ff99b5ffaec9b997c194e221522ba35c3ac8eaa9bb344449d7ea0a314de254dc77449fa7aaa600f8cd9a24da65aade8c1ec6aa80c6e9a7bba5ca7
2018-04-10Merge #12749: [wallet] feebumper: discard change outputs below discard rateWladimir J. van der Laan
f526046 adapt bumpfee change discard test to be more strict and add note on p2sh discrep (Gregory Sanders) 5805d6f feebumper: discard change outputs below discard rate (Gregory Sanders) Pull request description: The "discard rate" is the concept we use to ensure the wallet isnt creating not so useful just-above-relay dust. Outside of bumpfee previous to this PR, and manually creating such an output, the wallet will never make change outputs of that size, preferring to send them to fees instead. "Worst case" for the user is that users pay a slightly higher feerate than they were expecting, which is already a possibility with relay dust. Tree-SHA512: dd69351810dc1709437602e7db1be46e4e905ccd8e16d03952de8b4c1fdbf9cb7e6c99968930896baf6b5c7cb005a03ec0506a2669d22e21e32982e60329606b
2018-04-10Make DummySignatureCreator a singletonPieter Wuille
2018-04-10Make BaseSignatureCreator a pure interfacePieter Wuille
2018-04-09Merge #11851: scripted-diff: Rename wallet database classesWladimir J. van der Laan
9b0f0c5 Add m_ prefix to WalletBatch::m_batch (Russell Yanofsky) 398c6f0 Update walletdb comment after renaming. (Russell Yanofsky) ea23945 scripted-diff: Rename wallet database classes (Russell Yanofsky) Pull request description: Scripted diff to rename some wallet classes. Motivated by discussion in https://github.com/bitcoin/bitcoin/pull/11687#discussion_r155354119 | Current | New | | ---------------- | ------------------- | | CDBEnv | BerkeleyEnvironment | | CDB | BerkeleyBatch | | CWalletDBWrapper | WalletDatabase | | CWalletDB | WalletBatch | Berkeley\* classes are intended to contain BDB specific code, while Wallet\* classes are intended to be more backend-agnostic. Also renamed associated variables: | Current | New | | ------------------- | --------------- | | dbw | database | | pwalletdb | batch | | pwalletdbEncryption | encrypted_batch | Tree-SHA512: 372f2e24b2deb59d4792b5ed578aaf0cce51b6db41c400bef5d0c2cd7833e62ae4d4afa0f6000268d52e15b20f737c5a55f1cecf7768556a782fd8cd6fe051d9
2018-04-09Logprint the start of a rescanJonas Schnelli
2018-04-09Remove duplicate includespracticalswift
2018-04-08Merge #12905: [rpcwallet] Clamp walletpassphrase value at 100M secondsMarcoFalke
2b2b96cd45 Use std::bind instead of boost::bind to re-lock the wallet (Suhas Daftuar) 662d19ff72 [rpcwallet] Clamp walletpassphrase value at 100M seconds (Suhas Daftuar) Pull request description: Larger values seem to trigger a bug on macos+libevent (resulting in the rpc server stopping). Tree-SHA512: 890f3b641f6c586e2f8f629a9d23bca6ceb8b237b285561aad488cb7adf941a21177d3129d0c2b8293c0a673cd8e401957dbe2b6b3b7c8c4e991bb411d260102
2018-04-08Use std::bind instead of boost::bind to re-lock the walletSuhas Daftuar
Change suggested by Marco Falke.
2018-04-08[rpcwallet] Clamp walletpassphrase value at 100M secondsSuhas Daftuar
Larger values seem to trigger a bug on macos+libevent (resulting in the rpc server stopping).
2018-04-08Merge #12891: [logging] add lint-logs.sh to check for newline termination.Wladimir J. van der Laan
d207207 [logging] add lint-logs.sh to check for newline termination. (John Newbery) 5c21e6c [logging] Comment all continuing logs. (John Newbery) Pull request description: Check that all calls to LogPrintf() are terminated by a newline, except those that are explicitly marked as 'continued' logs. Tree-SHA512: fe5162b2b2df1e8a4c807da87584fa9af97a6b8377e4090fe0caa136d90bf29a487a123cde94569bdce7101fee3478196d99aa13f1212e24bfe5f41c773604fc
2018-04-08Merge #12895: tests: Add note about test suite name uniqueness requirement ↵Wladimir J. van der Laan
to developer notes d1b622b tests: Add check for test suite name uniqueness in lint-tests.sh (practicalswift) dc8067b tests: Add note about uniqueness requirement for test suite names (practicalswift) 3ebfb2d tests: Avoid test suite name collision in wallet crypto_tests (MarcoFalke) Pull request description: * Add documentation: Add note about test suite name uniqueness requirement in developer notes * Add regression test: Update `lint-tests.sh` to make it check also for test suite name uniqueness Context: #12894 (`tests: Avoid test suite name collision in wallet crypto_tests`) Tree-SHA512: 3c8502db069ef3d753f534976a86a997b12bac539e808a7285193bf81c9dd8c1b06821c3dd1bdf870ab87722b02c8aa9574c62ace70c2a1b8091785cb8c9aace
2018-04-07Add m_ prefix to WalletBatch::m_batchRussell Yanofsky
2018-04-07Update walletdb comment after renaming.Russell Yanofsky
Text from https://github.com/bitcoin/bitcoin/pull/11851#issuecomment-350320608 by John Newbery <john@johnnewbery.com>.
2018-04-07scripted-diff: Rename wallet database classesRussell Yanofsky
-BEGIN VERIFY SCRIPT- sed -i 's/\<CWalletDBWrapper\>/BerkeleyDatabase/g' src/wallet/db.h src/wallet/db.cpp sed -i '/statuses/i/** Backend-agnostic database type. */\nusing WalletDatabase = BerkeleyDatabase\;\n' src/wallet/walletdb.h ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' ':(exclude)*dbwrapper*' test | xargs sed -i "s:\<$1\>:$2:g"; } ren CDBEnv BerkeleyEnvironment ren CDB BerkeleyBatch ren CWalletDBWrapper WalletDatabase ren CWalletDB WalletBatch ren dbw database ren m_dbw m_database ren walletdb batch ren pwalletdb batch ren pwalletdbIn batch_in ren wallet/batch.h wallet/walletdb.h ren pwalletdbEncryption encrypted_batch -END VERIFY SCRIPT-
2018-04-07[logging] Comment all continuing logs.John Newbery
Most logs should terminated with a '\n'. Some logs are built up over multiple calls to logPrintf(), so do not need a newline terminater. Comment all of these 'continued' logs as a linter hing.