1#include <xrpld/app/paths/RippleLineCache.h>
2#include <xrpld/app/paths/TrustLine.h>
9 : ledger_(ledger), journal_(j)
17 <<
" with " <<
lines_.size() <<
" accounts and "
26 auto const hash =
hasher_(accountID);
36 auto [it, inserted] = [&]() {
37 if (
auto otheriter =
lines_.find(otherkey); otheriter !=
lines_.end())
42 auto const size = otheriter->second ? otheriter->second->size() : 0;
47 <<
" trust lines for account " << accountID <<
" found " << size
52 ?
"Deleting the subset of incoming"
53 :
"Returning the superset of outgoing")
64 "ripple::RippleLineCache::getRippleLines : maximum lines");
79 return lines_.emplace(key,
nullptr);
85 it->second ==
nullptr,
86 "ripple::RippleLineCache::getRippleLines : null lines");
98 !it->second || (it->second->size() > 0),
99 "ripple::RippleLineCache::getRippleLines : null or nonempty lines");
100 auto const size = it->second ? it->second->size() : 0;
102 <<
ledger_->info().seq <<
" found " << size
106 <<
" lines for " << (inserted ?
"new " :
"existing ")
107 << accountID <<
" out of a total of "
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)
static constexpr std::size_t size()
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.