Make directory nodes self-descriptive.

Callers pass in a "describer" function that stamps new directory entries.
This commit is contained in:
JoelKatz
2012-11-30 00:30:19 -08:00
parent 1d3a17b59d
commit 2864dda4eb
7 changed files with 56 additions and 11 deletions

View File

@@ -1,5 +1,7 @@
#include "TrustSetTransactor.h"
#include <boost/bind.hpp>
TER TrustSetTransactor::doApply()
{
TER terResult = tesSUCCESS;
@@ -135,10 +137,18 @@ TER TrustSetTransactor::doApply()
uint64 uSrcRef; // Ignored, dirs never delete.
terResult = mEngine->getNodes().dirAdd(uSrcRef, Ledger::getOwnerDirIndex(mTxnAccountID), sleRippleState->getIndex());
terResult = mEngine->getNodes().dirAdd(
uSrcRef,
Ledger::getOwnerDirIndex(mTxnAccountID),
sleRippleState->getIndex(),
boost::bind(&Ledger::ownerDirDescriber, _1, mTxnAccountID));
if (tesSUCCESS == terResult)
terResult = mEngine->getNodes().dirAdd(uSrcRef, Ledger::getOwnerDirIndex(uDstAccountID), sleRippleState->getIndex());
terResult = mEngine->getNodes().dirAdd(
uSrcRef,
Ledger::getOwnerDirIndex(uDstAccountID),
sleRippleState->getIndex(),
boost::bind(&Ledger::ownerDirDescriber, _1, uDstAccountID));
}
Log(lsINFO) << "doTrustSet<";