From 94fd6a593fa948388ac413b649d804ac2230c374 Mon Sep 17 00:00:00 2001 From: jed Date: Fri, 2 Nov 2012 07:26:28 -0700 Subject: [PATCH] . --- src/Config.cpp | 2 ++ src/NetworkOPs.cpp | 10 +++++----- src/RPCDoor.cpp | 4 ++++ src/RPCDoor.h | 1 + src/RPCHandler.cpp | 12 ++++++++++++ 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Config.cpp b/src/Config.cpp index 2faed71d3..91e7c2b07 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -165,6 +165,8 @@ void Config::setup(const std::string& strConf) void Config::load() { + std::cout << "Loading: " << CONFIG_FILE << std::endl; + std::ifstream ifsConfig(CONFIG_FILE.c_str(), std::ios::in); if (!ifsConfig) diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 7bb4c6705..91b90cfa2 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -1005,7 +1005,7 @@ void NetworkOPs::pubLedger(Ledger::ref lpAccepted) { boost::interprocess::sharable_lock sl(mMonitorLock); - bool bAll = !mSubTransaction.empty(); + bool bAll = !mSubTransactions.empty(); bool bAccounts = !mSubAccountTransaction.empty(); if (bAll || bAccounts) @@ -1081,7 +1081,7 @@ void NetworkOPs::pubTransactionAll(Ledger::ref lpCurrent, const SerializedTransa { Json::Value jvObj = transJson(stTxn, terResult, bAccepted, lpCurrent, "transaction"); - BOOST_FOREACH(InfoSub* ispListener, mSubTransaction) + BOOST_FOREACH(InfoSub* ispListener, mSubTransactions) { ispListener->send(jvObj); } @@ -1126,7 +1126,7 @@ void NetworkOPs::pubTransaction(Ledger::ref lpCurrent, const SerializedTransacti { boost::interprocess::sharable_lock sl(mMonitorLock); - if (!mSubTransaction.empty()) + if (!mSubTransactions.empty()) { pubTransactionAll(lpCurrent, stTxn, terResult, false); } @@ -1318,13 +1318,13 @@ bool NetworkOPs::unsubLedgerAccounts(InfoSub* ispListener) // <-- bool: true=added, false=already there bool NetworkOPs::subTransaction(InfoSub* ispListener) { - return mSubTransaction.insert(ispListener).second; + return mSubTransactions.insert(ispListener).second; } // <-- bool: true=erased, false=was not there bool NetworkOPs::unsubTransaction(InfoSub* ispListener) { - return !!mSubTransaction.erase(ispListener); + return !!mSubTransactions.erase(ispListener); } // vim:ts=4 diff --git a/src/RPCDoor.cpp b/src/RPCDoor.cpp index 5fb00a3ff..9d98a2462 100644 --- a/src/RPCDoor.cpp +++ b/src/RPCDoor.cpp @@ -14,6 +14,10 @@ RPCDoor::RPCDoor(boost::asio::io_service& io_service) : Log(lsINFO) << "RPC port: " << theConfig.RPC_IP << " " << theConfig.RPC_PORT << " allow remote: " << theConfig.RPC_ALLOW_REMOTE; startListening(); } +RPCDoor::~RPCDoor() +{ + Log(lsINFO) << "RPC port: " << theConfig.RPC_IP << " " << theConfig.RPC_PORT << " allow remote: " << theConfig.RPC_ALLOW_REMOTE; +} void RPCDoor::startListening() { diff --git a/src/RPCDoor.h b/src/RPCDoor.h index f91f86485..ab60539c6 100644 --- a/src/RPCDoor.h +++ b/src/RPCDoor.h @@ -15,4 +15,5 @@ class RPCDoor bool isClientAllowed(const std::string& ip); public: RPCDoor(boost::asio::io_service& io_service); + ~RPCDoor(); }; diff --git a/src/RPCHandler.cpp b/src/RPCHandler.cpp index 36fcfdffd..ad93e351f 100644 --- a/src/RPCHandler.cpp +++ b/src/RPCHandler.cpp @@ -1675,8 +1675,19 @@ Json::Value RPCHandler::doRippleLinesGet(const Json::Value ¶ms) } // submit any transaction to the network +// submit private_key json Json::Value RPCHandler::doSubmit(const Json::Value& params) { + RippleAddress naSeed; + std::string txJSON= params[1u].asString(); + + if (!naSeed.setSeedGeneric(params[0u].asString())) + { + return rpcError(rpcBAD_SEED); + } + + + // TODO return rpcError(rpcSRC_ACT_MALFORMED); } @@ -2451,6 +2462,7 @@ Json::Value RPCHandler::doCommand(const std::string& command, Json::Value& param { "ripple_lines_get", &RPCHandler::doRippleLinesGet, 1, 2, false, optCurrent }, { "ripple_line_set", &RPCHandler::doRippleLineSet, 4, 7, false, optCurrent }, { "send", &RPCHandler::doSend, 3, 9, false, optCurrent }, + { "submit", &RPCHandler::doSubmit, 2, 2, false, optCurrent }, { "server_info", &RPCHandler::doServerInfo, 0, 0, true }, { "stop", &RPCHandler::doStop, 0, 0, true }, { "tx", &RPCHandler::doTx, 1, 1, true },