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
This commit is contained in:
gavinandresen 2010-12-16 18:17:26 +00:00
parent 809ee79592
commit 59948a6e1c

View file

@ -80,6 +80,7 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry)
{ {
entry.push_back(Pair("confirmations", wtx.GetDepthInMainChain())); entry.push_back(Pair("confirmations", wtx.GetDepthInMainChain()));
entry.push_back(Pair("txid", wtx.GetHash().GetHex())); entry.push_back(Pair("txid", wtx.GetHash().GetHex()));
entry.push_back(Pair("time", wtx.GetTxTime()));
foreach(const PAIRTYPE(string,string)& item, wtx.mapValue) foreach(const PAIRTYPE(string,string)& item, wtx.mapValue)
entry.push_back(Pair(item.first, item.second)); entry.push_back(Pair(item.first, item.second));
} }
@ -245,6 +246,8 @@ Value setgenerate(const Array& params, bool fHelp)
CWalletDB().WriteSetting("fLimitProcessors", fLimitProcessors); CWalletDB().WriteSetting("fLimitProcessors", fLimitProcessors);
if (nGenProcLimit != -1) if (nGenProcLimit != -1)
CWalletDB().WriteSetting("nLimitProcessors", nLimitProcessors = nGenProcLimit); CWalletDB().WriteSetting("nLimitProcessors", nLimitProcessors = nGenProcLimit);
if (nGenProcLimit == 0)
fGenerate = false;
} }
GenerateBitcoins(fGenerate); GenerateBitcoins(fGenerate);
@ -891,10 +894,10 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
CRITICAL_BLOCK(cs_mapAddressBook) CRITICAL_BLOCK(cs_mapAddressBook)
{ {
foreach(const PAIRTYPE(string, int64)& r, listReceived) foreach(const PAIRTYPE(string, int64)& r, listReceived)
if (mapAddressBook.count(r.first) && (fAllAccounts || r.first == strAccount)) if (mapAddressBook.count(r.first) && (fAllAccounts || mapAddressBook[r.first] == strAccount))
{ {
Object entry; Object entry;
entry.push_back(Pair("account", r.first)); entry.push_back(Pair("account", mapAddressBook[r.first]));
entry.push_back(Pair("category", "receive")); entry.push_back(Pair("category", "receive"));
entry.push_back(Pair("amount", ValueFromAmount(r.second))); entry.push_back(Pair("amount", ValueFromAmount(r.second)));
WalletTxToJSON(wtx, entry); WalletTxToJSON(wtx, entry);