aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.h
AgeCommit message (Collapse)Author
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-07-05Implement raw transaction RPC callsGavin Andresen
Implement listunspent / getrawtransaction / createrawtransaction / signrawtransaction, to support creation and signing-on-multiple-device multisignature transactions.
2012-06-29Fix a few typosfanquake
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-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-03remove obsolete BackupWallet() entry in wallet.hPhilip Kaufmann
2012-04-21Remove no-longer used UI hints in bitcoin coreWladimir J. van der Laan
The Qt UI has its own associated structures for temporary transaction state / cache.
2012-04-21change type of various bare chars to bool that are only used as bool (and ↵Wladimir J. van der Laan
never serialized)
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-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-03-26Begin doxygen-compatible commentsPieter Wuille
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-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
2012-01-09Remove unused definitionPieter Wuille
2011-12-21Revert "Use standard C99 (and Qt) types for 64-bit integers"Wladimir J. van der Laan
This reverts commit 21d9f36781604e4ca9fc35dc65265593423b73e9.
2011-12-20Use standard C99 (and Qt) types for 64-bit integersLuke Dashjr
2011-12-19Use block times for 'hard' OP_EVAL switchover, and refactored EvalScriptGavin Andresen
so it takes a flag for how to interpret OP_EVAL. Also increased IsStandard size of scriptSigs to 500 bytes, so a 3-of-3 multisig transaction IsStandard.
2011-12-19OP_EVAL implementationGavin Andresen
OP_EVAL is a new opcode that evaluates an item on the stack as a script. It enables a new type of bitcoin address that needs an arbitrarily complex script to redeem.
2011-12-17Key import and exportPieter Wuille
Introduces two new RPC calls: * dumpprivkey: retrieve the private key corresponding to an address * importprivkey: add a private key to your wallet The private key format is analoguous to the address format. It is a 51-character base58-encoded string, that includes a version number and a checksum. Includes patch by mhanne: * add optional account parameter for importprivkey, if omitted use default
2011-12-17Preparations for key import/exportPieter Wuille
2011-12-17Make CWalletTx::pwallet privatePieter Wuille
2011-11-26Implement an mlock()'d string class for storing passphrasesDylan Noblesmith
SecureString is identical to std::string except with secure_allocator substituting for std::allocator. This makes casting between them impossible, so converting between the two at API boundaries requires calling ::c_str() for now.
2011-11-17Create new keypool for newly encrypted wallets.Gavin Andresen
2011-11-07Some extra commentsPieter Wuille
2011-09-02Merge branch 'master' of https://github.com/bitcoin/bitcoinWladimir J. van der Laan
Conflicts: src/main.cpp
2011-09-01Logic running with -keypool=0 was wrong (empty keys were being returned). ↵Gavin Andresen
Fixes #445 Renames GetOrReuseKeyFromKeyPool to GetKeyFromPool, with fAllowReuse arg and bool result.
2011-08-31Fix rpc-hanging deadlocksGavin Andresen
Collapsed multiple wallet mutexes to a single cs_wallet, to avoid deadlocks with wallet methods that acquired locks in different order. Also change master RPC call handler to acquire cs_main and cs_wallet locks before executing RPC calls; requiring each RPC call to acquire the right set of locks in the right order was too error-prone.
2011-08-16Merge branch 'master' of https://github.com/bitcoin/bitcoinWladimir J. van der Laan
2011-08-09Unify copyright notices.Matt Corallo
To a variation on: // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2011 The Bitcoin developers
2011-07-26Merge remote branch 'upstream/master'Wladimir J. van der Laan
Conflicts: src/bitcoinrpc.cpp
2011-07-17Use CBitcoinAddress instead of string/uint160Pieter Wuille
Instead of conversion functions between pubkey/uint160/address in base58.h, have a fully fledged class CBitcoinAddress (CAddress was already taken) to represent addresses.
2011-07-17get rid of mapPubKeysPieter Wuille
Make CKeyStore's interface work on uint160's instead of pubkeys, so no separate global mapPubKeys is necessary anymore.
2011-07-15Merge branch 'master' of https://github.com/bitcoin/bitcoinWladimir J. van der Laan
2011-07-13Update CWallet::LoadWallet for proper return type.Jeff Garzik