aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
AgeCommit message (Collapse)Author
2012-09-05Correct LoadWallet() return value (false -> DB_LOAD_OK)xanatos
Equivalent code. (false == 0 == DB_LOAD_OK). Fixes #1706.
2012-09-04Merge pull request #1738 from laanwj/2012_08_boostthreadJeff Garzik
implement CreateThread with boost::thread
2012-09-02Merge pull request #1774 from luke-jr/refactor_timesGavin Andresen
Bugfix: Require OrderedTxItems to provide properly scoped accounting entry list
2012-09-02Bugfix: Require OrderedTxItems to provide properly scoped accounting entry listLuke Dashjr
OrderedTxItems returns a multimap of pointers, but needs a place to store the actual CAccountingEntries it points to. It had been using a stack item, which was clobbered as soon as it returned, resulting in undefined behaviour. This fixes at least bug #1768.
2012-08-29Rename CreateThread to NewThreadWladimir J. van der Laan
Prevent clash with win32 API symbol
2012-08-24Merge pull request #1672 from gmaxwell/filter_listunspentGregory Maxwell
Listunspent txout address filtering and listaddressgroupings
2012-08-24Change CWallet addressgrouping to use CTxDestination instead of strings.Gregory Maxwell
This is cleanup for the listaddressgroupings code. Also add some real help text.
2012-08-23Treat generation (mined) transactions less different from receive transactionsLuke Dashjr
- Show address receiving the generation, and include it in the correct "account" - Multiple entries in listtransactions output if the coinbase has multiple outputs to us
2012-08-23Add address groupings RPC from the coincontrol patches.coderrr
Signed-off-by: Gregory Maxwell <greg@xiph.org>
2012-08-23Choose reasonable "smart" times to display for transactionsLuke Dashjr
Logic: - If sending a transaction, assign its timestamp to the current time. - If receiving a transaction outside a block, assign its timestamp to the current time. - If receiving a block with a future timestamp, assign all its (not already known) transactions' timestamps to the current time. - If receiving a block with a past timestamp, before the most recent known transaction (that we care about), assign all its (not already known) transactions' timestamps to the same timestamp as that most-recent-known transaction. - If receiving a block with a past timestamp, but after the most recent known transaction, assign all its (not already known) transactions' timestamps to the block time.
2012-08-23Store a fixed order of transactions (and accounting) in the walletLuke Dashjr
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.
2012-08-23Removed useless assignmentxanatos
nLoadWalletRet is already equal to DB_NEED_REWRITE (we are in an if)
2012-08-01Merge pull request #1632 from luke-jr/spellingJeff Garzik
Fix spelling and grammar errors
2012-08-01Bugfix: Fix a variety of misspellingsLuke Dashjr
2012-08-01Update Warning-strings to use a standard-formatPhilip Kaufmann
- ensure warnings always start with "Warning:" and that the first character after ":" is written uppercase - ensure the first sentence in warnings ends with an "!" - remove unneeded spaces from Warning-strings - add missing Warning-string translation - remove a "\n" and replace with untranslatable "<br><br>"
2012-07-05Implement raw transaction RPC callsGavin Andresen
Implement listunspent / getrawtransaction / createrawtransaction / signrawtransaction, to support creation and signing-on-multiple-device multisignature transactions.
2012-06-04Fix coin selection to only include change when it's necessary.Chris Moore
2012-06-04Preserve the shuffled order of coins with equal value to give more ↵Chris Moore
randomized coin selection.
2012-06-04Move the random_shuffle call back into SelectCoinsMinConf() so we can unit ↵Chris Moore
test it.
2012-06-04Refactor SelectCoinsMinConf() and add unit tests.Chris Moore
AvailableCoins() makes a vector of available outputs which is then passed to SelectCoinsMinConf(). This allows unit tests to test the coin selection algorithm without having the whole blockchain available.
2012-06-02Merge pull request #837 from sje397/ShowImmatureBalanceWladimir J. van der Laan
Added 'immature balance' for miners. Only displayed if the balance is > 0
2012-05-25Added 'immature balance' for miners. Only displayed if the balance is ↵sje397
greater than zero. This adds a field labelled 'Immature' in the overview section under the 'unconfirmed' field, which shows mined income that has not yet matured (which is currently not displayed anywhere, even though the transactions exist in the transaction list). To do that I added a 'GetImmatureBalance' method to the wallet, and connected that through to the GUI as per the 'GetBalance' and 'GetUnconfirmedBalance' methods. I did a small 'no-op' change to make the code in adjacent functions a little more readable (imo); it was a change I had made in my repo earlier...but I thought it wouldn't hurt so left it in. Immature balance comes from mined income that is at least two blocks deep in the chain (same logic as displayed transactions). My reasoning is: - as a miner, it's a critical stat I want to see - as a miner, and taking into account the label 'immature', the uncertainty is pretty clearly implied - those numbers are already displayed in the transaction list - this makes the overview numbers add up to what's in the transaction list - it's not displayed if the immature balance is 0, so won't bother non-miners I also 'cleaned' the overview UI a little, moving code to the XML and removing HTML.
2012-05-24Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddressPieter Wuille
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.
2012-05-24Encapsulate public keys in CPubKeyPieter Wuille
2012-05-20Merge pull request #1354 from fanquake/masterPieter Wuille
Update Header Licenses
2012-05-20Process address book updates incrementallyWladimir J. van der Laan
- No longer invalidates selection model, thus retains selection on address book changes - Fixes selection of new address when added
2012-05-20Convert UI interface to boost::signals2.Wladimir J. van der Laan
- Signals now go directly from the core to WalletModel/ClientModel. - WalletModel subscribes to signals on CWallet: Prepares for multi-wallet support, by no longer assuming an implicit global wallet. - Gets rid of noui.cpp, the few lines that were left are merged into init.cpp - Rename wxXXX message flags to MF_XXX, to make them UI indifferent. - ThreadSafeMessageBox no longer returns the value `4` which was never used, converted to void.
2012-05-20Fine-grained UI updatesWladimir J. van der Laan
Gets rid of `MainFrameRepaint` in favor of specific update functions that tell the UI exactly what changed. This improves the efficiency of various handlers. Also fixes problems with mined transactions not showing up until restart. The following notifications were added: - `NotifyBlocksChanged`: Block chain changed - `NotifyKeyStoreStatusChanged`: Wallet status (encrypted, locked) changed. - `NotifyAddressBookChanged`: Address book entry changed. - `NotifyTransactionChanged`: Wallet transaction added, removed or updated. - `NotifyNumConnectionsChanged`: Number of connections changed. - `NotifyAlertChanged`: New, updated or cancelled alert. As this finally makes it possible for the UI to know when a new alert arrived, it can be shown as OS notification. These notifications could also be useful for RPC clients. However, currently, they are ignored in bitcoind (in noui.cpp). Also brings back polling with timer for numBlocks in ClientModel. This value updates so frequently during initial download that the number of signals clogs the UI thread and causes heavy CPU usage. And after initial block download, the value changes so rarely that a delay of half a second until the UI updates is unnoticable.
2012-05-18change strings to Bitcoin (uppercase), where it is used as a noun and update ↵Philip Kaufmann
strings to use "Qt" (and not qt or QT) / update initialisation of notificator to use qApp->applicationName() instead of a static string
2012-05-18Update License in File HeadersFordy
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.
2012-05-14Always check return values of TxnBegin() and TxnCommit()Jeff Garzik
2012-04-22Prefer 'unsigned int' for loop index variables tested against ::size()Jeff Garzik
C++ STL ::size() generally returns unsigned, which implies that "int idx" style of loop variable will generate a signed-vs-unsigned comparison warning when testing the loop exit condition "idx < blah.size()" Update areas of the bitcoin code where loop variables may be more properly and correctly defined as unsigned.
2012-04-17Further reduce header dependenciesPieter Wuille
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.
2012-04-17Move CWalletDB code to new walletdb module.Jeff Garzik
In addition to standard code separation, this change opens the door to fixing several include inter-dependencies.
2012-04-17Remove headers.hPieter Wuille
2012-04-15Fix loop index var types, fixing many minor sign comparison warningsJeff Garzik
foo.size() typically returns an unsigned integral type; make loop variables match those types' signedness.
2012-04-15fix warnings: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]Wladimir J. van der Laan
2012-04-09Use scoped locks instead of CRITICAL_BLOCKPieter Wuille
2012-04-04qtui.h/noui.h interface cleanupWladimir J. van der Laan
- rename wxMessageBox, remove redundant arguments to noui/qtui calls - also, add flag to force blocking, modal dialog box for disk space warning etc - clarify function naming - no more special MessageBox needed from AppInit2, as window object is created before calling AppInit2
2012-04-04Update UI through async calls MainFrameRepaint and AddressBookRepaint ↵Wladimir J. van der Laan
instead of a timer. - Overall, this is better design - This fixes problems with the address book UI not updating when the address book is changed through RPC - Move Statusbar change detection responsibility to ClientModel
2012-03-22Introduce explicit -walletupgrade optionPieter Wuille
Do not automatically change the wallet format unless the user takes an explicit action that implies an upgrade (encrypting, for now), or uses -walletupgrade. -walletupgrade optionally takes an integer argument: the client version up to which upgrading is allowed. Without an argument, it is upgraded to latest supported version. If an argument to -walletupgrade is provided at the time the wallet is created, the new wallet will initially not use features beyond that version. Third, the current wallet version number is reported in getinfo.
2012-02-19Merge pull request #864 from sipa/fix_856Pieter Wuille
Make compressed pubkeys require client >=0.5.99
2012-02-18Free pwalletdbEncryption after encryping walletPieter Wuille
Fixes a memory leak.
2012-02-18Make compressed pubkeys require 0.6.0Pieter Wuille
2012-02-18Move GenerateNewKey back to CWalletPieter Wuille
2012-02-18Add SetMinVersion to CWalletPieter Wuille
2012-02-07Update all copyrights to 2012Gavin Andresen
2012-01-13Replace OP_EVAL (BIP 12) with Pay-to-script-hash (BIP 16).Gavin Andresen
2011-12-22Fix broken ExtractAddress (refactored, made callers check for addresses in ↵Gavin Andresen
keystore if they care)
2011-12-21Revert "Use standard C99 (and Qt) types for 64-bit integers"Wladimir J. van der Laan
This reverts commit 21d9f36781604e4ca9fc35dc65265593423b73e9.