rpchandler

This commit is contained in:
jed
2012-11-16 09:06:18 -08:00
parent 25552ece7c
commit d4ef06fd67

View File

@@ -766,7 +766,7 @@ Json::Value RPCHandler::handleJSONSubmit(const Json::Value& jvRequest)
else txJSON["Fee"]=(int)theConfig.FEE_ACCOUNT_CREATE;
}
if(!txJSON.isMember("Paths") && (!jvRequest.isMember("build_path") || jvRequest["build_path"].asBool()))
if(!txJSON.isMember("Paths") && jvRequest.isMember("build_path") )
{
if(txJSON["Amount"].isObject() || txJSON.isMember("SendMax") )
{ // we need a ripple path
@@ -798,11 +798,14 @@ Json::Value RPCHandler::handleJSONSubmit(const Json::Value& jvRequest)
Pathfinder pf(srcAddress, dstAccountID, srcCurrencyID, dstAmount);
pf.findPaths(5, 1, spsPaths);
if(!spsPaths.isEmpty())
{
txJSON["Paths"]=spsPaths.getJson(0);
if(txJSON.isMember("Flags")) txJSON["Flags"]=txJSON["Flags"].asUInt() | 2;
else txJSON["Flags"]=2;
}
}
}
}else if( txJSON["type"]=="OfferCreate" )
{