diff --git a/src/RPCHandler.cpp b/src/RPCHandler.cpp index fe98e650cd..3aafeb7e86 100644 --- a/src/RPCHandler.cpp +++ b/src/RPCHandler.cpp @@ -1,7 +1,7 @@ +#include "Log.h" #include "NetworkOPs.h" #include "RPCHandler.h" #include "Application.h" -#include "Log.h" #include "RippleLines.h" #include "Wallet.h" #include "RippleAddress.h" @@ -694,14 +694,14 @@ Json::Value RPCHandler::doSubmit(const Json::Value& params) Json::Reader reader; if(reader.parse(params[1u].asString(),txJSON)) { - return handleJSONSubmit(params[0u].asString(), txJSON ); + return handleJSONSubmit(params[0u].asString(), txJSON); } return rpcError(rpcSRC_ACT_MALFORMED); } -Json::Value RPCHandler::handleJSONSubmit(std::string& key, Json::Value& txJSON) +Json::Value RPCHandler::handleJSONSubmit(const std::string& key, Json::Value& txJSON) { Json::Value jvResult; RippleAddress naSeed; @@ -723,7 +723,7 @@ Json::Value RPCHandler::handleJSONSubmit(std::string& key, Json::Value& txJSON) AccountState::pointer asSrc = mNetOps->getAccountState(uint256(0), srcAddress); if( txJSON["type"]=="Payment") - { + { txJSON["TransactionType"]=0; RippleAddress dstAccountID; @@ -731,7 +731,7 @@ Json::Value RPCHandler::handleJSONSubmit(std::string& key, Json::Value& txJSON) { return rpcError(rpcDST_ACT_MALFORMED); } - + if(!txJSON.isMember("Fee")) { if(mNetOps->getAccountState(uint256(0), dstAccountID)) @@ -750,7 +750,7 @@ Json::Value RPCHandler::handleJSONSubmit(std::string& key, Json::Value& txJSON) }else STAmount::currencyFromString(srcCurrencyID, txJSON["SendMax"]["currency"].asString()); STAmount dstAmount; - if(txJSON["Amount"].isObject()) + if(txJSON["Amount"].isObject()) { std::string issuerStr; if( txJSON["Amount"].isMember("issuer")) issuerStr=txJSON["Amount"]["issuer"].asString(); @@ -771,7 +771,7 @@ Json::Value RPCHandler::handleJSONSubmit(std::string& key, Json::Value& txJSON) else txJSON["Flags"]=2; } } - + }else if( txJSON["type"]=="OfferCreate" ) { txJSON["TransactionType"]=7; @@ -789,11 +789,11 @@ Json::Value RPCHandler::handleJSONSubmit(std::string& key, Json::Value& txJSON) txJSON.removeMember("type"); if(!txJSON.isMember("Sequence")) txJSON["Sequence"]=asSrc->getSeq(); - if(!txJSON.isMember("Flags")) txJSON["Flags"]=0; - + if(!txJSON.isMember("Flags")) txJSON["Flags"]=0; + Ledger::pointer lpCurrent = mNetOps->getCurrentLedger(); SLE::pointer sleAccountRoot = mNetOps->getSLE(lpCurrent, Ledger::getAccountRootIndex(srcAddress.getAccountID())); - + if (!sleAccountRoot) { // XXX Ignore transactions for accounts not created. @@ -1907,7 +1907,7 @@ Json::Value RPCHandler::doLedgerEntry(const Json::Value& params) jvResult["index"] = uNodeIndex.ToString(); } } - + return jvResult; } diff --git a/src/RPCHandler.h b/src/RPCHandler.h index 6dc6275467..e23eb103f5 100644 --- a/src/RPCHandler.h +++ b/src/RPCHandler.h @@ -154,8 +154,9 @@ public: Json::Value doCommand(const std::string& command, Json::Value& params,int role); Json::Value rpcError(int iError); - Json::Value handleJSONSubmit(std::string& key, Json::Value& txJSON); + Json::Value handleJSONSubmit(const std::string& key, Json::Value& txJSON); }; #endif +// vim:ts=4 diff --git a/src/WSConnection.cpp b/src/WSConnection.cpp index 8e8328784a..1a03819adc 100644 --- a/src/WSConnection.cpp +++ b/src/WSConnection.cpp @@ -1,13 +1,16 @@ +// +// WSConnection +// + +#include "Log.h" + +SETUP_LOG(); + #include "WSConnection.h" #include "WSHandler.h" #include "../json/reader.h" #include "../json/writer.h" -// -// WSConnection -// - -SETUP_LOG(); WSConnection::~WSConnection() { diff --git a/src/WSDoor.cpp b/src/WSDoor.cpp index 9629841590..58c8f68dde 100644 --- a/src/WSDoor.cpp +++ b/src/WSDoor.cpp @@ -1,14 +1,17 @@ -#include "WSDoor.h" +#include "Log.h" +SETUP_LOG(); #include "Application.h" #include "Config.h" -#include "Log.h" #include "NetworkOPs.h" #include "utils.h" #include "WSConnection.h" #include "WSHandler.h" + +#include "WSDoor.h" + #include #include @@ -17,8 +20,6 @@ #include -SETUP_LOG(); - // // This is a light weight, untrusted interface for web clients. // For now we don't provide proof. Later we will.