Files
rippled/src/libxrpl/protocol/Keylet.cpp
2026-02-20 01:58:47 +00:00

25 lines
558 B
C++

#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/protocol/Keylet.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