aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODSPieter Wuille2014-09-021-6/+6
|
* Serializer simplifications after IMPLEMENT_SERIALIZE overhaulPieter Wuille2014-09-011-25/+19
|
* Merge pull request #4737Pieter Wuille2014-09-011-28/+41
|\ | | | | | | | | | | | | 31e9a83 Use CSizeComputer to avoid counting sizes in SerializationOp (Pieter Wuille) 84881f8 rework overhauled serialization methods to non-static (Kamil Domanski) 5d96b4a remove fields of ser_streamplaceholder (Kamil Domanski) 3d796f8 overhaul serialization code (Kamil Domanski)
| * Use CSizeComputer to avoid counting sizes in SerializationOpPieter Wuille2014-08-311-32/+16
| |
| * rework overhauled serialization methods to non-staticKamil Domanski2014-08-311-51/+51
| | | | | | | | | | | | | | Thanks to Pieter Wuille for most of the work on this commit. I did not fixup the overhaul commit, because a rebase conflicted with "remove fields of ser_streamplaceholder". I prefer not to risk making a mistake while resolving it.
| * overhaul serialization codeKamil Domanski2014-08-311-47/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of each class' serialization/deserialization is no longer passed within a macro. The implementation now lies within a template of form: template <typename T, typename Stream, typename Operation> inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; /* CODE */ return nSerSize; } In cases when codepath should depend on whether or not we are just deserializing (old fGetSize, fWrite, fRead flags) an additional clause can be used: bool fRead = boost::is_same<Operation, CSerActionUnserialize>(); The IMPLEMENT_SERIALIZE macro will now be a freestanding clause added within class' body (similiar to Qt's Q_OBJECT) to implement GetSerializeSize, Serialize and Unserialize. These are now wrappers around the "SerializationOp" template.
* | Merge pull request #4779Wladimir J. van der Laan2014-09-011-1/+2
|\ \ | |/ |/| | | 093303a add missing header end comments (Philip Kaufmann)
| * add missing header end commentsPhilip Kaufmann2014-08-281-1/+2
| | | | | | | | | | | | - ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files
* | Move CMerkleTx to wallet.cpp/hWladimir J. van der Laan2014-08-291-0/+57
| | | | | | | | It is only used by the wallet so it has no place in main.
* | Fix a few "Uninitialized scalar field" warningsWladimir J. van der Laan2014-08-281-0/+1
|/ | | | | | Fix a few warnings reported by Coverity. None of these is critical, but making sure that class fields are initialized can avoid heisenbugs.
* Merge pull request #4673Wladimir J. van der Laan2014-08-261-0/+3
|\ | | | | | | | | 1c5f0af [Qt] Add column Watch-only to transactions list (Cozz Lovan) 939ed97 Add boolean HaveWatchonly and signal NotifyWatchonlyChanged (Cozz Lovan)
| * Add boolean HaveWatchonly and signal NotifyWatchonlyChangedCozz Lovan2014-08-111-0/+3
| |
* | Split up util.cpp/hWladimir J. van der Laan2014-08-261-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Move functions in wallet.h to implementation fileWladimir J. van der Laan2014-08-261-15/+3
| | | | | | | | Breaks compile-time dependency of wallet.h on util.
* | Remove all other print() methodsWladimir J. van der Laan2014-08-201-5/+0
| | | | | | | | All unused.
* | Add a way to limit deserialized string lengthsPieter Wuille2014-08-091-3/+3
|/ | | | and use it for most strings being serialized.
* Revert "UI to alert of respend attempt affecting wallet."Wladimir J. van der Laan2014-07-211-13/+2
| | | | | | | | This reverts commit ada5a067c75f19a724cc054286ecf2254e5dbe8f. Conflicts: src/qt/guiconstants.h src/wallet.h
* Add vout to ListTransactions outputCozz Lovan2014-07-151-2/+8
|
* Merge pull request #4045Wladimir J. van der Laan2014-07-071-28/+120
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a3e192a replaced MINE_ with ISMINE_ (JaSK) 53a2148 fixed bug where validateaddress doesn't display information (JaSK) f28707a fixed bug in ListReceived() (JaSK) 519dd1c Added MINE_ALL = (spendable|watchonly) (JaSK) 23b0506 Fixed some stuff in TransactionDesc (JaSK) 80dda36 removed default argument values for ismine filter (JaSK) d5087d1 Use script matching rather than destination matching for watch-only. (Pieter Wuille) 0fa2f88 added includedWatchonly argument to listreceivedbyaddress/...account (JaSK) f87ba3d added includeWatchonly argument to 'gettransaction' because it affects balance calculation (JaSK) a5c6c5d fixed tiny glitch and improved readability like laanwj suggested (JaSK) d7d5d23 Added argument to listtransactions and listsinceblock to include watchonly addresses (JaSK) 952877e Showing 'involvesWatchonly' property for transactions returned by 'listtransactions' and 'listsinceblock'. It is only appended when the transaction involves a watchonly address. (JaSK) 83f3543 Added argument to listaccounts to include watchonly addresses (JaSK) d4640d7 Added argument to getbalance to include watchonly addresses and fixed errors in balance calculation. (JaSK) d2692f6 Watchonly transactions are marked in transaction history (JaSK) ffd40da Watchonly balances are shown separately in gui. (JaSK) 2935b21 qt: Hide unspendable outputs in coin control (Wladimir J. van der Laan) c898846 Add support for watch-only addresses (Pieter Wuille)
| * replaced MINE_ with ISMINE_JaSK2014-07-021-12/+12
| |
| * Added MINE_ALL = (spendable|watchonly)JaSK2014-07-021-3/+3
| |
| * removed default argument values for ismine filterJaSK2014-07-021-12/+13
| |
| * Use script matching rather than destination matching for watch-only.Pieter Wuille2014-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Showing 'involvesWatchonly' property for transactions returned by ↵JaSK2014-07-021-2/+2
| | | | | | | | | | | | 'listtransactions' and 'listsinceblock'. It is only appended when the transaction involves a watchonly address.
| * Added argument to getbalance to include watchonly addresses and fixed errors ↵JaSK2014-07-021-11/+41
| | | | | | | | in balance calculation.
| * Watchonly balances are shown separately in gui.JaSK2014-07-021-8/+63
| |
| * Add support for watch-only addressesPieter Wuille2014-07-021-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Rename SendMoneyToDestination to SendMoney.Daniel Kraft2014-07-071-2/+1
| | | | | | | | | | | | | | Get rid of SendMoney and replace it by the functionality of SendMoneyToDestination. This cleans up the code, since only SendMoneyToDestination was actually used (SendMoney internally from this routine).
* | Move fee policy out of coreGavin Andresen2014-07-031-0/+1
| |
* | Use fee/priority estimates in wallet CreateTransactionGavin Andresen2014-07-031-0/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | The wallet now uses the mempool fee estimator with a new command-line option: -txconfirmtarget (default: 1) instead of using hard-coded fees or priorities. A new bitcoind that hasn't seen enough transactions to estimate will fall back to the old hard-coded minimum priority or transaction fee. -paytxfee option overrides -txconfirmtarget. Relaying and mining code isn't changed. For Qt, the coin control dialog now uses priority estimates to label transaction priority (instead of hard-coded constants); unspent outputs were consistently labeled with a much higher priority than is justified by the free transactions actually being accepted into blocks. I did not implement any GUI for setting -txconfirmtarget; I would suggest getting rid of the "Pay transaction fee" GUI and replace it with either "target number of confirmations" or maybe a "faster confirmation <--> lower fee" slider or select box.
* UI to alert of respend attempt affecting wallet.Tom Harding2014-06-271-2/+13
| | | | | | | | | | | | | | | | | 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.
* Merge pull request #3674Wladimir J. van der Laan2014-06-241-1/+1
|\ | | | | | | 77cbd46 Let -zapwallettxes recover transaction meta data (Cozz Lovan)
| * Let -zapwallettxes recover transaction meta dataCozz Lovan2014-06-161-1/+1
| |
* | Code simplifications after CTransaction::GetHash() cachingPieter Wuille2014-06-221-2/+2
|/
* Ignore too-long redeemScripts while loading walletWladimir J. van der Laan2014-06-121-1/+1
| | | | | | | This avoids that long redeemScripts that were grandfathered in prevent the wallet from loading. Fixes #4313.
* Type-safe CFeeRate classGavin Andresen2014-06-061-1/+1
| | | | | | | | 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.
* CWallet: fix nTimeFirstKey init, by making constructor init common codeJeff Garzik2014-06-031-11/+10
| | | | Don't repeat yourself etc.
* Properly initialize CWallet::nTimeFirstKeytm3141592014-06-021-0/+1
|
* Merge pull request #4206Wladimir J. van der Laan2014-05-251-2/+2
|\ | | | | | | 79d06dc Remove redundant c_str (R E Broadley)
| * Remove redundant c_strR E Broadley2014-05-221-2/+2
| |
* | remove CWallet::AddReserveKey which is never usedKamil Domanski2014-05-201-1/+0
|/
* add DEFAULT_TRANSACTION_FEE constant in walletPhilip Kaufmann2014-05-051-0/+2
| | | | | - as this is a shared Core/GUI setting, this makes it easier to keep them in sync (also no new includes are needed)
* [Qt] rescan progressCozz Lovan2014-04-021-0/+3
|
* Add nHighTransactionFeeWarning as per #3969.Bardi Harborow2014-03-291-0/+3
|
* Make GetAvailableCredit run GetHash() only once per transaction.Gregory Maxwell2014-03-281-1/+2
| | | | This makes the first getbalance/getinfo 63x faster on my wallet.
* Fix null pointer in IsTrusted()Cozz Lovan2014-03-051-1/+3
|
* Remove CWalletTx::vfSpentGavin Andresen2014-02-261-100/+25
| | | | | | Use the spent outpoint multimap to figure out which wallet transaction outputs are unspent, instead of a vfSpent array that is saved to disk.
* Wallet locking fixes for -DDEBUG_LOCKORDERGavin Andresen2014-02-181-1/+1
| | | | | | | | | | | 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.
* Merge pull request #3671 from gavinandresen/txn_conflictsGavin Andresen2014-02-151-1/+13
|\ | | | | Report transaction conflicts, and tentative account balance fix
| * Track and report wallet transaction clonesGavin Andresen2014-02-141-1/+13
| | | | | | | | | | | | | | | | | | | | 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.