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

@@ -1180,4 +1180,22 @@ void Ledger::decPendingSaves()
--sPendingSaves;
}
void Ledger::ownerDirDescriber(SLE::ref sle, const uint160& owner)
{
sle->setFieldH160(sfOwner, owner);
}
void Ledger::qualityDirDescriber(SLE::ref sle,
const uint160& uTakerPaysCurrency, const uint160& uTakerPaysIssuer,
const uint160& uTakerGetsCurrency, const uint160& uTakerGetsIssuer,
const uint64& uRate)
{
sle->setFieldH160(sfTakerPaysCurrency, uTakerPaysCurrency);
sle->setFieldH160(sfTakerPaysIssuer, uTakerPaysIssuer);
sle->setFieldH160(sfTakerGetsCurrency, uTakerGetsCurrency);
sle->setFieldH160(sfTakerGetsIssuer, uTakerGetsIssuer);
sle->setFieldU64(sfExchangeRate, uRate);
}
// vim:ts=4