Set up for ledger diffs to populate the metadata.

Special case for unfunded offers -- need to know how much was taken before deletion
This commit is contained in:
JoelKatz
2012-07-28 14:49:34 -07:00
parent 74d0fe000c
commit 1167ba2cc0
6 changed files with 26 additions and 6 deletions

View File

@@ -147,7 +147,7 @@ void LedgerEntrySet::entryModify(SLE::pointer& sle)
}
}
void LedgerEntrySet::entryDelete(SLE::pointer& sle)
void LedgerEntrySet::entryDelete(SLE::pointer& sle, bool unfunded)
{
boost::unordered_map<uint256, LedgerEntrySetEntry>::iterator it = mEntries.find(sle->getIndex());
if (it == mEntries.end())
@@ -166,6 +166,13 @@ void LedgerEntrySet::entryDelete(SLE::pointer& sle)
it->second.mSeq = mSeq;
it->second.mEntry = sle;
it->second.mAction = taaDELETE;
if (unfunded)
{
assert(sle->getType() == ltOFFER); // only offers can be unfunded
mSet.deleteUnfunded(sle->getIndex(),
sle->getIValueFieldAmount(sfTakerPays),
sle->getIValueFieldAmount(sfTakerGets));
}
break;
case taaCREATE: