20 #include <ripple/app/paths/RippleLineCache.h>
21 #include <ripple/app/paths/TrustLine.h>
22 #include <ripple/ledger/OpenView.h>
29 : ledger_(ledger), journal_(j)
37 <<
" with " <<
lines_.size() <<
" accounts and "
46 auto const hash =
hasher_(accountID);
56 auto [it, inserted] = [&]() {
57 if (
auto otheriter =
lines_.find(otherkey); otheriter !=
lines_.end())
62 auto const size = otheriter->second ? otheriter->second->size() : 0;
67 <<
" trust lines for account " << accountID <<
" found " << size
72 ?
"Deleting the subset of incoming"
73 :
"Returning the superset of outgoing")
97 return lines_.emplace(key,
nullptr);
102 assert(it->second ==
nullptr);
107 it->second = std::make_shared<std::vector<PathFindTrustLine>>(
113 assert(!it->second || (it->second->size() > 0));
114 auto const size = it->second ? it->second->size() : 0;
116 <<
ledger_->info().seq <<
" found " << size
120 <<
" lines for " << (inserted ?
"new " :
"existing ")
121 << accountID <<
" out of a total of "
122 <<
lines_.size() <<
" accounts and "
LineDirection
Describes how an account was found in a path, and how to find the next set of paths.
Stream trace() const
Severity stream access functions.
std::shared_ptr< ReadView const > ledger_
std::size_t totalLineCount_
A generic endpoint for log messages.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
RippleLineCache(std::shared_ptr< ReadView const > const &l, beast::Journal j)
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.
static std::vector< PathFindTrustLine > getItems(AccountID const &accountID, ReadView const &view, LineDirection direction)