Files
rippled/src/libxrpl/protocol/Keylet.cpp
2026-04-17 16:43:49 +00:00

26 lines
559 B
C++

#include <xrpl/protocol/Keylet.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/STLedgerEntry.h>
namespace xrpl {
bool
Keylet::check(STLedgerEntry const& sle) const
{
XRPL_ASSERT(
sle.getType() != ltANY && sle.getType() != ltCHILD,
"xrpl::Keylet::check : valid input type");
if (type == ltANY)
return true;
if (type == ltCHILD)
return sle.getType() != ltDIR_NODE;
return sle.getType() == type && sle.key() == key;
}
} // namespace xrpl