Files
xahaud/modules/ripple_app/paths/ripple_RippleLineCache.cpp
2013-07-23 18:47:02 -07:00

19 lines
719 B
C++

//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================
AccountItems& RippleLineCache::getRippleLines (const uint160& accountID)
{
boost::mutex::scoped_lock sl (mLock);
boost::unordered_map <uint160, AccountItems::pointer>::iterator it = mRLMap.find (accountID);
if (it == mRLMap.end ())
it = mRLMap.insert (std::make_pair (accountID, boost::make_shared<AccountItems>
(boost::cref (accountID), boost::cref (mLedger), AccountItem::pointer (new RippleState ())))).first;
return *it->second;
}