aboutsummaryrefslogtreecommitdiff
path: root/src/walletdb.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Move Only] Move wallet related things to src/wallet/Jonas Schnelli2015-03-121-986/+0
| | | | could once be renamed from /src/wallet to /src/legacywallet.
* Reinitialize state in between individual unit tests.Pieter Wuille2015-03-031-3/+3
| | | | | This changes the TestingSetup fixture to be per-unit-test rather than global. Most tests don't need it, so it's only invoked in a few.
* Remove whitespaces before double colon in errors and logsPavel Janík2015-01-311-2/+2
|
* Merge pull request #4805Wladimir J. van der Laan2015-01-261-1/+1
|\ | | | | | | 44bc988 [Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..) (Cozz Lovan)
| * [Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..)Cozz Lovan2014-10-031-1/+1
| |
* | Merge pull request #5513Wladimir J. van der Laan2015-01-061-7/+6
|\ \ | | | | | | | | | | | | | | | 856e862 namespace: drop most boost namespaces and a few header cleanups (Cory Fields) 9b1ab86 namespace: drop boost::assign altogether here (Cory Fields) a324199 namespace: remove boost namespace pollution (Cory Fields)
| * | namespace: remove boost namespace pollutionCory Fields2015-01-021-7/+6
| | |
* | | Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan2015-01-051-2/+2
|/ / | | | | | | | | | | Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
* | Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | | | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* | Merge pull request #5470Wladimir J. van der Laan2014-12-191-1/+1
|\ \ | | | | | | | | | 78253fc Remove references to X11 licence (Michael Ford)
| * | Remove references to X11 licenceMichael Ford2014-12-161-1/+1
| | |
* | | make all catch() arguments constPhilip Kaufmann2014-12-171-4/+4
|/ / | | | | | | | | | | | | - I saw this on http://en.cppreference.com/w/cpp/language/try_catch and thought it would be a good idea - also unify used format to better be able to search for exception uses in our codebase
* | boost: drop dependency on tuple in serializationCory Fields2014-10-151-4/+4
| | | | | | | | | | There's only one user of this form of serialization, so it can be easily dropped. It could be re-added if desired when we switch to c++11.
* | Merge pull request #4937Wladimir J. van der Laan2014-10-131-0/+6
|\ \ | | | | | | | | | ccca27a [Wallet] Watch-only fixes (Cozz Lovan)
| * | [Wallet] Watch-only fixesCozz Lovan2014-10-031-0/+6
| |/
* | Merge pull request #4996Pieter Wuille2014-10-081-4/+3
|\ \ | |/ |/| | | | | | | d0c4197 change exit(1) to an assert in CWallet::EncryptWallet (Philip Kaufmann) 870da77 fix possible memory leaks in CWallet::EncryptWallet (Philip Kaufmann) f606bb9 fix a possible memory leak in CWalletDB::Recover (Philip Kaufmann)
| * fix a possible memory leak in CWalletDB::RecoverPhilip Kaufmann2014-10-011-4/+3
| | | | | | | | | | - convert pdbCopy into a boost::scoped_ptr to ensure memory gets freed in all cases (e.g. after "ret > 0")
* | Merge pull request #5022Wladimir J. van der Laan2014-10-011-8/+0
|\ \ | | | | | | | | | c375b5c remove dead/unused code in walletdb.cpp (Philip Kaufmann)
| * | remove dead/unused code in walletdb.cppPhilip Kaufmann2014-10-011-8/+0
| |/ | | | | | | - closes #5021
* / Use a typedef for monetary valuesMark Friedenbach2014-09-261-2/+2
|/
* cleanup class private and public areas in walletdbPhilip Kaufmann2014-09-181-3/+1
| | | | - only code movement
* header include cleanupPhilip Kaufmann2014-09-141-1/+1
| | | | - ensures alphabetical ordering for includes etc. in source file headers
* Merge pull request #4697Wladimir J. van der Laan2014-09-081-2/+7
|\ | | | | | | da2ede2 [Wallet] Improve ReorderTransactions(..) (Cozz Lovan)
| * [Wallet] Improve ReorderTransactions(..)Cozz Lovan2014-08-141-2/+7
| |
* | Split up util.cpp/hWladimir J. van der Laan2014-08-261-0/+3
|/ | | | | | | | | | | | | | | | Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
* Use script matching rather than destination matching for watch-only.Pieter Wuille2014-07-021-6/+6
| | | | | | | | | | | | | | | | | | | This changes the keystore data format, wallet format and IsMine logic to detect watch-only outputs based on direct script matching rather than first trying to convert outputs to destinations (addresses). The reason is that we don't know how the software that has the spending keys works. It may support the same types of scripts as us, but that is not guaranteed. Furthermore, it removes the ambiguity between addresses used as identifiers for output scripts or identifiers for public keys. One practical implication is that adding a normal pay-to-pubkey-hash address via importaddress will not cause payments to the corresponding full public key to be detected as IsMine. If that is wanted, add those scripts directly (importaddress now also accepts any hex-encoded script). Conflicts: src/wallet.cpp
* Add support for watch-only addressesPieter Wuille2014-07-021-0/+19
| | | | | | | | | | | | | | | | | | | | | | Changes: * Add Add/Have WatchOnly methods to CKeyStore, and implementations in CBasicKeyStore. * Add similar methods to CWallet, and support entries for it in CWalletDB. * Make IsMine in script/wallet return a new enum 'isminetype', rather than a boolean. This allows distinguishing between spendable and unspendable coins. * Add a field fSpendable to COutput (GetAvailableCoins' return type). * Mark watchonly coins in listunspent as 'watchonly': true. * Add 'watchonly' to validateaddress, suppressing script/pubkey/... in this case. Based on a patch by Eric Lombrozo. Conflicts: src/qt/walletmodel.cpp src/rpcserver.cpp src/wallet.cpp
* Let -zapwallettxes recover transaction meta dataCozz Lovan2014-06-161-3/+7
|
* 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.
* AddToWallet implies BindWalletWladimir J. van der Laan2014-03-071-3/+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.
* Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan2014-02-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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.
* 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-1/+1
|\ \ | | | | | | Report transaction conflicts, and tentative account balance fix
| * | Track and report wallet transaction clonesGavin Andresen2014-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Add -zapwallettxes cli/config option, used for wallet recoveryJeff Garzik2014-02-141-0/+80
|/ / | | | | | | | | This diagnostic tool removes all "tx" records from the wallet db, then forces a full rescan, to rebuild "tx" records accurately.
* / remove setting methods in wallet/walletdbCozz Lovan2014-02-071-6/+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.
* wallet: add interface for storing generic data on destinationsWladimir J. van der Laan2014-01-191-0/+24
|
* Don't create empty transactions when reading corrupted walletWladimir J. van der Laan2013-12-161-4/+2
| | | | | | | | | | | The current transaction loading code is not exception safe. An exception during deserialization causes an empty transaction to be left behind in the wallet. Fix this by building the transaction separately and adding it only to the wallet at the end. Fixes #3333.
* Merge pull request #3257Wladimir J. van der Laan2013-11-201-1/+0
|\ | | | | | | 379778b core: remove includes in .cpp, if header is already in .h (Philip Kaufmann)
| * core: remove includes in .cpp, if header is already in .hPhilip Kaufmann2013-11-151-1/+0
| | | | | | | | | | - example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
* | orphan spaces cleanup ;-)Philip Kaufmann2013-11-151-9/+9
|/
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-20/+142
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Merge pull request #3119Pieter Wuille2013-10-201-1/+1
|\ | | | | | | db0e8cc Bump Year Number to 2013 (super3)
| * Bump Year Number to 2013super32013-10-201-1/+1
| |
* | Merge pull request #2950 from pstratem/walletloadGavin Andresen2013-10-161-5/+33
|\ \ | |/ |/| Walletload
| * comment explaining new wallet format for key/wkey entriesphantomcircuit2013-10-121-0/+6
| |
| * improve wallet load time by removing duplicated calls to EC_KEY_check_key ↵patrick s2013-08-281-5/+27
| | | | | | | | | | | | and adding a hash for vchPubKey/vchPrivKey entries in wallet.dat backwards compatible with previous wallet.dat format