From 3768b3c3cab151b9475720ab3ebbff836ec89a01 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 18 Dec 2013 22:56:18 -0800 Subject: [PATCH] Fix a pathfinding bug --- src/ripple_app/paths/Pathfinder.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ripple_app/paths/Pathfinder.cpp b/src/ripple_app/paths/Pathfinder.cpp index ceec08152..80b277a70 100644 --- a/src/ripple_app/paths/Pathfinder.cpp +++ b/src/ripple_app/paths/Pathfinder.cpp @@ -112,9 +112,6 @@ Pathfinder::Pathfinder (RippleLineCache::ref cache, bValid = true; - // FIXME: This is not right - getApp().getOrderBookDB ().setup (mLedger); - m_loadEvent = getApp().getJobQueue ().getLoadEvent (jtPATH_FIND, "FindPath"); bool bIssuer = mSrcCurrencyID.isNonZero() && mSrcIssuerID.isNonZero() && (mSrcIssuerID != mSrcAccountID); @@ -466,7 +463,14 @@ int Pathfinder::getPathsOut (RippleCurrency const& currencyID, const uint160& ac if (it != mPOMap.end ()) return it->second; - int aFlags = mLedger->getSLEi(Ledger::getAccountRootIndex(accountID))->getFieldU32(sfFlags); + SLE::pointer sleAccount = mLedger->getSLEi(Ledger::getAccountRootIndex(accountID)); + if (!sleAccount) + { + mPOMap[accountCurrency] = 0; + return 0; + } + + int aFlags = sleAccount->getFieldU32(sfFlags); bool const bAuthRequired = (aFlags & lsfRequireAuth) != 0; int count = 0;