add simple log rotating, tentative Ripple pathfinder work

This commit is contained in:
MJK
2012-09-27 13:49:37 -07:00
parent 5a49b696ad
commit 1ffe841be5
7 changed files with 79 additions and 2 deletions

View File

@@ -14,6 +14,11 @@
#include "Log.h"
#include "RippleLines.h"
#include "Pathfinder.h"
#include "Conversion.h"
extern uint160 humanTo160(const std::string& buf);
#include <iostream>
#include <boost/bind.hpp>
@@ -1795,6 +1800,16 @@ Json::Value RPCServer::doSend(const Json::Value& params)
STPathSet spsPaths;
uint160 srcCurrencyID;
bool ret_b;
ret_b = false;
STAmount::currencyFromString(srcCurrencyID, sSrcCurrency);
Pathfinder pf(naSrcAccountID, naDstAccountID, srcCurrencyID, saDstAmount);
ret_b = pf.findPaths(5, 1, spsPaths);
// TODO: Nope; the above can't be right
trans = Transaction::sharedPayment(
naAccountPublic, naAccountPrivate,
naSrcAccountID,
@@ -2518,6 +2533,11 @@ Json::Value RPCServer::doLogin(const Json::Value& params)
}
}
Json::Value RPCServer::doLogRotate(const Json::Value& params)
{
return Log::rotateLog();
}
Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params)
{
Log(lsTRACE) << "RPC:" << command;
@@ -2543,6 +2563,7 @@ Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params
{ "data_fetch", &RPCServer::doDataFetch, 1, 1, true },
{ "data_store", &RPCServer::doDataStore, 2, 2, true },
{ "ledger", &RPCServer::doLedger, 0, 2, false, optNetwork },
{ "logrotate", &RPCServer::doLogRotate, 0, 0, true, optCurrent },
{ "nickname_info", &RPCServer::doNicknameInfo, 1, 1, false, optCurrent },
{ "nickname_set", &RPCServer::doNicknameSet, 2, 3, false, optCurrent },
{ "offer_create", &RPCServer::doOfferCreate, 9, 10, false, optCurrent },