aboutsummaryrefslogtreecommitdiff
path: root/src/walletdb.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-17/+17
|/
* Payment Protocol: X509-validated payment requestsGavin Andresen2013-08-221-0/+18
| | | | | | | | Add support for a Payment Protocol to Bitcoin-Qt. Payment messages are protocol-buffer encoded and communicated over http(s), so this adds a dependency on the Google protocol buffer library, and requires Qt with OpenSSL support.
* Refactor: CAddressBookData for mapAddressBookGavin Andresen2013-08-221-1/+1
| | | | | | | | Straight refactor, so mapAddressBook stores a CAddressBookData (which just contains a std::string) instead of a std::string. Preparation for payment protocol work, which will add the notion of refund addresses to the address book.
* Remove #define loop from util.hGavin Andresen2013-07-311-2/+2
| | | | | Replace the loop macro with while (true). The #define caused problems for Qt.
* Bugfix: Move boost/version include from db.cpp to walletdb.cpp where ↵Luke Dashjr2013-07-151-0/+1
| | | | BOOST_VERSION is used
* Add GetKeyBirthTimes to walletPieter Wuille2013-06-221-0/+9
| | | | | | | Compute safe lower bounds on the birth times of all wallet keys. For pool keys or keys with metadata, the actually stored birth time is used. For all others, the birth times are inferred from the wallet transactions.
* Refactor keytime/metadata and wallet encryption bugfixPieter Wuille2013-06-201-2/+4
| | | | | | | | | | | | | | | | | | | | | Refactor keytime: * Key metadata is kept in a CWallet::mapKeyMetadata (std::map<CKeyId,CKeyMetadata>). * When generating a new key, time is put in that map, and new key is written. * AddKeyPubKey and AddCryptedKey do not take a creation time argument, but instead pull it from that map, if it exists there. Bugfix: * AddKeyPubKey and AddCryptedKey in CWallet didn't override the CKeyStore definition anymore. This is fixed, as they no longed need the nCreationTime argument now. Also a few related other changes: * Metadata can be overwritten. * Only GenerateNewKey calls GetTime(), as it's the only place where we know for sure a key was not constructed earlier. * When the nTimeFirstKey is known to be inaccurate, it is set to the value 1 (instead of 0, which would mean unknown). * Use CPubKey instead of std::vector<unsigned char> where possible.
* Wallet: store key creation time. Calculate whole-wallet birthday.Jeff Garzik2013-06-101-29/+60
| | | | This also encapsulate wallet-read state information into CWalletScanState.
* Removed AcceptToMemoryPool method from CTransaction. This method belongs to ↵Eric Lombrozo2013-06-051-1/+1
| | | | | | | | | | | | | | | | | the mempool instance. Removed AreInputsStandard from CTransaction, made it a regular function in main. Moved CTransaction::GetOutputFor to CCoinsViewCache. Moved GetLegacySigOpCount and GetP2SHSigOpCount out of CTransaction into regular functions in main. Moved GetValueIn and HaveInputs from CTransaction into CCoinsViewCache. Moved AllowFree, ClientCheckInputs, CheckInputs, UpdateCoins, and CheckTransaction out of CTransaction and into main. Moved IsStandard and IsFinal out of CTransaction and put them in main as IsStandardTx and IsFinalTx. Moved GetValueOut out of CTransaction into main. Moved CTxIn, CTxOut, and CTransaction into core. Added minimum fee parameter to CTxOut::IsDust() temporarily until CTransaction is moved to core.h so that CTxOut needn't know about CTransaction.
* CSecret/CKey -> CKey/CPubKey split/refactorPieter Wuille2013-05-301-39/+20
|
* Always print full hashes (tx, block, inv)Pieter Wuille2013-04-071-1/+1
|
* small indentation, space, formatting fixes (no code changes)Philip Kaufmann2013-04-061-4/+4
|
* Clean up shutdown processGavin Andresen2013-04-031-7/+9
|
* Rename util.h Sleep --> MilliSleepGavin Andresen2013-04-031-2/+2
| | | | | | | | Two reasons for this change: 1. Need to always use boost::thread's sleep, even on Windows, so the sleeps can be interrupted (prior code used Windows' built-in Sleep). 2. I always forgot what units the old Sleep took.
* CValidationState frameworkPieter Wuille2013-01-301-1/+2
|
* Remove 'T' from remaining date/time format strings.Jeff Garzik2013-01-011-1/+1
|
* Change timestamps to use ISO8601 formattingRichard Schwab2012-12-121-1/+1
|
* Handle corrupt wallets gracefully.Gavin Andresen2012-10-081-178/+330
| | | | | | | | | | | | | | | | | | | | | | | | | Corrupt wallets used to cause a DB_RUNRECOVERY uncaught exception and a crash. This commit does three things: 1) Runs a BDB verify early in the startup process, and if there is a low-level problem with the database: + Moves the bad wallet.dat to wallet.timestamp.bak + Runs a 'salvage' operation to get key/value pairs, and writes them to a new wallet.dat + Continues with startup. 2) Much more tolerant of serialization errors. All errors in deserialization are reported by tolerated EXCEPT for errors related to reading keypairs or master key records-- those are reported and then shut down, so the user can get help (or recover from a backup). 3) Adds a new -salvagewallet option, which: + Moves the wallet.dat to wallet.timestamp.bak + extracts ONLY keypairs and master keys into a new wallet.dat + soft-sets -rescan, to recreate transaction history This was tested by randomly corrupting testnet wallets using a little python script I wrote (https://gist.github.com/3812689)
* Bugfix: Initialize CWallet::nOrderPosNext on an empty wallet, and save it in dbLuke Dashjr2012-09-081-0/+4
|
* Store a fixed order of transactions (and accounting) in the walletLuke Dashjr2012-08-231-1/+96
| | | | | For backward compatibility, new accounting data is stored after a \0 in the comment string. This way, old versions and third-party software should load and store them, but all actual use (listtransactions, for example) ignores it.
* Give threads a recognisable name to aid in debuggingGiel van Schijndel2012-07-171-0/+3
| | | | | | | | NOTE: These thread names are visible in gdb when using 'info threads'. Additionally both 'top' and 'ps' show these names *unless* told to display the command-line instead of task name. Signed-off-by: Giel van Schijndel <[email protected]>
* Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddressPieter Wuille2012-05-241-1/+1
| | | | | | | | | | | | | | | | | This introduces internal types: * CKeyID: reference (hash160) of a key * CScriptID: reference (hash160) of a script * CTxDestination: a boost::variant of the former two CBitcoinAddress is retrofitted to be a Base58 encoding of a CTxDestination. This allows all internal code to only use the internal types, and only have RPC and GUI depend on the base58 code. Furthermore, the header dependencies are a lot saner now. base58.h is at the top (right below rpc and gui) instead of at the bottom. For the rest: wallet -> script -> keystore -> key. Only keystore still requires a forward declaration of CScript. Solving that would require splitting script into two layers.
* Encapsulate public keys in CPubKeyPieter Wuille2012-05-241-1/+1
|
* Merge branch 'dbenv' into tmpJeff Garzik2012-05-221-19/+13
|\ | | | | | | | | Conflicts: src/db.cpp
| * Further CDBEnv encapsulation work.Jeff Garzik2012-05-191-12/+9
| |
| * Encapsulate BDB environment inside new CDBEnv classJeff Garzik2012-05-191-7/+4
| | | | | | | | | | | | | | | | Cleans up and organizes several scattered functions and variables related to the BDB env. Class CDBInit() existed to provide a guaranteed-via-C++-destructor cleanup of the db environment. A formal CDBEnv class provides all of this inside a single wrapper.
* | Update License in File HeadersFordy2012-05-181-1/+1
|/ | | | | | I originally created a pull to replace the "COPYING" in crypter.cpp and crypter.h, but it turned out that COPYING was actually the correct file.
* ensure that no double timestamps show up in the debug.log, by removing ↵Philip Kaufmann2012-05-131-1/+0
| | | | manual timestamps from the source (now only -logtimestamps parameter adds timestamps to debug.log)
* Bugfix: %-12I64d is not valid and causes the parameter to be skipped, use ↵Luke Dashjr2012-05-051-1/+1
| | | | %12"PRI64d" instead
* Further reduce header dependenciesPieter Wuille2012-04-171-4/+4
| | | | | | | This commit removes the dependency of serialize.h on PROTOCOL_VERSION, and makes this parameter required instead of implicit. This is much saner, as it makes the places where changing a version number can have an influence obvious.
* Move CWalletDB code to new walletdb module.Jeff Garzik2012-04-171-0/+428
In addition to standard code separation, this change opens the door to fixing several include inter-dependencies.