aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Merge pull request #3008 from gavinandresen/CENTruleGavin Andresen2013-10-191-3/+4
|\ \ \ \ | | | | | | | | | | Two small free transaction policy changes
| * | | | Remove CENT-output free transaction rule when relayingGavin Andresen2013-10-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Refactor/encapsulate chain globals into a CChain classPieter Wuille2013-10-111-5/+5
| |_|/ / |/| | |
* | | | fix some printf -> LogPrintf leftoversPhilip Kaufmann2013-09-201-3/+3
| | | |
* | | | Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-29/+28
|/ / /
* | | qt: Handle address purpose in incremental updatesWladimir J. van der Laan2013-08-291-2/+6
| | | | | | | | | | | | | | | | | | Correctly use the purpose of addresses that are added after the start of the client. Addresses with purpose "refund" and "change" should not be visible in the GUI. This is now handled correctly.
* | | Remove fAllowReuse from GetKeyFromPool.Gregory Maxwell2013-08-231-7/+2
|/ / | | | | | | With the GUI password fix this was always false.
* | Payment Protocol: X509-validated payment requestsGavin Andresen2013-08-221-4/+6
| | | | | | | | | | | | | | | | Add support for a Payment Protocol to Bitcoin-Qt. Payment messages are protocol-buffer encoded and communicated over http(s), so this adds a dependency on the Google protocol buffer library, and requires Qt with OpenSSL support.
* | Refactor: Move GetAccountAddresses to CWalletGavin Andresen2013-08-221-0/+13
| |
* | Refactor: CAddressBookData for mapAddressBookGavin Andresen2013-08-221-4/+4
| | | | | | | | | | | | | | | | Straight refactor, so mapAddressBook stores a CAddressBookData (which just contains a std::string) instead of a std::string. Preparation for payment protocol work, which will add the notion of refund addresses to the address book.
* | Merge pull request #2776 from jgarzik/keypoolsizeGavin Andresen2013-08-141-2/+7
|\ \ | | | | | | RPC: keypoolrefill now permits optional size parameter, to bump keypool
| * | CWallet::TopUpKeyPool() takes optional pool size argumentJeff Garzik2013-06-251-2/+7
| |/ | | | | | | Also, GetKeyPoolSize() now returns an accurate type, unsigned int.
* | Remove #define loop from util.hGavin Andresen2013-07-311-1/+1
| | | | | | | | | | Replace the loop macro with while (true). The #define caused problems for Qt.
* | Bugfix: Store last/next wallet resend times unique per CWallet objectLuke Dashjr2013-07-171-7/+5
|/
* Moved CBlock::ReadFromDisk out of CBlock to functions ReadBlockFromDisk in ↵Eric Lombrozo2013-06-231-1/+1
| | | | main.h
* Merge pull request #2592 from sipa/dumpwalletPieter Wuille2013-06-231-1/+51
|\ | | | | Add dumpwallet and importwallet RPC commands
| * Add GetKeyBirthTimes to walletPieter Wuille2013-06-221-1/+51
| | | | | | | | | | | | | | Compute safe lower bounds on the birth times of all wallet keys. For pool keys or keys with metadata, the actually stored birth time is used. For all others, the birth times are inferred from the wallet transactions.
* | Merge pull request #2660 from TheBlueMatt/gmfrefactorPieter Wuille2013-06-221-1/+1
|\ \ | |/ |/| Refactor fee rules to make them actually readable.
| * Refactor fee rules to make them actually readable.Matt Corallo2013-06-141-1/+1
| | | | | | | | | | | | | | | | | | This (nearly) doesn't change fee rules at all: * To make it into the fee transaction area, the dPriority comparison changed from < to <= * We now just ignore transactions > MAX_BLOCK_SIZE/4 instead of doing some calculations to require increasingly large fees as size increases.
* | Refactor keytime/metadata and wallet encryption bugfixPieter Wuille2013-06-201-15/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor keytime: * Key metadata is kept in a CWallet::mapKeyMetadata (std::map<CKeyId,CKeyMetadata>). * When generating a new key, time is put in that map, and new key is written. * AddKeyPubKey and AddCryptedKey do not take a creation time argument, but instead pull it from that map, if it exists there. Bugfix: * AddKeyPubKey and AddCryptedKey in CWallet didn't override the CKeyStore definition anymore. This is fixed, as they no longed need the nCreationTime argument now. Also a few related other changes: * Metadata can be overwritten. * Only GenerateNewKey calls GetTime(), as it's the only place where we know for sure a key was not constructed earlier. * When the nTimeFirstKey is known to be inaccurate, it is set to the value 1 (instead of 0, which would mean unknown). * Use CPubKey instead of std::vector<unsigned char> where possible.
* | Remove broken option to skip input checking for wallet txn.Matt Corallo2013-06-131-2/+2
|/
* Wallet: optimize rescan to skip blocks prior to birthdayJeff Garzik2013-06-101-0/+7
|
* Wallet: store key creation time. Calculate whole-wallet birthday.Jeff Garzik2013-06-101-5/+22
| | | | This also encapsulate wallet-read state information into CWalletScanState.
* Removed AcceptToMemoryPool method from CTransaction. This method belongs to ↵Eric Lombrozo2013-06-051-7/+7
| | | | | | | | | | | | | | | | | the mempool instance. Removed AreInputsStandard from CTransaction, made it a regular function in main. Moved CTransaction::GetOutputFor to CCoinsViewCache. Moved GetLegacySigOpCount and GetP2SHSigOpCount out of CTransaction into regular functions in main. Moved GetValueIn and HaveInputs from CTransaction into CCoinsViewCache. Moved AllowFree, ClientCheckInputs, CheckInputs, UpdateCoins, and CheckTransaction out of CTransaction and into main. Moved IsStandard and IsFinal out of CTransaction and put them in main as IsStandardTx and IsFinalTx. Moved GetValueOut out of CTransaction into main. Moved CTxIn, CTxOut, and CTransaction into core. Added minimum fee parameter to CTxOut::IsDust() temporarily until CTransaction is moved to core.h so that CTxOut needn't know about CTransaction.
* Moved CInPoint to core. Removed GetMinFee from CTransaction and made it a ↵Eric Lombrozo2013-06-051-1/+1
| | | | regular function in main.
* build: cosmetics after last commitCory Fields2013-06-041-12/+12
|
* build: use runtime setting for wallet rather than QT_GUI defineCory Fields2013-06-041-2/+3
|
* Merge pull request #2644 from sipa/constfindblockJeff Garzik2013-05-301-1/+1
|\ | | | | Make FindBlockByHeight constant-time
| * Make FindBlockByHeight constant-time.Pieter Wuille2013-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Remove the pnext pointer in CBlockIndex, and replace it with a vBlockIndexByHeight vector (no effect on memory usage). pnext can now be replaced by vBlockIndexByHeight[nHeight+1], but FindBlockByHeight becomes constant-time. This also means the entire mapBlockIndex structure and the block index entries in it become purely blocktree-related data, and independent from the currently active chain, potentially allowing them to be protected by separate mutexes in the future.
* | Merge pull request #2625 from gavinandresen/walletlock_asioJeff Garzik2013-05-301-4/+1
|\ \ | | | | | | Use boost::asio::deadline_timer for walletpassphrase timeout
| * | Use boost::asio::deadline_timer for walletpassphrase timeoutGavin Andresen2013-05-071-4/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New method in bitcoinrpc: RunLater, that uses a map of deadline timers to run a function later. Behavior of walletpassphrase is changed; before, calling walletpassphrase again before the lock timeout passed would result in: Error: Wallet is already unlocked. You would have to call lockwallet before walletpassphrase. Now: the last walletpassphrase with correct password wins, and overrides any previous timeout. Fixes issue# 1961 which was caused by spawning too many threads. Test plan: Start with encrypted wallet, password 'foo' NOTE: python -c 'import time; print("%d"%time.time())' ... will tell you current unix timestamp. Try: walletpassphrase foo 600 getinfo EXPECT: unlocked_until is about 10 minutes in the future walletpassphrase foo 1 sleep 2 sendtoaddress mun74Bvba3B1PF2YkrF4NsgcJwHXXh12LF 11 EXPECT: Error: Please enter the wallet passphrase with walletpassphrase first. walletpassphrase foo 600 walletpassphrase foo 0 getinfo EXPECT: wallet is locked (unlocked_until is 0) walletpassphrase foo 10 walletpassphrase foo 600 getinfo EXPECT: wallet is unlocked until 10 minutes in future walletpassphrase foo 60 walletpassphrase bar 600 EXPECT: Error, incorrect passphrase getinfo EXPECT: wallet still scheduled to lock 60 seconds from first (successful) walletpassphrase
* / CSecret/CKey -> CKey/CPubKey split/refactorPieter Wuille2013-05-301-8/+10
|/
* Merge pull request #2577 from gavinandresen/fee_bandaidGavin Andresen2013-05-041-15/+50
|\ | | | | Treat dust outputs as non-standard, un-hardcode TX_FEE constants
| * Un-hardcode TX_FEE constantsGavin Andresen2013-05-031-3/+3
| | | | | | | | | | | | | | Allow setting of MIN_TX_FEE / MIN_RELAY_TX_FEE with -mintxfee / -mintxrelayfee Default values are the same (0.0001 BTC).
| * CreateTransaction: return strFailReason on failureGavin Andresen2013-05-031-8/+26
| |
| * Define dust transaction outputs, and make them non-standardGavin Andresen2013-05-031-4/+21
| |
* | Merge pull request #2566 from sipa/nodefGavin Andresen2013-05-031-17/+22
|\ \ | | | | | | Allow the default key to be unavailable
| * | Allow the default key to be unavailablePieter Wuille2013-04-251-17/+22
| |/ | | | | | | This solves the issue where no default key can be added after -salvagewallet.
* / Do not write to wallet during LoadWalletGavin Andresen2013-05-021-0/+5
|/ | | | | | | 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.
* Merge pull request #2478 from sipa/fullhashGavin Andresen2013-04-091-3/+3
|\ | | | | Always print full hashes (tx, block, inv)
| * Always print full hashes (tx, block, inv)Pieter Wuille2013-04-071-3/+3
| |
* | Merge pull request #2272 from gavinandresen/getbalancefixGavin Andresen2013-04-081-1/+1
|\ \ | |/ |/| Fix getbalance discrepency
| * Fix getbalance discrepencyGavin Andresen2013-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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,
* | Clean up shutdown processGavin Andresen2013-04-031-1/+0
| |
* | Merge pull request #2312 from gmaxwell/random_randomGavin Andresen2013-02-221-1/+9
|\ \ | | | | | | ApproximateBestSubset internal RNG to prevent degenerate behavior.
| * | Internal RNG for approximateBestSubset to prevent degenerate behavior.Gregory Maxwell2013-02-181-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #1974 from kjj2/walletnotifyGavin Andresen2013-02-221-0/+11
|\ \ \ | |/ / |/| | Add -walletnotify to call an external script on wallet transactions
| * | Add -walletnotify to call an external script on wallet transactionskjj22012-11-031-0/+11
| | |
* | | Make transactions larger than 100K non-standardGavin Andresen2013-02-051-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | 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.
* | Correctly randomize change output positionGavin Andresen2013-01-301-1/+1
| |