aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
AgeCommit message (Collapse)Author
2017-03-03Save watch only key timestamps when reimporting keysRussell Yanofsky
Previously if an existing watch only key was reimported with a new timestamp, the new timestamp would not be saved in the key metadata, and would not be used to update the wallet nTimeFirstKey value (which could cause rescanning to start at the wrong point and miss transactions). Issue was pointed out by Jonas Schnelli <dev@jonasschnelli.ch> in https://github.com/bitcoin/bitcoin/pull/9108#issuecomment-279715550
2017-03-03Merge #9828: Avoid -Wshadow warnings in wallet_testsWladimir J. van der Laan
09fe346 Avoid -Wshadow warnings in wallet_tests (Russell Yanofsky) Tree-SHA512: 03a026787438efc9eba94299c2dd7de07a71ec7363b058b4f086d5ff0be844660fff2ef4f40e43d91313ea53de25f3de3c677b080b564d37f0693057498d3233
2017-03-03Merge #8808: Do not shadow variables (gcc set)Wladimir J. van der Laan
ad1ae7a Check and enable -Wshadow by default. (Pavel Janík) 9de90bb Do not shadow variables (gcc set) (Pavel Janík) Tree-SHA512: 9517feb423dc8ddd63896016b25324673bfbe0bffa97f22996f59d7a3fcbdc2ebf2e43ac02bc067546f54e293e9b2f2514be145f867321e9031f895c063d9fb8
2017-03-03Merge #8775: RPC refactoring: Access wallet using new GetWalletForJSONRPCRequestWladimir J. van der Laan
d678771 Wallet: Sanitise -wallet parameter (Luke Dashjr) 9756be3 Wallet/RPC: Use filename rather than CWallet pointer, for lockwallet RPCRunLater job name (Luke Dashjr) 86be48a More tightly couple EnsureWalletIsAvailable with GetWalletForJSONRPCRequest where appropriate (Luke Dashjr) a435632 Move wallet RPC declarations to rpcwallet.h (Luke Dashjr) ad15734 RPC: Pass on JSONRPCRequest metadata (URI/user/etc) for "help" method (Luke Dashjr) bf8a04a Reformat touched lines with C++11 (Luke Dashjr) 2e518e3 Move nWalletUnlockTime to CWallet::nRelockTime, and name timed task unique per CWallet (Luke Dashjr) d77ad6d RPC: Do all wallet access through new GetWalletForJSONRPCRequest (Luke Dashjr) eca550f RPC/Wallet: Pass CWallet as pointer to helper functions (Luke Dashjr) Tree-SHA512: bfd592da841693390e16f83b451503eb5cedb71208089aa32b3fc45e973555584a3ed7696dd239f6409324464d565dacf0f3d0e36e8e13ae6a7843848465f960
2017-03-02Merge #9359: Add test for CWalletTx::GetImmatureCredit() returning stale values.MarcoFalke
7ed143c Add test for CWalletTx::GetImmatureCredit() returning stale values. (Russell Yanofsky) Tree-SHA512: c95088ed6dfc5a0774ddaa2fe14ac0a9ebd830922a4d77100ec3d51fdeb6df40ad97de4f2ea970ed0f4122dcc0022ee1d43ab3c7188becd7f90c1c6af0ed39b7
2017-03-02Merge #9143: Refactor ZapWalletTxes to avoid layer violationsWladimir J. van der Laan
0165a56 Refactor ZapWalletTxes to avoid layer vialotions (Jonas Schnelli) Tree-SHA512: 51e3abbb866185817d14d685a65cb1070a7a60aa3db692670f3a5fdd328aad59afa765c5a6b13d9e8f6d219e735487f8c87998f2fb38fdd911c1fe19bea373b9
2017-03-01Add test for CWalletTx::GetImmatureCredit() returning stale values.Russell Yanofsky
Add test for cached immature credit flag not being cleared in CWalletTx::MarkDirty() bug, which was fixed in https://github.com/bitcoin/bitcoin/pull/8717, commit a560378.
2017-02-28Merge #9829: Fix importmulti returning rescan errors for wrong keysWladimir J. van der Laan
306bd72 Fix importmulti returning rescan errors for wrong keys (Russell Yanofsky) Tree-SHA512: ae9998236cbd3ff749d6b5c716bd76c9cec386b0708583e4912e4e05bf4584545258e1d0543aa5445024d2b5decf859a64f40c6503029773366a0f9a9ddf9b88
2017-02-28Merge #9865: Change bitcoin address in RPC help messageWladimir J. van der Laan
83ac719 Change bitcoin address in RPC helpaddress to an invalid address, so people don't accidentally send coins there (like I did). (Marijn Stollenga) Tree-SHA512: ca1163466a149d567b97efbfcfa8fdfe2d474245b4dd5a1a92555b4e87f8e99df5fee4cd79ef1ce6a98db2337846af78f37c2e6b31d02008b11fa0e151ce6590
2017-02-27Wallet: Sanitise -wallet parameterLuke Dashjr
2017-02-27Wallet/RPC: Use filename rather than CWallet pointer, for lockwallet ↵Luke Dashjr
RPCRunLater job name The job name is logged, and could pose as an information leak to someone attacking the process, helping them counteract ASLR protections
2017-02-27More tightly couple EnsureWalletIsAvailable with GetWalletForJSONRPCRequest ↵Luke Dashjr
where appropriate
2017-02-27Move wallet RPC declarations to rpcwallet.hLuke Dashjr
2017-02-27Reformat touched lines with C++11Luke Dashjr
2017-02-27Move nWalletUnlockTime to CWallet::nRelockTime, and name timed task unique ↵Luke Dashjr
per CWallet
2017-02-27RPC: Do all wallet access through new GetWalletForJSONRPCRequestLuke Dashjr
2017-02-27RPC/Wallet: Pass CWallet as pointer to helper functionsLuke Dashjr
2017-02-27Fix importmulti returning rescan errors for wrong keysRussell Yanofsky
Bug was a missing ++i line in a new range for loop added in commit e2e2f4c "Return errors from importmulti if complete rescans are not successful"
2017-02-27tests: Fix dangling pwalletMain pointer in wallet testsWladimir J. van der Laan
2017-02-26Change bitcoin address in RPC helpaddress to an invalid address, so people ↵Marijn Stollenga
don't accidentally send coins there (like I did).
2017-02-23Update sendfrom RPC help to correct coin selection misconceptionRussell Yanofsky
2017-02-22Avoid -Wshadow warnings in wallet_testsRussell Yanofsky
Warnings introduced by commit e2e2f4c "Return errors from importmulti if complete rescans are not successful" and reported by Pavel Janík <Pavel@Janik.cz> in https://github.com/bitcoin/bitcoin/pull/9773 and https://github.com/bitcoin/bitcoin/pull/9827 wallet/test/wallet_tests.cpp: In member function ‘void wallet_tests::rescan::test_method()’: wallet/test/wallet_tests.cpp:377:17: warning: declaration of ‘wallet’ shadows a global declaration [-Wshadow] CWallet wallet;
2017-02-22Merge #9773: Return errors from importmulti if complete rescans are not ↵Wladimir J. van der Laan
successful e2e2f4c Return errors from importmulti if complete rescans are not successful (Russell Yanofsky)
2017-02-21Merge #9727: Remove fallbacks for boost_filesystem < v3Wladimir J. van der Laan
056aba2 Remove fallbacks for boost_filesystem < v3 (Wladimir J. van der Laan)
2017-02-20Merge #9760: [wallet] Remove importmulti always-true checkWladimir J. van der Laan
ec1267f [wallet] Remove importmulti always-true check (Russell Yanofsky)
2017-02-18Merge #9696: [trivial] Fix recently introduced typos in commentsMarcoFalke
0c9b9b7 [trivial] Fix recently introduced typos in comments (practicalswift)
2017-02-17Return errors from importmulti if complete rescans are not successfulRussell Yanofsky
2017-02-17[wallet] Remove importmulti always-true checkRussell Yanofsky
Remove "nLowestTimestamp <= chainActive.Tip()->GetBlockTimeMax()" check from importmulti, which is always true because nLowestTimestamp is set to the minimum of the most recent block time and all the imported key timestamps, which is necessarily lower than the maximum block time.
2017-02-16Use 2 hour grace period for key timestamps in importmulti rescansRussell Yanofsky
Gregory Maxwell <greg@xiph.org> pointed out the lack of grace period in https://github.com/bitcoin/bitcoin/pull/9490#issue-199407998. The importwallet RPC which uses key timestamps in a similar way already has a 2 hour grace period.
2017-02-16Merge #9771: Add missing cs_wallet lock that triggers new lock held assertionWladimir J. van der Laan
07afcd6 Add missing cs_wallet lock that triggers new lock held assertion (Russell Yanofsky)
2017-02-16Merge #9764: wallet: Prevent "overrides a member function but is not marked ↵Wladimir J. van der Laan
'override'" warnings 6c5427d wallet: Prevent "overrides a member function but is not marked 'override'" warnings (Wladimir J. van der Laan)
2017-02-15Add missing cs_wallet lock that triggers new lock held assertionRussell Yanofsky
A new AssertLockHeld(cs_wallet) call was added in commit a58370e "Dedup nTimeFirstKey update logic" (part of PR #9108). The lock held assertion will fail when loading prexisting wallets files from before the #9108 merge that have watch-only keys.
2017-02-15Merge #9756: Return error when importmulti called with invalid address.Wladimir J. van der Laan
9acf25c Return error when importmulti called with invalid address. (Russell Yanofsky)
2017-02-15wallet: Prevent "overrides a member function but is not marked 'override'" ↵Wladimir J. van der Laan
warnings Because it is used inconsistently at least version 5.4.0 of g++ to complains about methods that don't use override. There is two ways to go about this: remove override from the methods having it, or add it to the methods missing it. I chose the second.
2017-02-14[trivial] Fix recently introduced typos in commentspracticalswift
2017-02-13Return error when importmulti called with invalid address.Russell Yanofsky
Lack of error checking noticed by Alex Morcos <morcos@chaincode.com>
2017-02-10Use importmulti timestamp when importing watch only keysRussell Yanofsky
When importing a watch-only address over importmulti with a specific timestamp, the wallet's nTimeFirstKey is currently set to 1. After this change, the provided timestamp will be used and stored as metadata associated with watch-only key. This can improve wallet performance because it can avoid the need to scan the entire blockchain for watch only addresses when timestamps are provided. Also adds timestamp to validateaddress return value (needed for tests). Fixes #9034.
2017-02-10Dedup nTimeFirstKey update logicRussell Yanofsky
Also make nTimeFirstKey member variable private. This is just a cleanup change, it doesn't change behavior in any significant way.
2017-02-10Use MTP for importmulti "now" timestampsRussell Yanofsky
2017-02-10Require timestamps for importmulti keysRussell Yanofsky
Additionally, accept a "now" timestamp, to allow avoiding rescans for keys which are known never to have been used. Note that the behavior when "now" is specified is slightly different than the previous behavior when no timestamp was specified at all. Previously, when no timestamp was specified, it would avoid rescanning during the importmulti call, but set the key's nCreateTime value to 1, which would not prevent future block reads in later ScanForWalletTransactions calls. With this change, passing a "now" timestamp will set the key's nCreateTime to the current block time instead of 1. Fixes #9491
2017-02-10Remove fallbacks for boost_filesystem < v3Wladimir J. van der Laan
Minimum boost version was bumped to 1.47.0 in #8920, which means the configure step won't even pass with older boost. This version has boost filesystem v3, which means the (crappy) fallbacks for older versions can go.
2017-02-06Merge #9227: Make nWalletDBUpdated atomic to avoid a potential race.Wladimir J. van der Laan
d63ff62 Make nWalletDBUpdated atomic to avoid a potential race. (Patrick Strateman)
2017-02-06Merge #9378: [trivial] Add documentation for CWalletTx::fFromMe member.Wladimir J. van der Laan
39c77b0 Add documentation for CWalletTx::fFromMe member. (Russell Yanofsky)
2017-02-02[wallet] Set correct metadata on bumpfee wallet transactionsRussell Yanofsky
Preserve comment, order form, and account strings from the original wallet transaction. Also set fTimeReceivedIsTxTime and fFromMe fields for consistency with CWallet::CreateTransaction. The latter two fields don't influence current wallet behavior, but do record that the transaction originated in the wallet instead of coming from the network or sendrawtransaction.
2017-02-02Merge #9663: [RPC] clarify listunspent amount descriptionWladimir J. van der Laan
3eba88d clarify listunspent amount description (Gregory Sanders)
2017-02-01clarify listunspent amount descriptionGregory Sanders
2017-01-31rpc: bumpfee: handle errors more gracefullySuhas Daftuar
2017-01-31rpc: bumpfee: use correct maximum signed tx size for fee calculationSuhas Daftuar
More accurate than simply adding one byte per input, and properly handles the case where the original transaction happened to have very small signatures
2017-01-30wallet: Refactor dummy signature signing for reusabilitySuhas Daftuar
2017-01-30Merge #9615: Wallet incremental feeWladimir J. van der Laan
4b189c1 Change bumpfee result value from 'oldfee' to 'origfee'. (Alex Morcos) 0c0c63f Introduce WALLET_INCREMENTAL_RELAY_FEE (Alex Morcos) e8021ec Use CWallet::GetMinimumFee in bumpfee (Alex Morcos) ae9719a Refactor GetMinimumFee to give option of providing targetFee (Alex Morcos) fe8e8ef [rpc] Add incremental relay fee to getnetworkinfo (Alex Morcos) 6b331e6 Fix to have miner test aware of new separate block min tx fee (Alex Morcos) de6400d Fix missing use of dustRelayFee (Alex Morcos) 5b15870 Use incrementalRelayFee for BIP 125 replacement (Alex Morcos)