aboutsummaryrefslogtreecommitdiff
path: root/src/walletdb.cpp
AgeCommit message (Collapse)Author
2015-03-12[Move Only] Move wallet related things to src/wallet/Jonas Schnelli
could once be renamed from /src/wallet to /src/legacywallet.
2015-03-03Reinitialize state in between individual unit tests.Pieter Wuille
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.
2015-01-31Remove whitespaces before double colon in errors and logsPavel Janík
2015-01-26Merge pull request #4805Wladimir J. van der Laan
44bc988 [Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..) (Cozz Lovan)
2015-01-06Merge pull request #5513Wladimir J. van der Laan
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)
2015-01-05Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
2015-01-02namespace: remove boost namespace pollutionCory Fields
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19Merge pull request #5470Wladimir J. van der Laan
78253fc Remove references to X11 licence (Michael Ford)
2014-12-17make all catch() arguments constPhilip Kaufmann
- 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
2014-12-16Remove references to X11 licenceMichael Ford
2014-10-15boost: drop dependency on tuple in serializationCory Fields
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.
2014-10-13Merge pull request #4937Wladimir J. van der Laan
ccca27a [Wallet] Watch-only fixes (Cozz Lovan)
2014-10-08Merge pull request #4996Pieter Wuille
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)
2014-10-03[Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..)Cozz Lovan
2014-10-03[Wallet] Watch-only fixesCozz Lovan
2014-10-01Merge pull request #5022Wladimir J. van der Laan
c375b5c remove dead/unused code in walletdb.cpp (Philip Kaufmann)
2014-10-01remove dead/unused code in walletdb.cppPhilip Kaufmann
- closes #5021
2014-10-01fix a possible memory leak in CWalletDB::RecoverPhilip Kaufmann
- convert pdbCopy into a boost::scoped_ptr to ensure memory gets freed in all cases (e.g. after "ret > 0")
2014-09-26Use a typedef for monetary valuesMark Friedenbach
2014-09-18cleanup class private and public areas in walletdbPhilip Kaufmann
- only code movement
2014-09-14header include cleanupPhilip Kaufmann
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-08Merge pull request #4697Wladimir J. van der Laan
da2ede2 [Wallet] Improve ReorderTransactions(..) (Cozz Lovan)
2014-08-26Split up util.cpp/hWladimir J. van der Laan
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.
2014-08-14[Wallet] Improve ReorderTransactions(..)Cozz Lovan
2014-07-02Use script matching rather than destination matching for watch-only.Pieter Wuille
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
2014-07-02Add support for watch-only addressesPieter Wuille
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
2014-06-16Let -zapwallettxes recover transaction meta dataCozz Lovan
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-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-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-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-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-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-19wallet: add interface for storing generic data on destinationsWladimir J. van der Laan
2013-12-16Don't create empty transactions when reading corrupted walletWladimir J. van der Laan
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.
2013-11-20Merge pull request #3257Wladimir J. van der Laan
379778b core: remove includes in .cpp, if header is already in .h (Philip Kaufmann)
2013-11-15orphan spaces cleanup ;-)Philip Kaufmann
2013-11-15core: remove includes in .cpp, if header is already in .hPhilip Kaufmann
- example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
2013-11-10Cleanup code using forward declarations.Brandon Dahler
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.
2013-10-20Merge pull request #3119Pieter Wuille
db0e8cc Bump Year Number to 2013 (super3)
2013-10-20Bump Year Number to 2013super3
2013-10-16Merge pull request #2950 from pstratem/walletloadGavin Andresen
Walletload
2013-10-12comment explaining new wallet format for key/wkey entriesphantomcircuit
2013-09-18Replace printf with LogPrintf / LogPrintGavin Andresen