remove unused offers code

This commit is contained in:
CJ Cobb
2021-08-06 12:32:06 -04:00
parent 56e81eb1d8
commit ea5f9162b7
11 changed files with 16 additions and 83 deletions

View File

@@ -435,22 +435,10 @@ public:
BOOST_LOG_TRIVIAL(trace) << "Writing objects";
for (auto& obj : *(cur_->mutable_ledger_objects()->mutable_objects()))
{
std::optional<ripple::uint256> book = {};
short offer_bytes = (obj.data()[1] << 8) | obj.data()[2];
if (offer_bytes == 0x006f)
{
ripple::SerialIter it{obj.data().data(), obj.data().size()};
ripple::SLE sle{it, {}};
book = sle.getFieldH256(ripple::sfBookDirectory);
}
backend.writeLedgerObject(
std::move(*obj.mutable_key()),
request_.ledger().sequence(),
std::move(*obj.mutable_data()),
true,
false,
std::move(book));
std::move(*obj.mutable_data()));
}
BOOST_LOG_TRIVIAL(trace) << "Wrote objects";

View File

@@ -294,34 +294,11 @@ ReportingETL::buildNextLedger(org::xrpl::rpc::v1::GetLedgerResponse& rawData)
for (auto& obj : *(rawData.mutable_ledger_objects()->mutable_objects()))
{
bool isCreated = false;
bool isDeleted = false;
if (obj.mod_type() == org::xrpl::rpc::v1::RawLedgerObject::CREATED)
isCreated = true;
else if (
obj.mod_type() == org ::xrpl::rpc::v1::RawLedgerObject::DELETED)
isDeleted = true;
std::optional<ripple::uint256> bookDir;
if (isCreated)
{
if (isOffer(obj.data()))
bookDir = getBook(obj.data());
}
else if (obj.book_of_deleted_offer().size())
{
bookDir =
ripple::uint256::fromVoid(obj.book_of_deleted_offer().data());
}
assert(not(isCreated and isDeleted));
backend_->writeLedgerObject(
std::move(*obj.mutable_key()),
lgrInfo.seq,
std::move(*obj.mutable_data()),
isCreated,
isDeleted,
std::move(bookDir));
std::move(*obj.mutable_data()));
}
BOOST_LOG_TRIVIAL(debug)
<< __func__ << " : "