mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Extra debug, bugfixes.
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "json/value.h"
|
#include "json/value.h"
|
||||||
#include "json/reader.h"
|
#include "json/reader.h"
|
||||||
|
#include "json/writer.h"
|
||||||
|
|
||||||
#include "RPCServer.h"
|
#include "RPCServer.h"
|
||||||
#include "RequestParser.h"
|
#include "RequestParser.h"
|
||||||
@@ -99,7 +100,17 @@ std::string RPCServer::handleRequest(const std::string& requestStr)
|
|||||||
else if(!valParams.isArray())
|
else if(!valParams.isArray())
|
||||||
return(HTTPReply(400, ""));
|
return(HTTPReply(400, ""));
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
Json::StyledStreamWriter w;
|
||||||
|
w.write(std::cerr, valParams);
|
||||||
|
#endif
|
||||||
|
|
||||||
Json::Value result=doCommand(strMethod, valParams);
|
Json::Value result=doCommand(strMethod, valParams);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
w.write(std::cerr, result);
|
||||||
|
#endif
|
||||||
|
|
||||||
std::string strReply = JSONRPCReply(result, Json::Value(), id);
|
std::string strReply = JSONRPCReply(result, Json::Value(), id);
|
||||||
return( HTTPReply(200, strReply) );
|
return( HTTPReply(200, strReply) );
|
||||||
}
|
}
|
||||||
@@ -114,26 +125,35 @@ Json::Value RPCServer::doCreateFamily(Json::Value& params)
|
|||||||
std::string query;
|
std::string query;
|
||||||
uint160 family;
|
uint160 family;
|
||||||
|
|
||||||
|
if(params.isArray()) params=params[0u];
|
||||||
if(params.isConvertibleTo(Json::stringValue)) query=params.asString();
|
if(params.isConvertibleTo(Json::stringValue)) query=params.asString();
|
||||||
|
|
||||||
Json::Value ret(Json::objectValue);
|
Json::Value ret(Json::objectValue);
|
||||||
|
|
||||||
if(query.empty())
|
if(query.empty())
|
||||||
{
|
{
|
||||||
|
std::cerr << "empty" << std::endl;
|
||||||
uint256 privKey;
|
uint256 privKey;
|
||||||
family=theApp->getWallet().addFamily(privKey);
|
family=theApp->getWallet().addFamily(privKey);
|
||||||
ret["PrivateGenerator"]=privKey.GetHex();
|
ret["PrivateGenerator"]=privKey.GetHex();
|
||||||
}
|
}
|
||||||
else if(LocalAccountFamily::isHexPrivateKey(query))
|
else if(LocalAccountFamily::isHexPrivateKey(query))
|
||||||
{
|
{
|
||||||
|
std::cerr << "hprivk" << std::endl;
|
||||||
uint256 pk;
|
uint256 pk;
|
||||||
pk.SetHex(query);
|
pk.SetHex(query);
|
||||||
family=theApp->getWallet().addFamily(pk, false);
|
family=theApp->getWallet().addFamily(pk, false);
|
||||||
}
|
}
|
||||||
else if(LocalAccountFamily::isHexPublicKey(query))
|
else if(LocalAccountFamily::isHexPublicKey(query))
|
||||||
|
{
|
||||||
|
std::cerr << "hpubk" << std::endl;
|
||||||
family=theApp->getWallet().addFamily(query);
|
family=theApp->getWallet().addFamily(query);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
std::cerr << "PassPhrase(" << query << ")" << std::endl;
|
||||||
family=theApp->getWallet().addFamily(query, false);
|
family=theApp->getWallet().addFamily(query, false);
|
||||||
|
}
|
||||||
if(!family)
|
if(!family)
|
||||||
JSONRPCError(500, "Invalid family specifier");
|
JSONRPCError(500, "Invalid family specifier");
|
||||||
|
|
||||||
@@ -145,6 +165,7 @@ Json::Value RPCServer::doCreateFamily(Json::Value& params)
|
|||||||
|
|
||||||
Json::Value RPCServer::doGetAccount(Json::Value ¶ms)
|
Json::Value RPCServer::doGetAccount(Json::Value ¶ms)
|
||||||
{ // getaccount <family> <number>
|
{ // getaccount <family> <number>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value RPCServer::doGetNewAccount(Json::Value ¶ms)
|
Json::Value RPCServer::doGetNewAccount(Json::Value ¶ms)
|
||||||
|
|||||||
Reference in New Issue
Block a user