aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-1/+1
| | | | | | | | | | | | | The new class is accessed via the Params() method and holds most things that vary between main, test and regtest networks. The regtest mode has two purposes, one is to run the bitcoind/bitcoinj comparison tool which compares two separate implementations of the Bitcoin protocol looking for divergence. The other is that when run, you get a local node which can mine a single block instantly, which is highly convenient for testing apps during development as there's no need to wait 10 minutes for a block on the testnet.
* Removed AcceptToMemoryPool method from CTransaction. This method belongs to ↵Eric Lombrozo2013-06-051-5/+5
| | | | | | | | | | | | | | | | | 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.
* Merge pull request #2625 from gavinandresen/walletlock_asioJeff Garzik2013-05-301-56/+11
|\ | | | | Use boost::asio::deadline_timer for walletpassphrase timeout
| * Use boost::asio::deadline_timer for walletpassphrase timeoutGavin Andresen2013-05-071-56/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #2600 from sipa/keyrefactorJeff Garzik2013-05-301-7/+9
|\ \ | | | | | | Refactor key.cpp/.h
| * | CSecret/CKey -> CKey/CPubKey split/refactorPieter Wuille2013-05-301-6/+8
| | |
| * | Make CPubKey statically allocatedPieter Wuille2013-05-301-1/+1
| |/
* | Merge pull request #2104 from al42and/listreceivedbyaddress_txidsJeff Garzik2013-05-301-1/+13
|\ \ | |/ |/| listreceivedbyaddress now provides tx ids (issue #1149)
| * Updated help and tests for getreceivedby(account|address)Andrey2012-12-161-3/+7
| |
| * listreceivedbyaddress now provides tx ids (issue #1149)Andrey2012-12-131-0/+8
| |
* | CreateTransaction: return strFailReason on failureGavin Andresen2013-05-031-6/+3
| |
* | Merge pull request #2272 from gavinandresen/getbalancefixGavin Andresen2013-04-081-2/+2
|\ \ | | | | | | Fix getbalance discrepency
| * | Fix getbalance discrepencyGavin Andresen2013-02-041-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | 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,
* | Rename util.h Sleep --> MilliSleepGavin Andresen2013-04-031-1/+1
| | | | | | | | | | | | | | | | Two reasons for this change: 1. Need to always use boost::thread's sleep, even on Windows, so the sleeps can be interrupted (prior code used Windows' built-in Sleep). 2. I always forgot what units the old Sleep took.
* | Add timeoffset to getinfo RPC callPeter Todd2013-01-111-0/+1
|/ | | | | Provides a method to get the difference between network adjusted time and local time from the RPC interface.
* Merge pull request #1861 from jgarzik/coinlockGavin Andresen2012-12-121-1/+76
|\ | | | | Add new RPC "lockunspent", to prevent spending of selected outputs
| * Add new RPC "lockunspent", to prevent spending of selected outputsJeff Garzik2012-11-151-1/+76
| | | | | | | | | | | | and associated RPC "listlockunspent". This is a memory-only filter, which is empty when a node restarts.
* | do not silently ignore errors on "backupwallet" RPC cmdPhilip Kaufmann2012-11-271-1/+2
| |
* | Merge pull request #2009 from sipa/fixmoveGavin Andresen2012-11-161-2/+2
|\ \ | |/ |/| Prevent RPC 'move' from deadlocking
| * Prevent RPC 'move' from deadlockingPieter Wuille2012-11-141-2/+2
| | | | | | | | | | It seemed to create two CWalletDB objects that both grab the database lock.
* | Merge pull request #1830 from Diapolo/trans_rem_spacesWladimir J. van der Laan2012-11-041-1/+1
|\ \ | | | | | | fix some double-spaces in strings
| * | fix some double-spaces in stringsPhilip Kaufmann2012-10-251-1/+1
| | | | | | | | | | | | | | | - remove some unneeded stuff in sendcoinsentry.ui - harmonize some "Error:"-messages
* | | New createmultisig rpc commandGavin Andresen2012-10-291-15/+48
|/ / | | | | | | | | | | This is to support the signrawtransaction API call; given the public keys involved in a multisig transaction, this gives back the redeemScript needed to sign it.
* / Use CHashWriter also in SignatureHash(), and for message signingPieter Wuille2012-10-191-4/+4
|/
* Merge pull request #1859 from Diapolo/proxy_locksPieter Wuille2012-10-071-3/+3
|\ | | | | add LOCK() for proxy related data-structures
| * add LOCK() for proxy related data-structuresPhilip Kaufmann2012-10-041-3/+3
| | | | | | | | | | | | | | | | | | - fix #1560 by properly locking proxy related data-structures - update GetProxy() and introduce GetNameProxy() to be able to use a thread-safe local copy from proxyInfo and nameproxyInfo - update usage of GetProxy() all over the source to match the new behaviour, as it now fills a full proxyType object - rename GetNameProxy() into HaveNameProxy() to be more clear
* | Document RPC error codesWladimir J. van der Laan2012-10-041-41/+41
|/ | | | Replace all "magic values" in RPCError(...) by constants.
* Merge branch '2012_09_fixwformat' of github.com:laanwj/bitcoinGavin Andresen2012-10-011-1/+1
|\
| * fix -Wformat warnings all over the sourcePhilip Kaufmann2012-10-011-1/+1
| |
* | Add a backup warning to the encryptwallet RPC commandkjj22012-09-301-1/+1
|/
* Merge branch 'refactor_times' of git://github.com/luke-jr/bitcoinGavin Andresen2012-09-181-2/+2
|\
| * Bugfix: Initialize CWallet::nOrderPosNext on an empty wallet, and save it in dbLuke Dashjr2012-09-081-2/+2
| |
* | Merge pull request #1738 from laanwj/2012_08_boostthreadJeff Garzik2012-09-041-2/+2
|\ \ | | | | | | implement CreateThread with boost::thread
| * | Rename CreateThread to NewThreadWladimir J. van der Laan2012-08-291-2/+2
| | | | | | | | | | | | Prevent clash with win32 API symbol
* | | Merge pull request #1774 from luke-jr/refactor_timesGavin Andresen2012-09-021-1/+2
|\ \ \ | |/ / |/| / | |/ Bugfix: Require OrderedTxItems to provide properly scoped accounting entry list
| * Bugfix: Require OrderedTxItems to provide properly scoped accounting entry listLuke Dashjr2012-09-021-1/+2
| | | | | | | | | | | | 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.
* | Merge pull request #1672 from gmaxwell/filter_listunspentGregory Maxwell2012-08-241-0/+31
|\ \ | | | | | | Listunspent txout address filtering and listaddressgroupings
| * | Change CWallet addressgrouping to use CTxDestination instead of strings.Gregory Maxwell2012-08-241-5/+9
| | | | | | | | | | | | | | | This is cleanup for the listaddressgroupings code. Also add some real help text.
| * | Add address groupings RPC from the coincontrol patches.coderrr2012-08-231-0/+27
| |/ | | | | | | Signed-off-by: Gregory Maxwell <[email protected]>
* | Avoid leaving return types or function attributes on their own lines.Gregory Maxwell2012-08-241-4/+2
| |
* | Treat generation (mined) transactions less different from receive transactionsLuke Dashjr2012-08-231-33/+22
|/ | | | | - 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
* Choose reasonable "smart" times to display for transactionsLuke Dashjr2012-08-231-20/+2
| | | | | | | | | 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.
* JSON-RPC: Add "blocktime" and (for wallet transactions) "timereceived" to ↵Luke Dashjr2012-08-231-0/+2
| | | | transaction Object outputs
* Store a fixed order of transactions (and accounting) in the walletLuke Dashjr2012-08-231-5/+7
| | | | | 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.
* Spaces in stringsxanatos2012-08-231-2/+2
| | | One added space + one removed space.
* RPC, cosmetic: move more RPC code to new rpcblockchain.cpp moduleJeff Garzik2012-08-211-0/+31
|
* RPC, cosmetic: move wallet-related RPCs to new rpcwallet.cpp moduleJeff Garzik2012-08-211-0/+1429