diff --git a/src/Config.cpp b/src/Config.cpp index 2faed71d30..91e7c2b079 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 ce52fde7b3..92ab2f7c5f 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -993,7 +993,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) @@ -1069,7 +1069,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); } @@ -1114,7 +1114,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); } @@ -1306,13 +1306,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/NetworkOPs.h b/src/NetworkOPs.h index cd5243b262..30d526edde 100644 --- a/src/NetworkOPs.h +++ b/src/NetworkOPs.h @@ -72,14 +72,17 @@ protected: // XXX Split into more locks. boost::interprocess::interprocess_upgradable_mutex mMonitorLock; - subInfoMapType mBootAccountInfo; - subInfoMapType mSubAccountInfo; - subInfoMapType mSubAccountTransaction; - boost::unordered_set mSubLedger; // ledger accepteds - boost::unordered_set mSubLedgerAccounts; // ledger accepteds + affected accounts - boost::unordered_set mSubTransaction; // all transactions - boost::unordered_set mSubTxMeta; // all transaction meta -// subInfoMapType mSubTransactionAccounts; + subInfoMapType mSubAccount; + subInfoMapType mSubRTAccount; + + boost::unordered_set mSubLedger; // accepted ledgers + boost::unordered_set mSubLedgerAccounts; // accepted ledgers + affected accounts + boost::unordered_set mSubTransactions; // all accepted transactions + boost::unordered_set mSubRTTransactions; // all proposed and accepted transactions + + subInfoMapType mSubAccountTransaction; // DEPRECATED + subInfoMapType mBootAccountInfo; // DEPRECATED + subInfoMapType mSubAccountInfo; // DEPRECATED void setMode(OperatingMode); diff --git a/src/RPCDoor.cpp b/src/RPCDoor.cpp index 5fb00a3ffc..9d98a24624 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 f91f864855..ab60539c67 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 a609e3567a..6bff3a15cb 100644 --- a/src/RPCHandler.cpp +++ b/src/RPCHandler.cpp @@ -1609,8 +1609,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); } @@ -2384,6 +2395,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 }, diff --git a/src/WSDoor.cpp b/src/WSDoor.cpp index 5d52859fbe..9d5304a5de 100644 --- a/src/WSDoor.cpp +++ b/src/WSDoor.cpp @@ -416,6 +416,8 @@ server : Sends a message anytime the server status changes such as network conne ledger : Sends a message at every ledger close. transactions : Sends a message for every transaction that makes it into a ledger. rt_transactions +accounts +rt_accounts */ // TODO void WSConnection::doSubscribe(Json::Value& jvResult, const Json::Value& jvRequest)