mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Be more strict with payment build_path flag.
This commit is contained in:
@@ -913,6 +913,12 @@ Json::Value RPCHandler::doSubmit(Json::Value jvRequest)
|
|||||||
txJSON["Fee"] = (int) theConfig.FEE_ACCOUNT_CREATE;
|
txJSON["Fee"] = (int) theConfig.FEE_ACCOUNT_CREATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (txJSON.isMember("Paths") && jvRequest.isMember("build_path"))
|
||||||
|
{
|
||||||
|
// Asking to build a path when providing one is an error.
|
||||||
|
return rpcError(rpcINVALID_PARAMS);
|
||||||
|
}
|
||||||
|
|
||||||
if (!txJSON.isMember("Paths") && txJSON.isMember("Amount") && jvRequest.isMember("build_path"))
|
if (!txJSON.isMember("Paths") && txJSON.isMember("Amount") && jvRequest.isMember("build_path"))
|
||||||
{
|
{
|
||||||
// Need a ripple path.
|
// Need a ripple path.
|
||||||
@@ -939,6 +945,12 @@ Json::Value RPCHandler::doSubmit(Json::Value jvRequest)
|
|||||||
saSendMax.setIssuer(raSrcAddressID.getAccountID());
|
saSendMax.setIssuer(raSrcAddressID.getAccountID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (saSendMax.isNative() && saSend.isNative())
|
||||||
|
{
|
||||||
|
// Asking to build a path for XRP to XRP is an error.
|
||||||
|
return rpcError(rpcINVALID_PARAMS);
|
||||||
|
}
|
||||||
|
|
||||||
Pathfinder pf(raSrcAddressID, dstAccountID, saSendMax.getCurrency(), saSendMax.getIssuer(), saSend);
|
Pathfinder pf(raSrcAddressID, dstAccountID, saSendMax.getCurrency(), saSendMax.getIssuer(), saSend);
|
||||||
|
|
||||||
if (!pf.findPaths(5, 1, spsPaths))
|
if (!pf.findPaths(5, 1, spsPaths))
|
||||||
|
|||||||
Reference in New Issue
Block a user