mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Clean OrderBookDB::getBooksBy methods.
This commit is contained in:
committed by
Vinnie Falco
parent
0f409b7bec
commit
4b905fe9ff
@@ -166,37 +166,19 @@ void OrderBookDB::addOrderBook(Book const& book)
|
||||
}
|
||||
|
||||
// return list of all orderbooks that want this issuerID and currencyID
|
||||
void OrderBookDB::getBooksByTakerPays (
|
||||
Issue const& issue, OrderBook::List& bookRet)
|
||||
OrderBook::List OrderBookDB::getBooksByTakerPays (Issue const& issue)
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
auto it = mSourceMap.find (issue);
|
||||
if (it != mSourceMap.end ())
|
||||
bookRet = it->second;
|
||||
else
|
||||
bookRet.clear ();
|
||||
return it == mSourceMap.end () ? OrderBook::List() : it->second;
|
||||
}
|
||||
|
||||
bool OrderBookDB::isBookToXRP(Issue const& issue)
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
|
||||
return mXRPBooks.count(issue) > 0;
|
||||
}
|
||||
|
||||
// return list of all orderbooks that give this issuerID and currencyID
|
||||
void OrderBookDB::getBooksByTakerGets (
|
||||
Issue const& issue, OrderBook::List& bookRet)
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
auto it = mDestMap.find (issue);
|
||||
|
||||
if (it != mDestMap.end ())
|
||||
bookRet = it->second;
|
||||
else
|
||||
bookRet.clear ();
|
||||
}
|
||||
|
||||
BookListeners::pointer OrderBookDB::makeBookListeners (Book const& book)
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
|
||||
@@ -38,8 +38,7 @@ public:
|
||||
void addOrderBook(Book const&);
|
||||
|
||||
// return list of all orderbooks that want this issuerID and currencyID
|
||||
void getBooksByTakerPays (Issue const&, OrderBook::List&);
|
||||
void getBooksByTakerGets (Issue const&, OrderBook::List&);
|
||||
OrderBook::List getBooksByTakerPays (Issue const&);
|
||||
|
||||
bool isBookToXRP (Issue const&);
|
||||
|
||||
|
||||
@@ -822,11 +822,11 @@ void Pathfinder::addLink(
|
||||
else
|
||||
{
|
||||
bool bDestOnly = (addFlags & afOB_LAST) != 0;
|
||||
std::vector<OrderBook::pointer> books;
|
||||
getApp().getOrderBookDB().getBooksByTakerPays(
|
||||
{uEndCurrency, uEndIssuer}, books);
|
||||
auto books = getApp().getOrderBookDB().getBooksByTakerPays(
|
||||
{uEndCurrency, uEndIssuer});
|
||||
WriteLog (lsTRACE, Pathfinder)
|
||||
<< books.size() << " books found from this currency/issuer";
|
||||
|
||||
for (auto const& book : books)
|
||||
{
|
||||
if (!currentPath.hasSeen (
|
||||
|
||||
Reference in New Issue
Block a user