Commit Graph

72 Commits

Author SHA1 Message Date
Luke Dashjr
3a8029f033 Update nTime after nExtraNonce to avoid potential race
(extraNonce being reset due to just-occurred time change after nTime is set)
2011-05-11 16:50:18 -04:00
Gavin Andresen
72e962cf55 getbalance '*' was ignoring minconf param. 2011-04-18 20:57:13 -04:00
Gavin Andresen
9a189be740 Merge branch 'localefix' 2011-04-15 12:03:50 -04:00
Gavin Andresen
9ff411f7f7 Set time locale to POSIX in rfc1123Time so weekday/months in http responses are correct. 2011-04-15 12:01:34 -04:00
Jeff Garzik
17616eac17 Send/return full bitcoin version string in Server and User-Agent HTTP headers 2011-04-15 03:58:42 -04:00
Gavin Andresen
485dda9774 Merge branch 'listimmature' of /Users/gavin/src/gavin_btc 2011-04-12 17:31:31 -04:00
Jeff Garzik
d98beea894 rfc1123Time: increase buffer size for time string
Make sure we can accomodate all possibilities.
2011-04-08 22:50:14 -04:00
Gavin Andresen
198fd7b0bd Report immature coinbase transactions in listtransactions
Report coin generation transactions as 'category':'immature' until they have 120 confirmations (when they are reported as 'category':'generate', as before).
If the block they are in is not part of the main chain (you lost a 'block race'), then they are reported as 'category':'orphan' (with 0 confirmations).
2011-04-05 21:18:26 -04:00
Eric Swanson
0a4cb86976 Fixed issue 76 -- RPC error where addresses from addressbook's sending tab appear in listaccounts 2011-04-05 20:00:01 -04:00
Jeff Garzik
6f074b71bb RPC sendmany must acquire cs_main lock 2011-04-05 15:15:20 -04:00
Jeff Garzik
f5f1878ba1 Fix deadlocks in setaccount, sendfrom RPC calls
SendMoney*() now requires caller to acquire cs_main.
GetAccountAddress() now requires caller to acquire cs_main, cs_mapWallet.

Ordering is intended to match these two callchains[1]:

1. CRITICAL_BLOCK(cs_main)
    ProcessMessage(pfrom, strCommand, vMsg)
        AddToWalletIfMine()
              AddToWallet(wtx)
                  CRITICAL_BLOCK(cs_mapWallet)

2. CRITICAL_BLOCK(cs_main)
    ProcessMessage(pfrom, strCommand, vMsg)
        AddToWalletIfMine()
              AddToWallet(wtx)
                  CRITICAL_BLOCK(cs_mapWallet)
                      walletdb.WriteName(PubKeyToAddress(vchDefaultKey), "")
                          CRITICAL_BLOCK(cs_mapAddressBook)

Spotted by ArtForz.  Additional deadlock fixes by Gavin.

[1] http://www.bitcoin.org/smf/index.php?topic=4904.msg71897#msg71897
2011-04-04 22:24:35 -04:00
Gavin Andresen
b931ed8563 sendmany RPC command, to send to multiple recipients in one transaction. 2011-03-13 17:11:49 -04:00
Matt Corallo
c1f74f152b throw JSONRPCError(-5, "Invalid bitcoin address") instead. 2011-03-05 16:45:56 +01:00
Matt Corallo
279ab5e62f setaccount should return if an invalid address is provided.
This prevents setaccount from creating new accounts which do not have any addresses.
2011-03-05 15:32:32 +01:00
Gavin Andresen
789259d2e7 Do not round input amounts; allow RPC full precision. 2011-02-23 14:41:19 -05:00
Gavin Andresen
83b9f42796 Use ValueFromAmount consistently 2011-02-23 14:24:16 -05:00
tcatm
10e135af70 Merge branch 'master' of https://github.com/sandos/bitcoin into sandos-master 2011-02-23 01:07:43 +01:00
Gavin Andresen
47908a8907 Visual C++ compatibility fixes 2011-02-10 19:24:22 -05:00
sandos
8fd402bfcf Set SO_REUSEADDR for JSON-RPC port 2011-02-10 09:25:42 +01:00
Gavin Andresen
d9574c2f14 Reconcile getbalance and listaccounts 0 in the shared-wallet case
If you copied your wallet and used it on two different machines, the balance reported by getbalance and the sum(listaccounts) could disagree, because you might receive payments for an address that is in your wallet but not your address book.  Now all such transactions are credited to the default empty-string account.
2011-01-20 13:10:01 -05:00
Gavin Andresen
1d23c74361 ReacceptWalletTransactions bugfix
Fix two bugs that can happen if you copy your wallet to another machine
and perform transactions on both.

First, ReacceptWalletTransactions would notice if the other wallet spent coins, and
would correctly mark the receiving transaction spent.  However, it did not add the spending
transaction to the wallet.  Now it does.

