aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-10-22 15:34:11 +1000
committerGavin Andresen <[email protected]>2013-10-22 15:34:11 +1000
commit10dc3c74737eea1f2de694c6582caf3027926034 (patch)
treebe426b48391051c2327577091b95ac6126218871 /src/rpcwallet.cpp
parentMerge pull request #2929 from Krellan/addrlocal (diff)
parentBugfix: Supress "address" key in transaction details, when the destination is... (diff)
downloaddiscoin-10dc3c74737eea1f2de694c6582caf3027926034.tar.xz
discoin-10dc3c74737eea1f2de694c6582caf3027926034.zip
Merge branch 'bugfix_unknownoutputs' of git://github.com/luke-jr/bitcoin
Conflicts: src/wallet.cpp Fixed LogPrint/printf merge conflict.
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r--src/rpcwallet.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index a72c254e7..7aae9ddb7 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -968,6 +968,13 @@ Value listreceivedbyaccount(const Array& params, bool fHelp)
return ListReceived(params, true);
}
+static void MaybePushAddress(Object & entry, const CTxDestination &dest)
+{
+ CBitcoinAddress addr;
+ if (addr.Set(dest))
+ entry.push_back(Pair("address", addr.ToString()));
+}
+
void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret)
{
int64 nFee;
@@ -986,7 +993,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
{
Object entry;
entry.push_back(Pair("account", strSentAccount));
- entry.push_back(Pair("address", CBitcoinAddress(s.first).ToString()));
+ MaybePushAddress(entry, s.first);
entry.push_back(Pair("category", "send"));
entry.push_back(Pair("amount", ValueFromAmount(-s.second)));
entry.push_back(Pair("fee", ValueFromAmount(-nFee)));
@@ -1008,7 +1015,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
{
Object entry;
entry.push_back(Pair("account", account));
- entry.push_back(Pair("address", CBitcoinAddress(r.first).ToString()));
+ MaybePushAddress(entry, r.first);
if (wtx.IsCoinBase())
{
if (wtx.GetDepthInMainChain() < 1)