20#include <xrpld/app/paths/RippleLineCache.h>
21#include <xrpld/app/paths/TrustLine.h>
28 : ledger_(ledger), journal_(j)
36 <<
" with " <<
lines_.size() <<
" accounts and "
45 auto const hash =
hasher_(accountID);
55 auto [it, inserted] = [&]() {
56 if (
auto otheriter =
lines_.find(otherkey); otheriter !=
lines_.end())
61 auto const size = otheriter->second ? otheriter->second->size() : 0;
66 <<
" trust lines for account " << accountID <<
" found " << size
71 ?
"Deleting the subset of incoming"
72 :
"Returning the superset of outgoing")
83 "ripple::RippleLineCache::getRippleLines : maximum lines");
98 return lines_.emplace(key,
nullptr);
104 it->second ==
nullptr,
105 "ripple::RippleLineCache::getRippleLines : null lines");
110 it->second = std::make_shared<std::vector<PathFindTrustLine>>(
117 !it->second || (it->second->size() > 0),
118 "ripple::RippleLineCache::getRippleLines : null or nonempty lines");
119 auto const size = it->second ? it->second->size() : 0;
121 <<
ledger_->info().seq <<
" found " << size
125 <<
" lines for " << (inserted ?
"new " :
"existing ")
126 << accountID <<
" out of a total of "
127 <<
lines_.size() <<
" accounts and "
A generic endpoint for log messages.
Stream trace() const
Severity stream access functions.
static std::vector< PathFindTrustLine > getItems(AccountID const &accountID, ReadView const &view, LineDirection direction)
std::shared_ptr< ReadView const > ledger_
std::size_t totalLineCount_
ripple::hardened_hash hasher_
hash_map< AccountKey, std::shared_ptr< std::vector< PathFindTrustLine > >, AccountKey::Hash > lines_
std::shared_ptr< std::vector< PathFindTrustLine > > getRippleLines(AccountID const &accountID, LineDirection direction)
Find the trust lines associated with an account.
RippleLineCache(std::shared_ptr< ReadView const > const &l, beast::Journal j)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
LineDirection
Describes how an account was found in a path, and how to find the next set of paths.