aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move network-time related functions to timedata.cpp/hWladimir J. van der Laan2014-06-251-0/+1
| | | | | The network time-offset-mangement functions from util.cpp are moved to timedata.(cpp|h). This breaks the dependency of util on netbase.
* Merge pull request #3674Wladimir J. van der Laan2014-06-241-2/+2
|\ | | | | | | 77cbd46 Let -zapwallettxes recover transaction meta data (Cozz Lovan)
| * Let -zapwallettxes recover transaction meta dataCozz Lovan2014-06-161-2/+2
| |
* | Code simplifications after CTransaction::GetHash() cachingPieter Wuille2014-06-221-8/+7
| |
* | Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-7/+11
| | | | | | | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* | AvailableCoins: acquire cs_main mutexPavel Vasin2014-06-201-1/+1
|/ | | | It's required when called from WalletModel
* Ignore too-long redeemScripts while loading walletWladimir J. van der Laan2014-06-121-0/+16
| | | | | | | This avoids that long redeemScripts that were grandfathered in prevent the wallet from loading. Fixes #4313.
* Type-safe CFeeRate classGavin Andresen2014-06-061-16/+6
| | | | | | | | Use CFeeRate instead of an int64_t for quantities that are fee-per-size. Helps prevent unit-conversion mismatches between the wallet, relaying, and mining code.
* remove CWallet::AddReserveKey which is never usedKamil Domanski2014-05-201-15/+0
|
* Merge pull request #4138Wladimir J. van der Laan2014-05-121-1/+1
|\ | | | | | | 783b182 Remove dummy PRIszX macros for formatting (Wladimir J. van der Laan)
| * Remove dummy PRIszX macros for formattingWladimir J. van der Laan2014-05-061-1/+1
| | | | | | | | | | | | | | | | | | Size specifiers are no longer needed now that we use typesafe tinyformat for string formatting, instead of the system's sprintf. No functional changes. This continues the work in #3735.
* | add DEFAULT_TRANSACTION_FEE constant in walletPhilip Kaufmann2014-05-051-2/+2
|/ | | | | - as this is a shared Core/GUI setting, this makes it easier to keep them in sync (also no new includes are needed)
* Merge pull request #4058Wladimir J. van der Laan2014-04-221-6/+6
|\ | | | | | | | | 55a1db4 Solve chainActive-related locking issues (Wladimir J. van der Laan) e07c943 Add AssertLockHeld for cs_main to ChainActive-using functions (Wladimir J. van der Laan)
| * Solve chainActive-related locking issuesWladimir J. van der Laan2014-04-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | - In wallet and GUI code LOCK cs_main as well as cs_wallet when necessary - In main.cpp SendMessages move the TRY_LOCK(cs_main) up, to encompass the call to IsInitialBlockDownload. - Make ActivateBestChain, AddToBlockIndex, IsInitialBlockDownload, InitBlockIndex acquire the cs_main lock Fixes #3997
* | Merge pull request #3701Wladimir J. van der Laan2014-04-191-0/+1
|\ \ | |/ |/| | | 09ec3af AddToWallet implies BindWallet (Wladimir J. van der Laan)
| * AddToWallet implies BindWalletWladimir J. van der Laan2014-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | Now that AddToWallet is called when loading transactions from the wallet database, BindWallet can be integrated into that and does not need to be an extra step. Leaves behaviour unchanged, but makes the fFromLoadWallet/!fFromLoadWallet paths in AddToWallet a bit more symmetric.
* | [Qt] rescan progressCozz Lovan2014-04-021-6/+14
| |
* | Fix missing wallet lock in CWallet::SyncTransaction(..)Cozz Lovan2014-03-111-4/+3
| |
* | Merge pull request #3696Wladimir J. van der Laan2014-03-111-0/+6
|\ \ | |/ |/| | | | | c4656e0 Add progress to initial display of latest block downloaded. (R E Broadley) 75b8953 Display progress of rescan. (R E Broadley)
| * Display progress of rescan.R E Broadley2014-02-191-0/+6
| |
* | Merge pull request #3694 from gavinandresen/vfspentGavin Andresen2014-02-281-187/+83
|\ \ | | | | | | Remove CWalletTx::vfSpent
| * | Remove CWalletTx::vfSpentGavin Andresen2014-02-261-187/+83
| | | | | | | | | | | | | | | | | | Use the spent outpoint multimap to figure out which wallet transaction outputs are unspent, instead of a vfSpent array that is saved to disk.
* | | Merge pull request #3735 from laanwj/2014_02_remove_PRIx64_completelyGavin Andresen2014-02-261-5/+5
|\ \ \ | |/ / |/| | Remove PRIx64 usage completely
| * | Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan2014-02-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h indirectly, so we cannot fix this with just macros. Trivial commit: apply the following script to all .cpp and .h files: # Middle sed -i 's/"PRIx64"/x/g' "$1" sed -i 's/"PRIu64"/u/g' "$1" sed -i 's/"PRId64"/d/g' "$1" # Initial sed -i 's/PRIx64"/"x/g' "$1" sed -i 's/PRIu64"/"u/g' "$1" sed -i 's/PRId64"/"d/g' "$1" # Trailing sed -i 's/"PRIx64/x"/g' "$1" sed -i 's/"PRIu64/u"/g' "$1" sed -i 's/"PRId64/d"/g' "$1" After this commit, `git grep` for PRI.64 should turn up nothing except the defines in util.h.
* | | Merge pull request #3704 from gavinandresen/wallet_lock_fixesGavin Andresen2014-02-241-18/+23
|\ \ \ | |/ / |/| | Wallet locking fixes for -DDEBUG_LOCKORDER
| * | Wallet locking fixes for -DDEBUG_LOCKORDERGavin Andresen2014-02-181-18/+23
| |/ | | | | | | | | | | | | | | | | | | | | Compiling with -DDEBUG_LOCKORDER and running the qa/rpc-test/ regression tests uncovered a couple of wallet methods that should (but didn't) acquire the cs_wallet mutext. I also changed the AssertLockHeld() routine print to stderr and abort, instead of printing to debug.log and then assert()'ing. It is annoying to look in debug.log to find out which AssertLockHeld is failing.
* / Don't use PRIx64 formatting derives from inttypes.hWladimir J. van der Laan2014-02-221-2/+0
|/ | | | | | | | | | | | As the tinyformat-based formatting system (introduced in b77dfdc) is type-safe, no special format characters are needed to specify sizes. Tinyformat can support (ignore) the C99 prefixes such as "ll" but chokes on MSVC's inttypes.h defines prefixes such as "I64X". So don't include inttypes.h and define our own for compatibility. (an alternative would be to sweep the entire codebase using sed -i to get rid of the size specifiers but this has less diff impact)
* Merge pull request #3646Wladimir J. van der Laan2014-02-161-1/+1
|\ | | | | | | 5770254 Copyright header updates s/2013/2014 on files whose last git commit was done in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does. (gubatron)
| * Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron2014-02-091-1/+1
| | | | | | | | | | | | in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
* | Merge pull request #3671 from gavinandresen/txn_conflictsGavin Andresen2014-02-151-2/+98
|\ \ | | | | | | Report transaction conflicts, and tentative account balance fix
| * | Track and report wallet transaction clonesGavin Andresen2014-02-141-2/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a "walletconflicts" array to transaction info; if a wallet transaction is mutated, the alternate transaction id or ids are reported there (usually the array will be empty). Metadata from the original transaction is copied to the mutant, so the transaction time and "from" account of the mutant are reported correctly.
* | | Merge pull request #3669 from gavinandresen/dead_txnsGavin Andresen2014-02-141-1/+5
|\| | | | | | | | Handle "conflicted" transactions properly
| * | Handle "conflicted" transactions properlyGavin Andresen2014-02-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend CMerkleTx::GetDepthInMainChain with the concept of a "conflicted" transaction-- a transaction generated by the wallet that is not in the main chain or in the mempool, and, therefore, will likely never be confirmed. GetDepthInMainChain() now returns -1 for conflicted transactions (0 for unconfirmed-but-in-the-mempool, and >1 for confirmed). This makes getbalance, getbalance '*', and listunspent all agree when there are mutated transactions in the wallet. Before: listunspent: one 49BTC output getbalance: 96 BTC (change counted twice) getbalance '*': 46 BTC (spends counted twice) After: all agree, 49 BTC available to spend.
* | | Add -zapwallettxes cli/config option, used for wallet recoveryJeff Garzik2014-02-141-0/+24
|/ / | | | | | | | | This diagnostic tool removes all "tx" records from the wallet db, then forces a full rescan, to rebuild "tx" records accurately.
* | Rename IsConfirmed to IsTrusted to better match the intended behavior.Gregory Maxwell2014-02-121-4/+4
| | | | | | | | This doesn't change the functionality at all.
* | Add option to avoid spending unconfirmed changeWladimir J. van der Laan2014-02-111-1/+2
| |
* | remove setting methods in wallet/walletdbCozz Lovan2014-02-071-19/+0
|/
* Remove redundant .c_str()sWladimir J. van der Laan2014-01-231-14/+14
| | | | | | | After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
* [Qt] Permanently store requested payments in walletCozz Lovan2014-01-191-0/+3
|
* wallet: add interface for storing generic data on destinationsWladimir J. van der Laan2014-01-191-0/+51
|
* Merge pull request #3401Wladimir J. van der Laan2014-01-061-0/+18
|\ | | | | | | | | | | 012ca1c LoadWallet: acquire cs_wallet mutex before clearing setKeyPool (Wladimir J. van der Laan) 9569168 Document cs_wallet lock and add AssertLockHeld (Wladimir J. van der Laan) 19a5676 Use mutex pointer instead of name for AssertLockHeld (Wladimir J. van der Laan)
| * LoadWallet: acquire cs_wallet mutex before clearing setKeyPoolWladimir J. van der Laan2013-12-191-1/+1
| | | | | | | | | | Make the function mutex-aware, to prevent having to lock cs_wallet at the call site in Init.
| * Document cs_wallet lock and add AssertLockHeldWladimir J. van der Laan2013-12-191-0/+18
| | | | | | | | | | Add locking assertions to wallet to all methods that access internal fields and do not aquire the cs_wallet mutex.
* | Merge pull request #3412Wladimir J. van der Laan2013-12-191-0/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | c3a7f51 Move `verifymessage` from rpcwallet to rpcmisc (Wladimir J. van der Laan) 723a03d Move `createmultisig` from rpcwallet to rpcmisc (Wladimir J. van der Laan) 452955f Move `validateaddress` from rpcwallet to rpcmisc (Wladimir J. van der Laan) cd7fa8b Move `nTransactionFee` from main.cpp to wallet.cpp (Wladimir J. van der Laan) a943bde Move `settxfee` from rpcblockchain to rpcwallet (Wladimir J. van der Laan) 16bc9aa Move `getinfo` from rpcnet to rpcmisc (Wladimir J. van der Laan) 652e156 add new RPC implementation file `rpcmisc.cpp` (Wladimir J. van der Laan)
| * Move `nTransactionFee` from main.cpp to wallet.cppWladimir J. van der Laan2013-12-131-0/+2
| | | | | | | | | | Transaction fee is only used by the wallet. No need for it to be in main.cpp.
* | Remove unused ThreadSafeAskFee from ui_interfaceWladimir J. van der Laan2013-12-141-6/+3
|/ | | | | | ThreadSafeAskFee is effectively unused. It is only called when the fAskFee parameter on SendMoney or SendMoneyToDestination is true, which never happens. Remove it.
* Merge pull request #3356Wladimir J. van der Laan2013-12-051-0/+4
|\ | | | | | | d3ef9b0 Prevent empty transactions from being added to vtxPrev (Wladimir J. van der Laan)
| * Prevent empty transactions from being added to vtxPrevWladimir J. van der Laan2013-12-041-0/+4
| | | | | | | | | | | | | | | | CWalletTx::AddSupportingTransactions() was adding empty transaction to vtxPrev in some cases. Skip over these. Part one of the solution to #3190. This prevents invalid vtxPrev from entering the wallet, but not current ones being transmitted.
* | Refuse to retransmit transactions without vinsWladimir J. van der Laan2013-12-041-1/+4
|/ | | | | | | Versions of bitcoin before 0.8.6 have a bug that inserted empty transactions into the vtxPrev in the wallet, which will cause the node to be banned when retransmitted, hence add a check for !tx.vin.empty() before RelayTransaction.
* Sanitize assert usage and refuse to compile with NDEBUG.Gregory Maxwell2013-12-021-1/+3
| | | | | | | | There were quite a few places where assert() was used with side effects, making operation with NDEBUG non-functional. This commit fixes all the cases I know about, but also adds an #error on NDEBUG because the code is untested without assertions and may still have vulnerabilities if used without assert.