mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Infrastructure for "tx" RPC command to track transactions.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "json/writer.h"
|
||||
|
||||
#include "LocalTransaction.h"
|
||||
@@ -36,3 +38,19 @@ void LocalTransaction::performTransaction()
|
||||
{
|
||||
mTransaction=theApp->getOPs().processTransaction(mTransaction);
|
||||
}
|
||||
|
||||
Json::Value LocalTransaction::getJson() const
|
||||
{
|
||||
if(!mTransaction)
|
||||
{ // has no corresponding transaction
|
||||
Json::Value ret(Json::objectValue);
|
||||
ret["Status"]="unfunded";
|
||||
ret["Amount"]=boost::lexical_cast<std::string>(mAmount);
|
||||
Json::Value destination(Json::objectValue);
|
||||
destination["AccountID"]=NewcoinAddress(mDestAcctID).GetString();
|
||||
ret["Destination"]=destination;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return mTransaction->getJson(true, isPaid(), isCredited());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user