mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-30 07:25:50 +00:00
WS: Fix ledger_entry for ripple_state.
This commit is contained in:
@@ -750,18 +750,27 @@ void WSConnection::doLedgerEntry(Json::Value& jvResult, const Json::Value& jvReq
|
||||
NewcoinAddress naA;
|
||||
NewcoinAddress naB;
|
||||
uint160 uCurrency;
|
||||
Json::Value jvRippleState = jvRequest["ripple_state"];
|
||||
|
||||
if (!jvRippleState.isMember("accounts")
|
||||
|| !jvRippleState.isMember("currency")
|
||||
|| !jvRippleState["accounts"].isArray()
|
||||
|| 2 != jvRippleState["accounts"].size()) {
|
||||
|
||||
cLog(lsINFO)
|
||||
<< boost::str(boost::format("ledger_entry: ripple_state: accounts: %d currency: %d array=%d, size=%d")
|
||||
% jvRippleState.isMember("accounts")
|
||||
% jvRippleState.isMember("currency")
|
||||
% jvRippleState["accounts"].isArray()
|
||||
% jvRippleState["accounts"].size());
|
||||
|
||||
if (!jvRequest.isMember("accounts")
|
||||
|| !jvRequest.isMember("currency")
|
||||
|| !jvRequest["accounts"].isArray()
|
||||
|| 2 != jvRequest["accounts"].size()) {
|
||||
jvResult["error"] = "malformedRequest";
|
||||
}
|
||||
else if (!naA.setAccountID(jvRequest["accounts"][0u].asString())
|
||||
|| !naB.setAccountID(jvRequest["accounts"][1u].asString())) {
|
||||
else if (!naA.setAccountID(jvRippleState["accounts"][0u].asString())
|
||||
|| !naB.setAccountID(jvRippleState["accounts"][1u].asString())) {
|
||||
jvResult["error"] = "malformedAddress";
|
||||
}
|
||||
else if (!STAmount::currencyFromString(uCurrency, jvRequest["currency"].asString())) {
|
||||
else if (!STAmount::currencyFromString(uCurrency, jvRippleState["currency"].asString())) {
|
||||
jvResult["error"] = "malformedCurrency";
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user