aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Introduce BlockMap type for mapBlockIndexPieter Wuille2014-09-041-3/+3
|
* Move CMerkleTx to wallet.cpp/hWladimir J. van der Laan2014-08-291-0/+99
| | | | It is only used by the wallet so it has no place in main.
* Merge pull request #4673Wladimir J. van der Laan2014-08-261-0/+1
|\ | | | | | | | | 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/+1
| |
* | Split up util.cpp/hWladimir J. van der Laan2014-08-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+17
|/ | | | Breaks compile-time dependency of wallet.h on util.
* Revert "UI to alert of respend attempt affecting wallet."Wladimir J. van der Laan2014-07-211-27/+6
| | | | | | | | This reverts commit ada5a067c75f19a724cc054286ecf2254e5dbe8f. Conflicts: src/qt/guiconstants.h src/wallet.h
* Revert "Add -respendnotify option and new RPC data"Wladimir J. van der Laan2014-07-211-8/+0
| | | | This reverts commit 9004798e62e987ddf50030b17fa1881b63dd5e45.
* Revert "Formatting, spelling, comment fixes."Wladimir J. van der Laan2014-07-211-1/+1
| | | | This reverts commit 7a19efe04069d9a1e251cdc94b25184f76d9d901.
* Fix a signed/unsigned warning introduced in 1b4568cWladimir J. van der Laan2014-07-181-2/+2
| | | | vout counter must be unsigned.
* Add vout to ListTransactions outputCozz Lovan2014-07-151-15/+17
|
* Fixed error in 'getbalance' when using watchonly addresses.JaSK2014-07-141-1/+1
|
* Merge pull request #4400Wladimir J. van der Laan2014-07-141-4/+5
|\ | | | | | | | | | | 4eedf4f make RandAddSeed() use OPENSSL_cleanse() (Philip Kaufmann) 6354935 move rand functions from util to new random.h/.cpp (Philip Kaufmann) 001a53d add GetRandBytes() as wrapper for RAND_bytes() (Philip Kaufmann)
| * add GetRandBytes() as wrapper for RAND_bytes()Philip Kaufmann2014-07-091-4/+5
| | | | | | | | | | | | - add a small wrapper in util around RAND_bytes() and replace with GetRandBytes() in the code to log errors from calling RAND_bytes() - remove OpenSSL header rand.h where no longer needed
* | Fix Watchonly: cs_main lock not heldCozz Lovan2014-07-131-3/+3
| |
* | `getrawchangeaddress` should fail when keypool exhaustedWladimir J. van der Laan2014-07-111-5/+1
|/ | | | | | | | | | | | An user on IRC reported an issue where `getrawchangeaddress` keeps returning a single address when the keypool is exhausted. In my opinion this is strange behaviour. - Change CReserveKey to fail when running out of keys in the keypool. - Make `getrawchangeaddress` return RPC_WALLET_KEYPOOL_RAN_OUT when unable to create an address. - Add a Python RPC test for checking the keypool behaviour in combination with encrypted wallets.
* Fee fixesCozz Lovan2014-07-081-1/+1
|
* Merge pull request #4045Wladimir J. van der Laan2014-07-071-23/+90
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+5
| |
| * Added MINE_ALL = (spendable|watchonly)JaSK2014-07-021-2/+2
| |
| * removed default argument values for ismine filterJaSK2014-07-021-2/+2
| |
| * Use script matching rather than destination matching for watch-only.Pieter Wuille2014-07-021-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * fixed tiny glitch and improved readability like laanwj suggestedJaSK2014-07-021-3/+3
| |
| * Added argument to getbalance to include watchonly addresses and fixed errors ↵JaSK2014-07-021-5/+5
| | | | | | | | in balance calculation.
| * Watchonly balances are shown separately in gui.JaSK2014-07-021-4/+49
| |
| * qt: Hide unspendable outputs in coin controlWladimir J. van der Laan2014-07-021-0/+2
| |
| * Add support for watch-only addressesPieter Wuille2014-07-021-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #4446Wladimir J. van der Laan2014-07-071-5/+5
|\ \ | | | | | | | | | 209377a Use GetBlockTime() more (jtimon)
| * | Use GetBlockTime() morejtimon2014-07-071-5/+5
| | |
* | | Rename SendMoneyToDestination to SendMoney.Daniel Kraft2014-07-071-21/+16
|/ / | | | | | | | | | | | | 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-3/+6
| |
* | Use fee/priority estimates in wallet CreateTransactionGavin Andresen2014-07-031-8/+36
|/ | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Formatting, spelling, comment fixes.Tom Harding2014-06-271-1/+1
|
* Add -respendnotify option and new RPC dataTom Harding2014-06-271-0/+8
| | | | | | | | | | | | -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).
* UI to alert of respend attempt affecting wallet.Tom Harding2014-06-271-6/+27
| | | | | | | | | | | | | | | | | 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.
* Move network-time related functions to timedata.cpp/hWladimir J. van der Laan2014-06-251-0/+1
| | | | | The network time-offset-mangement functions from util.cpp are moved to timedata.(cpp|h). This breaks the dependency of util on netbase.
* Merge pull request #3674Wladimir J. van der Laan2014-06-241-2/+2
|\ | | | | | | 77cbd46 Let -zapwallettxes recover transaction meta data (Cozz Lovan)
| * Let -zapwallettxes recover transaction meta dataCozz Lovan2014-06-161-2/+2
| |
* | Code simplifications after CTransaction::GetHash() cachingPieter Wuille2014-06-221-8/+7
| |
* | Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-7/+11
| | | | | | | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* | AvailableCoins: acquire cs_main mutexPavel Vasin2014-06-201-1/+1
|/ | | | It's required when called from WalletModel
* Ignore too-long redeemScripts while loading walletWladimir J. van der Laan2014-06-121-0/+16
| | | | | | | This avoids that long redeemScripts that were grandfathered in prevent the wallet from loading. Fixes #4313.
* Type-safe CFeeRate classGavin Andresen2014-06-061-16/+6
| | | | | | | | 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.
* remove CWallet::AddReserveKey which is never usedKamil Domanski2014-05-201-15/+0
|
* Merge pull request #4138Wladimir J. van der Laan2014-05-121-1/+1
|\ | | | | | | 783b182 Remove dummy PRIszX macros for formatting (Wladimir J. van der Laan)
| * 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.
* | add DEFAULT_TRANSACTION_FEE constant in walletPhilip Kaufmann2014-05-051-2/+2
|/ | | | | - as this is a shared Core/GUI setting, this makes it easier to keep them in sync (also no new includes are needed)
* Merge pull request #4058Wladimir J. van der Laan2014-04-221-6/+6
|\ | | | | | | | | 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)
| * Solve chainActive-related locking issuesWladimir J. van der Laan2014-04-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | - 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
* | Merge pull request #3701Wladimir J. van der Laan2014-04-191-0/+1
|\ \ | |/ |/| | | 09ec3af AddToWallet implies BindWallet (Wladimir J. van der Laan)