From 0f9ed76ec758315a2cc48ef61bd971474c732bd6 Mon Sep 17 00:00:00 2001 From: jed Date: Tue, 30 Oct 2012 06:58:40 -0700 Subject: [PATCH 1/3] windows --- newcoin.vcxproj | 3 ++- newcoin.vcxproj.filters | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/newcoin.vcxproj b/newcoin.vcxproj index 273a5a4197..0723eb9072 100644 --- a/newcoin.vcxproj +++ b/newcoin.vcxproj @@ -123,7 +123,6 @@ - @@ -135,7 +134,9 @@ + + diff --git a/newcoin.vcxproj.filters b/newcoin.vcxproj.filters index a404ec7bab..8aa2cf9ad0 100644 --- a/newcoin.vcxproj.filters +++ b/newcoin.vcxproj.filters @@ -99,9 +99,6 @@ Source Files - - Source Files - Source Files @@ -306,6 +303,12 @@ Source Files + + Source Files + + + Source Files + From 95fe63e7a3aca7a58566320e8960e236a209a0dc Mon Sep 17 00:00:00 2001 From: jed Date: Thu, 1 Nov 2012 00:57:32 -0700 Subject: [PATCH 2/3] api --- src/NetworkOPs.h | 19 +++++++++++-------- src/WSDoor.cpp | 2 ++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/NetworkOPs.h b/src/NetworkOPs.h index 5c54c3a167..2ee0524780 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/WSDoor.cpp b/src/WSDoor.cpp index 91b17e8aaf..b054229b9a 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) From 94fd6a593fa948388ac413b649d804ac2230c374 Mon Sep 17 00:00:00 2001 From: jed Date: Fri, 2 Nov 2012 07:26:28 -0700 Subject: [PATCH 3/3] . --- 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 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 7bb4c67057..91b90cfa2d 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 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 36fcfdffd3..ad93e351f2 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 },