mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Fix access to obsolete reference in PathRequest (RIPD-1219):
* Don't access jvArray if newStatus is replaced * Remove iLastLevel and use just iLevel
This commit is contained in:
@@ -52,7 +52,7 @@ PathRequest::PathRequest (
|
|||||||
, jvStatus (Json::objectValue)
|
, jvStatus (Json::objectValue)
|
||||||
, mLastIndex (0)
|
, mLastIndex (0)
|
||||||
, mInProgress (false)
|
, mInProgress (false)
|
||||||
, iLastLevel (0)
|
, iLevel (0)
|
||||||
, bLastSuccess (false)
|
, bLastSuccess (false)
|
||||||
, iIdentifier (id)
|
, iIdentifier (id)
|
||||||
, created_ (std::chrono::steady_clock::now())
|
, created_ (std::chrono::steady_clock::now())
|
||||||
@@ -76,7 +76,7 @@ PathRequest::PathRequest (
|
|||||||
, jvStatus (Json::objectValue)
|
, jvStatus (Json::objectValue)
|
||||||
, mLastIndex (0)
|
, mLastIndex (0)
|
||||||
, mInProgress (false)
|
, mInProgress (false)
|
||||||
, iLastLevel (0)
|
, iLevel (0)
|
||||||
, bLastSuccess (false)
|
, bLastSuccess (false)
|
||||||
, iIdentifier (id)
|
, iIdentifier (id)
|
||||||
, created_ (std::chrono::steady_clock::now())
|
, created_ (std::chrono::steady_clock::now())
|
||||||
@@ -651,7 +651,6 @@ Json::Value PathRequest::doUpdate(
|
|||||||
if (jvId)
|
if (jvId)
|
||||||
newStatus["id"] = jvId;
|
newStatus["id"] = jvId;
|
||||||
|
|
||||||
int iLevel = iLastLevel;
|
|
||||||
bool loaded = app_.getFeeTrack().isLoadedLocal();
|
bool loaded = app_.getFeeTrack().isLoadedLocal();
|
||||||
|
|
||||||
if (iLevel == 0)
|
if (iLevel == 0)
|
||||||
@@ -688,12 +687,17 @@ Json::Value PathRequest::doUpdate(
|
|||||||
JLOG(m_journal.debug()) << iIdentifier
|
JLOG(m_journal.debug()) << iIdentifier
|
||||||
<< " processing at level " << iLevel;
|
<< " processing at level " << iLevel;
|
||||||
|
|
||||||
Json::Value& jvArray = (newStatus[jss::alternatives] = Json::arrayValue);
|
Json::Value jvArray = Json::arrayValue;
|
||||||
if (! findPaths(cache, iLevel, jvArray))
|
if (findPaths(cache, iLevel, jvArray))
|
||||||
|
{
|
||||||
|
bLastSuccess = jvArray.size() != 0;
|
||||||
|
newStatus[jss::alternatives] = std::move (jvArray);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bLastSuccess = false;
|
||||||
newStatus = rpcError(rpcINTERNAL);
|
newStatus = rpcError(rpcINTERNAL);
|
||||||
|
}
|
||||||
bLastSuccess = jvArray.size();
|
|
||||||
iLastLevel = iLevel;
|
|
||||||
|
|
||||||
if (fast && quick_reply_ == steady_clock::time_point{})
|
if (fast && quick_reply_ == steady_clock::time_point{})
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ private:
|
|||||||
LedgerIndex mLastIndex;
|
LedgerIndex mLastIndex;
|
||||||
bool mInProgress;
|
bool mInProgress;
|
||||||
|
|
||||||
int iLastLevel;
|
int iLevel;
|
||||||
bool bLastSuccess;
|
bool bLastSuccess;
|
||||||
|
|
||||||
int iIdentifier;
|
int iIdentifier;
|
||||||
|
|||||||
Reference in New Issue
Block a user