20 #include <ripple/basics/chrono.h>
21 #include <ripple/ledger/BookDirs.h>
22 #include <ripple/ledger/ReadView.h>
23 #include <ripple/ledger/View.h>
24 #include <ripple/basics/contract.h>
25 #include <ripple/basics/Log.h>
26 #include <ripple/basics/StringUtilities.h>
27 #include <ripple/protocol/Feature.h>
28 #include <ripple/protocol/st.h>
29 #include <ripple/protocol/Protocol.h>
30 #include <ripple/protocol/Quality.h>
31 #include <boost/algorithm/string.hpp>
77 if (issuer != account)
81 account, issuer, currency));
82 if (sle && sle->isFlag(
104 account, issuer, currency));
107 amount.
clear ({currency, issuer});
110 isFrozen(view, account, currency, issuer))
116 amount = sle->getFieldAmount (
sfBalance);
117 if (account > issuer)
124 JLOG (j.
trace()) <<
"accountHolds:" <<
129 account, issuer, amount);
139 if (!saDefault.
native () &&
143 JLOG (j.
trace()) <<
"accountFunds:" <<
153 JLOG (j.
trace()) <<
"accountFunds:" <<
170 boost::optional<AccountID>
const&
id = boost::none,
177 if (adjusted < current)
183 " owner count exceeds max!";
191 if (adjusted > current)
197 " owner count set below 0!";
222 auto const fullBalance =
227 STAmount amount = balance - reserve;
228 if (balance < reserve)
231 JLOG (j.
trace()) <<
"accountHolds:" <<
234 " fullBalance=" << fullBalance.getFullText() <<
235 " balance=" << balance.getFullText() <<
236 " reserve=" << reserve <<
237 " ownerCount=" << ownerCount <<
238 " ownerCountAdj=" << ownerCountAdj;
251 auto sle = view.
read(pos);
255 for (
auto const& key : sle->getFieldV256(
sfIndexes))
272 auto currentIndex = rootIndex;
275 if (
after.isNonZero ())
278 auto hintDir = view.
read(hintIndex);
281 for (
auto const& key : hintDir->getFieldV256 (
sfIndexes))
286 currentIndex = hintIndex;
295 auto const ownerDir = view.
read(currentIndex);
298 for (
auto const& key : ownerDir->getFieldV256 (
sfIndexes))
311 auto const uNodeNext =
322 auto const ownerDir = view.
read(currentIndex);
325 for (
auto const& key : ownerDir->getFieldV256 (
sfIndexes))
328 auto const uNodeNext =
360 if (hash && (*hash != validLedger.
info().
hash))
362 JLOG(s) << reason <<
" incompatible with valid ledger";
364 JLOG(s) <<
"Hash(VSeq): " <<
to_string (*hash);
374 if (hash && (*hash != testLedger.
info().
hash))
376 JLOG(s) << reason <<
" incompatible preceding ledger";
378 JLOG(s) <<
"Hash(NSeq): " <<
to_string (*hash);
387 JLOG(s) << reason <<
" incompatible ledger";
394 JLOG(s) <<
"Val: " << validLedger.
info().
seq <<
397 JLOG(s) <<
"New: " << testLedger.
info().
seq <<
409 if (testLedger.
info().
seq > validIndex)
412 auto hash =
hashOfSeq (testLedger, validIndex,
414 if (hash && (*hash != validHash))
416 JLOG(s) << reason <<
" incompatible following ledger";
417 JLOG(s) <<
"Hash(VSeq): " <<
to_string (*hash);
422 else if ((validIndex == testLedger.
info().
seq) &&
423 (testLedger.
info().
hash != validHash))
425 JLOG(s) << reason <<
" incompatible ledger";
432 JLOG(s) <<
"Val: " << validIndex <<
435 JLOG(s) <<
"New: " << testLedger.
info().
seq <<
446 auto const sleNode = view.
read(k);
449 if (! sleNode->getFieldV256 (
sfIndexes).empty ())
461 unsigned int& uDirEntry,
468 return cdirNext (view, uRootIndex, sleNode, uDirEntry, uEntryIndex, j);
475 unsigned int& uDirEntry,
480 assert (uDirEntry <= svIndexes.size ());
481 if (uDirEntry >= svIndexes.size ())
483 auto const uNodeNext =
490 auto const sleNext = view.
read(
497 <<
"Corrupt directory: index:"
498 << uRootIndex <<
" next:" << uNodeNext;
503 sleNode, uDirEntry, uEntryIndex, j);
505 uEntryIndex = svIndexes[uDirEntry++];
506 JLOG (j.
trace()) <<
"dirNext:" <<
507 " uDirEntry=" << uDirEntry <<
508 " uEntryIndex=" << uEntryIndex;
522 amendments.
insert (v.begin(), v.end());
539 using d = tp::duration;
541 auto const majorities = sle->getFieldArray (
sfMajorities);
543 for (
auto const& m : majorities)
552 boost::optional<uint256>
557 if (seq > ledger.
seq())
559 JLOG (journal.
warn()) <<
560 "Can't get seq " << seq <<
561 " from " << ledger.
seq() <<
" future";
564 if (seq == ledger.
seq())
566 if (seq == (ledger.
seq() - 1))
572 auto const hashIndex =
581 JLOG (journal.
warn()) <<
582 "Ledger " << ledger.
seq() <<
583 " missing hash for " << seq <<
584 " (" << vec.
size () <<
"," <<
diff <<
")";
588 JLOG (journal.
warn()) <<
589 "Ledger " << ledger.
seq() <<
590 ":" << ledger.
info().
hash <<
" missing normal list";
594 if ((seq & 0xff) != 0)
596 JLOG (journal.
debug()) <<
597 "Can't get seq " << seq <<
598 " from " << ledger.
seq() <<
" past";
603 auto const hashIndex =
609 assert (lastSeq >= seq);
610 assert ((lastSeq & 0xff) == 0);
611 auto const diff = (lastSeq - seq) >> 8;
616 JLOG (journal.
warn()) <<
617 "Can't get seq " << seq <<
618 " from " << ledger.
seq() <<
" error";
648 unsigned int& uDirEntry,
655 return dirNext (view, uRootIndex, sleNode, uDirEntry, uEntryIndex, j);
662 unsigned int& uDirEntry,
667 assert (uDirEntry <= svIndexes.size ());
668 if (uDirEntry >= svIndexes.size ())
670 auto const uNodeNext =
677 auto const sleNext = view.
peek(
684 <<
"Corrupt directory: index:"
685 << uRootIndex <<
" next:" << uNodeNext;
689 return dirNext (view, uRootIndex,
690 sleNode, uDirEntry, uEntryIndex, j);
692 uEntryIndex = svIndexes[uDirEntry++];
693 JLOG (j.
trace()) <<
"dirNext:" <<
694 " uDirEntry=" << uDirEntry <<
695 " uEntryIndex=" << uEntryIndex;
708 boost::optional<std::uint64_t>
717 return view.
dirAppend(dir, uLedgerIndex, fDescriber);
719 return view.
dirInsert(dir, uLedgerIndex, fDescriber);
730 const bool bNoRipple,
741 <<
"trustCreate: " <<
to_string (uSrcAccountID) <<
", "
744 auto const& uLowAccountID = !bSrcHigh ? uSrcAccountID : uDstAccountID;
745 auto const& uHighAccountID = bSrcHigh ? uSrcAccountID : uDstAccountID;
747 auto const sleRippleState = std::make_shared<SLE>(
749 view.
insert (sleRippleState);
763 const bool bSetDst = saLimit.
getIssuer () == uDstAccountID;
764 const bool bSetHigh = bSrcHigh ^ bSetDst;
770 assert (sleAccount->getAccountID (
sfAccount) ==
771 (bSetHigh ? uHighAccountID : uLowAccountID));
773 bSetHigh ? uLowAccountID : uHighAccountID));
778 sleRippleState->setFieldU64 (
sfLowNode, *lowNode);
779 sleRippleState->setFieldU64 (
sfHighNode, *highNode);
781 sleRippleState->setFieldAmount (
783 sleRippleState->setFieldAmount (
786 bSetDst ? uSrcAccountID : uDstAccountID}));
789 sleRippleState->setFieldU32 (
793 sleRippleState->setFieldU32 (
817 sleRippleState->setFieldU32 (
sfFlags, uFlags);
821 sleRippleState->setFieldAmount (
sfBalance, bSetHigh ? -saBalance : saBalance);
824 uDstAccountID, saBalance, saBalance.zeroed());
841 <<
"trustDelete: Deleting ripple line: low";
846 sleRippleState->
key(),
853 <<
"trustDelete: Deleting ripple line: high";
858 sleRippleState->
key(),
864 JLOG (j.
trace()) <<
"trustDelete: Deleting ripple line: state";
865 view.
erase(sleRippleState);
877 auto offerIndex = sle->
key();
916 STAmount const& saAmount,
bool bCheckIssuer,
924 !bCheckIssuer || uSenderID == issuer || uReceiverID == issuer);
928 assert (uSenderID != uReceiverID);
930 bool const bSenderHigh = uSenderID > uReceiverID;
932 uSenderID, uReceiverID, currency);
942 STAmount const saReceiverLimit ({currency, uReceiverID});
947 JLOG (j.
debug()) <<
"rippleCredit: "
948 "create line: " <<
to_string (uSenderID) <<
952 auto const sleAccount =
981 view.
creditHook (uSenderID, uReceiverID, saAmount, saBalance);
983 STAmount const saBefore = saBalance;
985 saBalance -= saAmount;
987 JLOG (j.
trace()) <<
"rippleCredit: " <<
995 bool bDelete =
false;
998 if (saBefore > beast::zero
1000 && saBalance <= beast::zero
1007 && !sleRippleState->getFieldAmount (
1010 && !sleRippleState->getFieldU32 (
1013 && !sleRippleState->getFieldU32 (
1022 sleRippleState->setFieldU32 (
1027 bDelete = !saBalance
1036 sleRippleState->setFieldAmount (
sfBalance, saBalance);
1043 bSenderHigh ? uReceiverID : uSenderID,
1044 !bSenderHigh ? uReceiverID : uSenderID, j);
1048 view.
update (sleRippleState);
1065 auto const issuer = saAmount.
getIssuer ();
1067 assert (!
isXRP (uSenderID) && !
isXRP (uReceiverID));
1068 assert (uSenderID != uReceiverID);
1070 if (uSenderID == issuer || uReceiverID == issuer || issuer ==
noAccount())
1073 auto const ter =
rippleCredit (view, uSenderID, uReceiverID, saAmount,
false, j);
1076 saActual = saAmount;
1086 JLOG (j.
debug()) <<
"rippleSend> " <<
1092 TER terResult =
rippleCredit (view, issuer, uReceiverID, saAmount,
true, j);
1095 terResult =
rippleCredit (view, uSenderID, issuer, saActual,
true, j);
1105 assert (saAmount >= beast::zero);
1110 if (!saAmount || (uSenderID == uReceiverID))
1117 JLOG (j.
trace()) <<
"accountSend: " <<
1121 return rippleSend (view, uSenderID, uReceiverID, saAmount, saActual, j);
1138 if (
auto stream = j.
trace())
1149 stream <<
"accountSend> " <<
1150 to_string (uSenderID) <<
" (" << sender_bal <<
1151 ") -> " <<
to_string (uReceiverID) <<
" (" << receiver_bal <<
1161 terResult = view.
open()
1186 if (
auto stream = j.
trace())
1197 stream <<
"accountSend< " <<
1198 to_string (uSenderID) <<
" (" << sender_bal <<
1199 ") -> " <<
to_string (uReceiverID) <<
" (" << receiver_bal <<
1226 if (before > beast::zero
1228 &&
after <= beast::zero
1269 assert (issue == amount.
issue ());
1272 assert (issue.
account != account);
1274 JLOG (j.
trace()) <<
"issueIOU: " <<
1278 bool bSenderHigh = issue.
account > account;
1294 if (! receiverAccount)
1300 receiverAccount,
false, noRipple,
false, final_balance, limit, 0, 0, j);
1308 STAmount const start_balance = final_balance;
1310 final_balance -= amount;
1313 start_balance, final_balance, j);
1323 state->setFieldAmount (
sfBalance, final_balance);
1326 bSenderHigh ? account : issue.
account,
1327 bSenderHigh ? issue.
account : account, j);
1344 assert (issue == amount.
issue ());
1347 assert (issue.
account != account);
1349 JLOG (j.
trace()) <<
"redeemIOU: " <<
1353 bool bSenderHigh = account > issue.
account;
1363 JLOG (j.
fatal()) <<
"redeemIOU: " <<
1364 to_string (account) <<
" attempts to redeem " <<
1365 amount.
getFullText () <<
" but no trust line exists!";
1375 STAmount const start_balance = final_balance;
1377 final_balance -= amount;
1379 auto const must_delete =
updateTrustLine (view, state, bSenderHigh, account,
1380 start_balance, final_balance, j);
1391 state->setFieldAmount (
sfBalance, final_balance);
1396 bSenderHigh ? issue.
account : account,
1397 bSenderHigh ? account : issue.
account, j);
1411 assert (from != beast::zero);
1412 assert (to != beast::zero);
1413 assert (from != to);
1414 assert (amount.
native ());
1418 if (!sender || !receiver)
1421 JLOG (j.
trace()) <<
"transferXRP: " <<
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
const SF_U32 sfHighQualityIn(access, STI_UINT32, 16, "HighQualityIn")
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Rate transferRate(ReadView const &view, AccountID const &issuer)
majorityAmendments_t getMajorityAmendments(ReadView const &view)
A pair of SHAMap key and LedgerEntryType.
const SF_U64 sfIndexNext(access, STI_UINT64, 1, "IndexNext")
int add8(unsigned char byte)
std::set< uint256 > getEnabledAmendments(ReadView const &view)
A currency issued by an account.
Represents a transfer rate.
Stream trace() const
Severity stream access functions.
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
std::uint64_t getFieldU64(SField const &field) const
const STVector256 & getFieldV256(SField const &field) const
constexpr value_type drops() const
Returns the number of drops.
bool cdirNext(ReadView const &view, uint256 const &uRootIndex, std::shared_ptr< SLE const > &sleNode, unsigned int &uDirEntry, uint256 &uEntryIndex, beast::Journal j)
virtual void erase(std::shared_ptr< SLE > const &sle)=0
Remove a peeked SLE.
boost::optional< std::uint64_t > dirInsert(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Insert an entry to a directory.
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
const SF_Account sfAccount(access, STI_ACCOUNT, 1, "Account")
const SF_U32 sfFlags(access, STI_UINT32, 2, "Flags")
virtual void creditHook(AccountID const &from, AccountID const &to, STAmount const &amount, STAmount const &preCreditBalance)
const SField sfMajorities(access, STI_ARRAY, 16, "Majorities")
Keylet child(uint256 const &key)
Any item that can be in an owner dir.
boost::optional< std::uint64_t > dirAppend(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Append an entry to a directory.
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
virtual STAmount balanceHook(AccountID const &account, AccountID const &issuer, STAmount const &amount) const
void addRaw(LedgerInfo const &info, Serializer &s)
std::string to_string(ListDisposition disposition)
const SF_U64 sfOwnerNode(access, STI_UINT64, 4, "OwnerNode")
void setIssuer(AccountID const &uIssuer)
bool dirNext(ApplyView &view, uint256 const &uRootIndex, std::shared_ptr< SLE > &sleNode, unsigned int &uDirEntry, uint256 &uEntryIndex, beast::Journal j)
FreezeHandling
Controls the treatment of frozen account balances.
const SF_U32 sfOwnerCount(access, STI_UINT32, 13, "OwnerCount")
static Sink & getNullSink()
Returns a Sink which does nothing.
const SF_Amount sfHighLimit(access, STI_AMOUNT, 7, "HighLimit")
const Rate parityRate(QUALITY_ONE)
A transfer rate signifying a 1:1 exchange.
Writeable view to a ledger, for applying a transaction.
const SF_Amount sfLowLimit(access, STI_AMOUNT, 6, "LowLimit")
const uint256 featureDeletableAccounts
void forEachItem(ReadView const &view, AccountID const &id, std::function< void(std::shared_ptr< SLE const > const &)> f)
Iterate all items in an account's owner directory.
bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
bool dirFirst(ApplyView &view, uint256 const &uRootIndex, std::shared_ptr< SLE > &sleNode, unsigned int &uDirEntry, uint256 &uEntryIndex, beast::Journal j)
NetClock::time_point closeTime
uint256 const & key() const
Returns the 'key' (or 'index') of this item.
const SF_U32 sfLastLedgerSequence(access, STI_UINT32, 27, "LastLedgerSequence")
std::string getFullText() const override
T time_since_epoch(T... args)
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
const SF_Account sfOwner(access, STI_ACCOUNT, 2, "Owner")
const SF_U64 sfHighNode(access, STI_UINT64, 8, "HighNode")
const SF_U256 sfBookDirectory(access, STI_HASH256, 16, "BookDirectory")
void setFieldAmount(SField const &field, STAmount const &)
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
static const account_t account
AccountID getAccountID(SField const &field) const
const SF_U256 sfAmendment(access, STI_HASH256, 19, "Amendment")
uint256 getRippleStateIndex(AccountID const &a, AccountID const &b, Currency const ¤cy)
Keylet ownerDir(AccountID const &id)
The root page of an account's directory.
TERSubset< CanCvtToTER > TER
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j)
AccountID const & xrpAccount()
Compute AccountID from public key.
Provide a light-weight way to check active() before string formatting.
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
bool isXRP(AccountID const &c)
@ current
This was a new validation and was added.
A generic endpoint for log messages.
const SF_U32 sfLowQualityOut(access, STI_UINT32, 19, "LowQualityOut")
bool enabled(uint256 const &id) const
Returns true if a feature is enabled.
static TER rippleSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, STAmount &saActual, beast::Journal j)
std::map< uint256, NetClock::time_point > majorityAmendments_t
const SF_Vec256 sfIndexes(access, STI_VECTOR256, 1, "Indexes", SField::sMD_Never)
virtual void adjustOwnerCountHook(AccountID const &account, std::uint32_t cur, std::uint32_t next)
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, const char *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Currency const & getCurrency() const
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
AccountID const & getIssuer() const
boost::optional< std::uint64_t > dirAdd(ApplyView &view, Keylet const &dir, uint256 const &uLedgerIndex, bool strictOrder, std::function< void(SLE::ref)> fDescriber, beast::Journal j)
STAmount multiply(STAmount const &amount, Rate const &rate)
static const amendments_t amendments
boost::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
const SF_Vec256 sfHashes(access, STI_VECTOR256, 2, "Hashes")
TER issueIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
bool native() const noexcept
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
TER trustCreate(ApplyView &view, const bool bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, const bool bAuth, const bool bNoRipple, const bool bFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
const SF_U32 sfLowQualityIn(access, STI_UINT32, 18, "LowQualityIn")
const SF_Amount sfBalance(access, STI_AMOUNT, 2, "Balance")
XRPAmount accountReserve(std::size_t ownerCount) const
Returns the account reserve given the owner count, in drops.
LedgerIndex seq() const
Returns the sequence number of the base ledger.
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
virtual Rules const & rules() const =0
Returns the tx processing rules.
Issue const & issue() const
NetClock::duration closeTimeResolution
virtual std::uint32_t ownerCountHook(AccountID const &account, std::uint32_t count) const
const SF_U32 sfCloseTime(access, STI_UINT32, 7, "CloseTime")
bool forEachItemAfter(ReadView const &view, AccountID const &id, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> f)
Iterate all items after an item in an owner directory.
static bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
const SF_U32 sfTransferRate(access, STI_UINT32, 11, "TransferRate")
const SF_U64 sfLowNode(access, STI_UINT64, 7, "LowNode")
Information about the notional ledger backing the view.
static std::uint32_t confineOwnerCount(std::uint32_t current, std::int32_t adjustment, boost::optional< AccountID > const &id=boost::none, beast::Journal j=beast::Journal {beast::Journal::getNullSink()})
const SF_Vec256 sfAmendments(access, STI_VECTOR256, 3, "Amendments")
std::uint32_t getFieldU32(SField const &field) const
static bool updateTrustLine(ApplyView &view, SLE::pointer state, bool bSenderHigh, AccountID const &sender, STAmount const &before, STAmount const &after, beast::Journal j)
const SF_U64 sfBookNode(access, STI_UINT64, 3, "BookNode")
const std::shared_ptr< STLedgerEntry > & ref
virtual bool open() const =0
Returns true if this reflects an open ledger.
std::chrono::time_point< NetClock > time_point
void setFieldU32(SField const &field, std::uint32_t)
const SF_U32 sfHighQualityOut(access, STI_UINT32, 17, "HighQualityOut")
bool isFrozen(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer)
STAmount const & getFieldAmount(SField const &field) const
AccountID const & noAccount()
A placeholder for empty accounts.
std::shared_ptr< STLedgerEntry > pointer
Keylet page(uint256 const &key, std::uint64_t index)
A page in a directory.
int add256(uint256 const &)
NetClock::time_point parentCloseTime
uint256 getFieldH256(SField const &field) const
bool cdirFirst(ReadView const &view, uint256 const &uRootIndex, std::shared_ptr< SLE const > &sleNode, unsigned int &uDirEntry, uint256 &uEntryIndex, beast::Journal j)