Second, account balances could get out of sync with 'getbalance' because coins received
by the other copy of the wallet were not necessarily detected.  Now ReacceptWalletTransactions
will scan the entire blockchain for transactions that should be in the wallet if it runs
across a 'spent in the other wallet' transaction.

Finally, there was a small bug in the accounts getbalance code-- generated coins with between
100 and 119 confirmations were not being counted in the balance of account "".
2011-01-19 16:50:20 -05:00
Gavin Andresen
b4671902f2 Merge branch 'listaccountsbug' of https://github.com/gavinandresen/bitcoin-git into integration 2011-01-18 14:35:50 -05:00
Gavin Andresen
76e97c4002 Merge branch 'gettransaction' of https://github.com/gavinandresen/bitcoin-git into integration 2011-01-18 14:35:03 -05:00
Gavin Andresen
fa446a563e Fix setaccount/getaccountaddress interaction bug
See https://github.com/bitcoin/bitcoin/issues#issue/29
2011-01-13 20:04:56 -05:00
Gavin Andresen
2eb09b66ef Fix so listaccounts with minconf works. 2011-01-10 13:54:39 -05:00
Gavin Andresen
80be6e69a9 Add account/address details to gettransaction output 2011-01-07 14:10:08 -05:00
Gavin Andresen
f86655fddd Add time to category:move transactions. 2011-01-05 09:52:52 -05:00
Gavin Andresen
ddb68acebe Add address to listtransactions output 2010-12-21 13:39:10 -05:00
gavinandresen
1c0bf23ba2 Missed a int64_t cast when I added transaction time output
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@205 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-17 20:16:27 +00:00
gavinandresen
59948a6e1c listtransactions was reporting address instead of account for 'receive'
setgenerate true 0  is now the same as setgenerate false
And return transaction time



git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@204 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-16 18:17:26 +00:00
gavinandresen
809ee79592 New RPC command: listaccounts. New RPC setting -rpctimeout. And listtransactions '*'
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@203 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-16 01:06:03 +00:00
s_nakamoto
986b5e257e correction
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@200 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-12 18:38:02 +00:00
s_nakamoto
97ee01ad89 added some DoS limits, removed safe mode
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@199 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-12 18:20:36 +00:00
gavinandresen
bdde31d787 All boolean options/flags now work the same way.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@194 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-03 19:38:09 +00:00
gavinandresen
bfd471f53e JSON methods: listtransactions, gettransaction, move, sendfrom and getbalance <account>
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@193 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-30 18:58:11 +00:00
s_nakamoto
24324d83e8 -- version 0.3.17 release
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@191 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-25 20:41:57 +00:00
s_nakamoto
b7ccd48dd8 still working on account-based commands getbalance, move and sendfrom, they're only for testing for now
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@190 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-25 16:40:25 +00:00
s_nakamoto
776d0f3459 new getwork
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@189 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-23 19:16:36 +00:00
gavinandresen
e4ff4e6898 Depracate "label" API, replacing with account
New RPC methods: move, sendfrom
Change to getbalance (now takes optional [account] argument)
Renamed methods with "label" in their names.
sendtoaddress returns hexadecimal transaction ID instead of "sent".



git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@188 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-22 15:53:20 +00:00
gavinandresen
838e8c9166 Add paytxfee to getinfo output
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@178 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-10 16:43:31 +00:00
s_nakamoto
c891967b6f bugfixes from Dean Gores,
addr system changes,
make sure no gen before block 74000

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@173 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-23 17:43:53 +00:00
gavinandresen
c285051c08 testnet and keypoololdest added to RPC getinfo output. And RPC now sends proper HTTP Date headers.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@172 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-22 15:15:20 +00:00
gavinandresen
2ea5fa0710 validateaddress RPC command
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@169 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-20 15:58:16 +00:00
gavinandresen
ed54768f5f -rpcssl=1 option, allowing secure HTTPS JSON-RPC connections on OSX/Unix.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@165 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-11 18:23:41 +00:00
s_nakamoto
103849419a key pool for safer wallet backup
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@163 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-09 19:33:35 +00:00
s_nakamoto
efae3da41d config option -rpcallowip= to accept json-rpc connections from another machine
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@155 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-15 22:10:13 +00:00
s_nakamoto
d743f03552 Gavin Andresen: json-rpc return standard error objects with error code numbers,
json-rpc command line client return exit code,
added rpc backupwallet command

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@147 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-06 21:03:04 +00:00
s_nakamoto
0a61b0df12 propset svn:eol-style native
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@146 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-29 16:58:15 +00:00
s_nakamoto
2ef9cfa5b8 change switch name to -disablesafemode
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@144 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-25 16:33:38 +00:00
s_nakamoto
7d7797b141 more rpc methods allowed in safe mode
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@143 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-25 14:18:56 +00:00