aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
AgeCommit message (Collapse)Author
2013-11-28Remove CENT-output free transaction rule when relayingGavin Andresen
Remove the (relay/mempool) rule that all outputs of free transactions must be greater than 0.01 XBT. Dust spam is now taken care of by making dusty outputs non-standard.
2013-05-04Merge pull request #2577 from gavinandresen/fee_bandaidGavin Andresen
Treat dust outputs as non-standard, un-hardcode TX_FEE constants
2013-05-03Merge pull request #2566 from sipa/nodefGavin Andresen
Allow the default key to be unavailable
2013-05-03Un-hardcode TX_FEE constantsGavin Andresen
Allow setting of MIN_TX_FEE / MIN_RELAY_TX_FEE with -mintxfee / -mintxrelayfee Default values are the same (0.0001 BTC).
2013-05-03CreateTransaction: return strFailReason on failureGavin Andresen
2013-05-03Define dust transaction outputs, and make them non-standardGavin Andresen
2013-05-02Do not write to wallet during LoadWalletGavin Andresen
When debugging another issue, I found a hang-during-startup race condition due to LoadWallet calling SetMinVersion (via LoadCryptedKey). Writing to the file that you're in the process of reading is a bad idea.
2013-04-25Allow the default key to be unavailablePieter Wuille
This solves the issue where no default key can be added after -salvagewallet.
2013-04-09Merge pull request #2478 from sipa/fullhashGavin Andresen
Always print full hashes (tx, block, inv)
2013-04-08Merge pull request #2272 from gavinandresen/getbalancefixGavin Andresen
Fix getbalance discrepency
2013-04-07Always print full hashes (tx, block, inv)Pieter Wuille
2013-04-03Clean up shutdown processGavin Andresen
2013-02-22Merge pull request #2312 from gmaxwell/random_randomGavin Andresen
ApproximateBestSubset internal RNG to prevent degenerate behavior.
2013-02-22Merge pull request #1974 from kjj2/walletnotifyGavin Andresen
Add -walletnotify to call an external script on wallet transactions
2013-02-18Internal RNG for approximateBestSubset to prevent degenerate behavior.Gregory Maxwell
This fixes test_bitcoin failures on openbsd reported by dhill on IRC. On some systems rand() is a simple LCG over 2^31 and so it produces an even-odd sequence. ApproximateBestSubset was only using the least significant bit and so every run of the iterative solver would be the same for some inputs, resulting in some pretty dumb decisions. Using something other than the least significant bit would paper over the issue but who knows what other way a system's rand() might get us here. Instead we use an internal RNG with a period of something like 2^60 which is well behaved. This also makes it possible to make the selection deterministic for the tests, if we wanted to implement that.
2013-02-05Make transactions larger than 100K non-standardGavin Andresen
Extremely large transactions with lots of inputs can cost the network almost as much to process as they cost the sender in fees. We would never create transactions larger than 100K big; this change makes transactions larger than 100K non-standard, so they are not relayed/mined by default. This is most important for miners that might create blocks larger than 250K big, who could be vulnerable to a make-your-blocks-so-expensive-to-verify-they-get-orphaned attack.
2013-02-04Fix getbalance discrepencyGavin Andresen
Two changes: Use IsConfirmed() instead of IsFinal(), so 'getbalance "*" 0' uses the same 'is this output spendable' criteria as 'getbalance'. Fixes issue #172. And a tiny refactor to CWallet::GetBalance() (redundant call to IsFinal -- IsConfirmed calls IsFinal). getbalance with no arguments and 'getbalance "*" 0' could return different different results,
2013-01-30Correctly randomize change output positionGavin Andresen
2013-01-26Merge pull request #2182 from gavinandresen/addressoracleGavin Andresen
Remove IsFromMe() check in CTxMemPool::accept()
2013-01-21Merge pull request #1872 from gmaxwell/listaddrnotmineGregory Maxwell
In listaddressgroupings push down the IsMine check to run on each input.
2013-01-16Replace RelayMessage with RelayTransaction.Matt Corallo
2013-01-15Remove IsFromMe() check in CTxMemPool::accept()Gavin Andresen
Fixes issue #2178 : attacker could penny-flood with invalid-signature transactions to deduce which addresses belonged to your node. I'm committing this early for code review; I still need to write up a test plan. Executive summary of fix: check all transactions received from the network for penny-flood rate-limiting before adding to the memory pool. But do NOT ratelimit transactions added to the memory pool: - because of blockchain reorgs - stored in the wallet and added at startup - sent from the GUI or one of the send* RPC commands (CWallet::CommitTransaction) The limit-free-transactions code really should be a method on CNode, with counters per-peer. But that is a bigger change for another day.
2012-12-26If the prio. will be enough after the next block don't force fees.Gregory Maxwell
If the user was really after the fastest possible confirmation times they would be manually setting a fee. In cases where the wallet builds a transaction with a priority that is too low to qualify as free until the next block, go ahead without a fee. Confirmation frequently takes multiple blocks even when a minimum fee is provided.
2012-12-14In listaddressgroupings push down the IsMine check to run on each input.Gregory Maxwell
This avoids a potential crash when trying to read the scrippubkeys on transactions where the first input IsMine but some of the rest are not when running listaddressgroupings.
2012-12-12Merge pull request #1861 from jgarzik/coinlockGavin Andresen
Add new RPC "lockunspent", to prevent spending of selected outputs
2012-12-04rework ThreadSafeAskFee() / askFee() functionsPhilip Kaufmann
- remove unused parameter from ThreadSafeAskFee(), which also results in the removal of an orphan translation-string
2012-11-24Merge pull request #2013 from sipa/blockheaderPieter Wuille
Split off CBlockHeader from CBlock
2012-11-16Merge pull request #2009 from sipa/fixmoveGavin Andresen
Prevent RPC 'move' from deadlocking
2012-11-15Add new RPC "lockunspent", to prevent spending of selected outputsJeff Garzik
and associated RPC "listlockunspent". This is a memory-only filter, which is empty when a node restarts.
2012-11-16Split off CBlockHeader from CBlockPieter Wuille
Cleaner and removes the need for the application-specific flags in serialize.h.
2012-11-14Prevent RPC 'move' from deadlockingPieter Wuille
It seemed to create two CWalletDB objects that both grab the database lock.
2012-11-13add CWalletTx::GetImmatureCredit() and use it in CWallet::GetImmatureBalance()Philip Kaufmann
2012-11-04Merge pull request #1830 from Diapolo/trans_rem_spacesWladimir J. van der Laan
fix some double-spaces in strings
2012-11-03Add -walletnotify to call an external script on wallet transactionskjj2
2012-11-01Bugfix: do not keep relaying spent wallet transactionsPieter Wuille
The original test (checking whether the transaction occurs in the txindex) is not usable anymore, as it will miss anything already fully spent. However, as merkle transactions (and by extension, wallet transactions) track which block they were last seen being included in, we can use that to determine the need for rebroadcasting.
2012-10-25fix some double-spaces in stringsPhilip Kaufmann
- remove some unneeded stuff in sendcoinsentry.ui - harmonize some "Error:"-messages
2012-10-21Bugfix: do not mark all future coins spentPieter Wuille
2012-10-20Transaction hash cachingPieter Wuille
Use CBlock's vMerkleTree to cache transaction hashes, and pass them along as argument in more function calls. During initial block download, this results in every transaction's hash to be only computed once.
2012-10-20Batch block connection during IBDPieter Wuille
During the initial block download (or -loadblock), delay connection of new blocks a bit, and perform them in a single action. This reduces the load on the database engine, as subsequent blocks often update an earlier block's transaction already.
2012-10-20UltraprunePieter Wuille
This switches bitcoin's transaction/block verification logic to use a "coin database", which contains all unredeemed transaction output scripts, amounts and heights. The name ultraprune comes from the fact that instead of a full transaction index, we only (need to) keep an index with unspent outputs. For now, the blocks themselves are kept as usual, although they are only necessary for serving, rescanning and reorganizing. The basic datastructures are CCoins (representing the coins of a single transaction), and CCoinsView (representing a state of the coins database). There are several implementations for CCoinsView. A dummy, one backed by the coins database (coins.dat), one backed by the memory pool, and one that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock, DisconnectBlock, ... now operate on a generic CCoinsView. The block switching logic now builds a single cached CCoinsView with changes to be committed to the database before any changes are made. This means no uncommitted changes are ever read from the database, and should ease the transition to another database layer which does not support transactions (but does support atomic writes), like LevelDB. For the getrawtransaction() RPC call, access to a txid-to-disk index would be preferable. As this index is not necessary or even useful for any other part of the implementation, it is not provided. Instead, getrawtransaction() uses the coin database to find the block height, and then scans that block to find the requested transaction. This is slow, but should suffice for debug purposes.
2012-10-08Handle corrupt wallets gracefully.Gavin Andresen
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)
2012-10-01fix -Wformat warnings all over the sourcePhilip Kaufmann
2012-09-20Merge pull request #1717 from Diapolo/Qt_change_TX_displayWladimir J. van der Laan
Qt: show mined transactions at depth 1
2012-09-18Merge branch 'refactor_times' of git://github.com/luke-jr/bitcoinGavin Andresen
2012-09-08Bugfix: Initialize CWallet::nOrderPosNext on an empty wallet, and save it in dbLuke Dashjr
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