aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
AgeCommit message (Collapse)Author
2014-06-27Formatting, spelling, comment fixes.Tom Harding
2014-06-27Add -respendnotify option and new RPC dataTom Harding
-respendnotify=<cmd> Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) Add respendsobserved array to gettransaction, listtransactions, and listsinceblock RPCs. This omits the malleated clones that are included in the walletconflicts array. Add RPC help for respendsobserved and walletconflicts (help was missing for the latter).
2014-06-27UI to alert of respend attempt affecting wallet.Tom Harding
Respend transactions that conflict with transactions already in the wallet are added to it. They are not displayed unless they also involve the wallet, or get into a block. If they do not involve the wallet, they continue not to affect balance. Transactions that involve the wallet, and have conflicting non-equivalent transactions, are highlighted in red. When the conflict first occurs, a modal dialog is thrown. CWallet::SyncMetaData is changed to sync only to equivalent transactions. When a conflict is added to the wallet, counter nConflictsReceived is incremented. This acts like a change in active block height for the purpose of triggering UI updates.
2014-06-25Move network-time related functions to timedata.cpp/hWladimir J. van der Laan
The network time-offset-mangement functions from util.cpp are moved to timedata.(cpp|h). This breaks the dependency of util on netbase.
2014-06-24Merge pull request #3674Wladimir J. van der Laan
77cbd46 Let -zapwallettxes recover transaction meta data (Cozz Lovan)
2014-06-22Code simplifications after CTransaction::GetHash() cachingPieter Wuille
2014-06-21Add CMutableTransaction and make CTransaction immutable.Pieter Wuille
In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
2014-06-20AvailableCoins: acquire cs_main mutexPavel Vasin
It's required when called from WalletModel
2014-06-16Let -zapwallettxes recover transaction meta dataCozz Lovan
2014-06-12Ignore too-long redeemScripts while loading walletWladimir J. van der Laan
This avoids that long redeemScripts that were grandfathered in prevent the wallet from loading. Fixes #4313.
2014-06-06Type-safe CFeeRate classGavin Andresen
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.
2014-05-20remove CWallet::AddReserveKey which is never usedKamil Domanski
2014-05-12Merge pull request #4138Wladimir J. van der Laan
783b182 Remove dummy PRIszX macros for formatting (Wladimir J. van der Laan)
2014-05-06Remove dummy PRIszX macros for formattingWladimir J. van der Laan
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.
2014-05-05add DEFAULT_TRANSACTION_FEE constant in walletPhilip Kaufmann
- as this is a shared Core/GUI setting, this makes it easier to keep them in sync (also no new includes are needed)
2014-04-22Merge pull request #4058Wladimir J. van der Laan
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)
2014-04-19Merge pull request #3701Wladimir J. van der Laan
09ec3af AddToWallet implies BindWallet (Wladimir J. van der Laan)
2014-04-18Solve chainActive-related locking issuesWladimir J. van der Laan
- 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
2014-04-02[Qt] rescan progressCozz Lovan
2014-03-11Fix missing wallet lock in CWallet::SyncTransaction(..)Cozz Lovan
2014-03-11Merge pull request #3696Wladimir J. van der Laan
c4656e0 Add progress to initial display of latest block downloaded. (R E Broadley) 75b8953 Display progress of rescan. (R E Broadley)
2014-03-07AddToWallet implies BindWalletWladimir J. van der Laan
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.
2014-02-28Merge pull request #3694 from gavinandresen/vfspentGavin Andresen
Remove CWalletTx::vfSpent
2014-02-26Merge pull request #3735 from laanwj/2014_02_remove_PRIx64_completelyGavin Andresen
Remove PRIx64 usage completely
2014-02-26Remove CWalletTx::vfSpentGavin Andresen
Use the spent outpoint multimap to figure out which wallet transaction outputs are unspent, instead of a vfSpent array that is saved to disk.
2014-02-24Merge pull request #3704 from gavinandresen/wallet_lock_fixesGavin Andresen
Wallet locking fixes for -DDEBUG_LOCKORDER
2014-02-24Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan
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.
2014-02-22Don't use PRIx64 formatting derives from inttypes.hWladimir J. van der Laan
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)
2014-02-19Display progress of rescan.R E Broadley
2014-02-18Wallet locking fixes for -DDEBUG_LOCKORDERGavin Andresen
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.
2014-02-16Merge pull request #3646Wladimir J. van der Laan
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)
2014-02-15Merge pull request #3671 from gavinandresen/txn_conflictsGavin Andresen
Report transaction conflicts, and tentative account balance fix
2014-02-14Track and report wallet transaction clonesGavin Andresen
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.
2014-02-14Merge pull request #3669 from gavinandresen/dead_txnsGavin Andresen
Handle "conflicted" transactions properly
2014-02-14Add -zapwallettxes cli/config option, used for wallet recoveryJeff Garzik
This diagnostic tool removes all "tx" records from the wallet db, then forces a full rescan, to rebuild "tx" records accurately.
2014-02-14Handle "conflicted" transactions properlyGavin Andresen
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.
2014-02-12Rename IsConfirmed to IsTrusted to better match the intended behavior.Gregory Maxwell
This doesn't change the functionality at all.
2014-02-11Add option to avoid spending unconfirmed changeWladimir J. van der Laan
2014-02-09Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron
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.
2014-02-07remove setting methods in wallet/walletdbCozz Lovan
2014-01-23Remove redundant .c_str()sWladimir J. van der Laan
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.
2014-01-19[Qt] Permanently store requested payments in walletCozz Lovan
2014-01-19wallet: add interface for storing generic data on destinationsWladimir J. van der Laan
2014-01-06Merge pull request #3401Wladimir J. van der Laan
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)
2013-12-19Merge pull request #3412Wladimir J. van der Laan
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)
2013-12-19LoadWallet: acquire cs_wallet mutex before clearing setKeyPoolWladimir J. van der Laan
Make the function mutex-aware, to prevent having to lock cs_wallet at the call site in Init.
2013-12-19Document cs_wallet lock and add AssertLockHeldWladimir J. van der Laan
Add locking assertions to wallet to all methods that access internal fields and do not aquire the cs_wallet mutex.
2013-12-14Remove unused ThreadSafeAskFee from ui_interfaceWladimir J. van der Laan
ThreadSafeAskFee is effectively unused. It is only called when the fAskFee parameter on SendMoney or SendMoneyToDestination is true, which never happens. Remove it.
2013-12-13Move `nTransactionFee` from main.cpp to wallet.cppWladimir J. van der Laan
Transaction fee is only used by the wallet. No need for it to be in main.cpp.
2013-12-05Merge pull request #3356Wladimir J. van der Laan
d3ef9b0 Prevent empty transactions from being added to vtxPrev (Wladimir J. van der Laan)