mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
Order book offers by quality
This commit is contained in:
@@ -5,6 +5,12 @@ BackendIndexer::BackendIndexer(boost::json::object const& config)
|
||||
: keyShift_(config.at("keyshift").as_int64())
|
||||
, bookShift_(config.at("bookshift").as_int64())
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Indexer - starting with keyShift_ = "
|
||||
<< std::to_string(keyShift_);
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << "Indexer - starting with keyShift_ = "
|
||||
<< std::to_string(bookShift_);
|
||||
|
||||
work_.emplace(ioc_);
|
||||
ioThread_ = std::thread{[this]() { ioc_.run(); }};
|
||||
};
|
||||
@@ -42,6 +48,25 @@ BackendIndexer::deleteBookOffer(
|
||||
booksToDeletedOffers[book].insert(offerKey);
|
||||
}
|
||||
|
||||
std::vector<ripple::uint256>
|
||||
BackendIndexer::getCurrentOffers(ripple::uint256 const& book)
|
||||
{
|
||||
std::vector<ripple::uint256> offers;
|
||||
offers.reserve(booksToOffers[book].size() + booksToOffers[book].size());
|
||||
|
||||
for (auto const& offer : booksToOffers[book])
|
||||
{
|
||||
offers.push_back(offer);
|
||||
}
|
||||
|
||||
for(auto const& offer : booksToDeletedOffers[book])
|
||||
{
|
||||
offers.push_back(offer);
|
||||
}
|
||||
|
||||
return offers;
|
||||
}
|
||||
|
||||
void
|
||||
BackendIndexer::finish(uint32_t ledgerSequence, BackendInterface const& backend)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user