Some optimizations.

This commit is contained in:
JoelKatz
2013-02-20 09:33:09 -08:00
parent c375d2d96b
commit 7552f9eacf
3 changed files with 36 additions and 2 deletions

View File

@@ -899,6 +899,8 @@ Json::Value RPCHandler::doAccountLines(Json::Value jvRequest)
if (!lpLedger)
return jvResult;
ScopedUnlock su(theApp->getMasterLock(), lpLedger->isFixed());
if (!jvRequest.isMember("account"))
return rpcError(rpcINVALID_PARAMS);
@@ -926,6 +928,7 @@ Json::Value RPCHandler::doAccountLines(Json::Value jvRequest)
jvResult["account"] = raAccount.humanAccountID();
// XXX This is wrong, we do access the current ledger and do need to worry about changes.
// We access a committed ledger and need not worry about changes.
@@ -977,6 +980,8 @@ Json::Value RPCHandler::doAccountOffers(Json::Value jvRequest)
if (!lpLedger)
return jvResult;
ScopedUnlock su(theApp->getMasterLock(), lpLedger->isClosed() || lpLedger->isImmutable());
if (!jvRequest.isMember("account"))
return rpcError(rpcINVALID_PARAMS);