From 7fc13e35288eab9ad20a989a0f74ee6214bc1125 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 11 Oct 2012 20:07:41 -0700 Subject: [PATCH] Clean up getJson() for STAmount. --- src/Amount.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Amount.cpp b/src/Amount.cpp index 78cde08d5f..672d67505f 100644 --- a/src/Amount.cpp +++ b/src/Amount.cpp @@ -1131,15 +1131,13 @@ Json::Value STAmount::getJson(int) const { Json::Value elem(Json::objectValue); - // This is a hack, many places don't specify a currency. STAmount is used just as a value. if (!mIsNative) { + // It is an error for currency or issuer not to be specified for valid json. + elem["value"] = getText(); elem["currency"] = getHumanCurrency(); - - if (!mIssuer.isZero()) - elem["issuer"] = NewcoinAddress::createHumanAccountID(mIssuer); - + elem["issuer"] = NewcoinAddress::createHumanAccountID(mIssuer); } else {