rippled
Loading...
Searching...
No Matches
libxrpl
protocol
Keylet.cpp
1
#include <xrpl/beast/utility/instrumentation.h>
2
#include <xrpl/protocol/Keylet.h>
3
#include <xrpl/protocol/LedgerFormats.h>
4
#include <xrpl/protocol/STLedgerEntry.h>
5
6
namespace
ripple
{
7
8
bool
9
Keylet::check
(
STLedgerEntry
const
& sle)
const
10
{
11
XRPL_ASSERT(
12
sle.
getType
() !=
ltANY
|| sle.
getType
() !=
ltCHILD
,
13
"ripple::Keylet::check : valid input type"
);
14
15
if
(
type
==
ltANY
)
16
return
true
;
17
18
if
(
type
==
ltCHILD
)
19
return
sle.
getType
() != ltDIR_NODE;
20
21
return
sle.
getType
() ==
type
&& sle.
key
() ==
key
;
22
}
23
24
}
// namespace ripple
ripple::STLedgerEntry
Definition
STLedgerEntry.h:15
ripple::STLedgerEntry::getType
LedgerEntryType getType() const
Definition
STLedgerEntry.h:106
ripple::STLedgerEntry::key
uint256 const & key() const
Returns the 'key' (or 'index') of this item.
Definition
STLedgerEntry.h:100
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
ripple::ltCHILD
@ ltCHILD
A special type, matching any ledger type except directory nodes.
Definition
LedgerFormats.h:72
ripple::ltANY
@ ltANY
A special type, matching any ledger entry type.
Definition
LedgerFormats.h:59
ripple::Keylet::type
LedgerEntryType type
Definition
Keylet.h:22
ripple::Keylet::check
bool check(STLedgerEntry const &) const
Returns true if the SLE matches the type.
Definition
Keylet.cpp:9
ripple::Keylet::key
uint256 key
Definition
Keylet.h:21
Generated by
1.9.8