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; 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") ) if(txJSON["Amount"].isObject() || txJSON.isMember("SendMax") )
{ // we need a ripple path { // we need a ripple path
@@ -798,9 +798,12 @@ Json::Value RPCHandler::handleJSONSubmit(const Json::Value& jvRequest)
Pathfinder pf(srcAddress, dstAccountID, srcCurrencyID, dstAmount); Pathfinder pf(srcAddress, dstAccountID, srcCurrencyID, dstAmount);
pf.findPaths(5, 1, spsPaths); pf.findPaths(5, 1, spsPaths);
txJSON["Paths"]=spsPaths.getJson(0); if(!spsPaths.isEmpty())
if(txJSON.isMember("Flags")) txJSON["Flags"]=txJSON["Flags"].asUInt() | 2; {
else txJSON["Flags"]=2; txJSON["Paths"]=spsPaths.getJson(0);
if(txJSON.isMember("Flags")) txJSON["Flags"]=txJSON["Flags"].asUInt() | 2;
else txJSON["Flags"]=2;
}
} }
} }