From 147fee0272c7f3d5ccc0e4e23fb17effde7fa6fe Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 26 Jul 2015 12:28:18 -0700 Subject: [PATCH] Add describeOwnerDir --- src/ripple/ledger/View.h | 3 +++ src/ripple/ledger/impl/View.cpp | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ripple/ledger/View.h b/src/ripple/ledger/View.h index 0265ce5364..e6f76906b9 100644 --- a/src/ripple/ledger/View.h +++ b/src/ripple/ledger/View.h @@ -201,6 +201,9 @@ dirNext (ApplyView& view, unsigned int& uDirEntry, // <-> next entry uint256& uEntryIndex); // <-- The entry, if available. Otherwise, zero. +std::function +describeOwnerDir(AccountID const& account); + // <-- uNodeDir: For deletion, present to make dirDelete efficient. // --> uRootIndex: The index of the base of the directory. Nodes are based off of this. // --> uLedgerIndex: Value to add to directory. diff --git a/src/ripple/ledger/impl/View.cpp b/src/ripple/ledger/impl/View.cpp index 89564e00f9..a664d1049e 100644 --- a/src/ripple/ledger/impl/View.cpp +++ b/src/ripple/ledger/impl/View.cpp @@ -23,8 +23,8 @@ #include #include #include +#include #include -#include #include #include @@ -572,6 +572,15 @@ dirNext (ApplyView& view, return true; } +std::function +describeOwnerDir(AccountID const& account) +{ + return [account](std::shared_ptr const& sle, bool) + { + (*sle)[sfOwner] = account; + }; +} + TER dirAdd (ApplyView& view, std::uint64_t& uNodeDir,