This commit is contained in:
jed
2012-11-02 07:26:28 -07:00
parent 41486024d9
commit 94fd6a593f
5 changed files with 24 additions and 5 deletions

View File

@@ -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)

View File

@@ -1005,7 +1005,7 @@ void NetworkOPs::pubLedger(Ledger::ref lpAccepted)
{
boost::interprocess::sharable_lock<boost::interprocess::interprocess_upgradable_mutex> 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<boost::interprocess::interprocess_upgradable_mutex> 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

View File

@@ -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()
{

View File

@@ -15,4 +15,5 @@ class RPCDoor
bool isClientAllowed(const std::string& ip);
public:
RPCDoor(boost::asio::io_service& io_service);
~RPCDoor();
};

View File

@@ -1675,8 +1675,19 @@ Json::Value RPCHandler::doRippleLinesGet(const Json::Value &params)
}
// 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 },