Fix a bug that corrupts order books.

This commit is contained in:
David Schwartz
2013-07-24 18:21:41 -07:00
parent e4998ed44b
commit d36edfc642

View File

@@ -893,6 +893,8 @@ TER LedgerEntrySet::dirDelete (
// Fix next to point to its new previous.
sleNext->setFieldU64 (sfIndexPrevious, uNodePrevious);
entryModify (sleNext);
entryDelete(sleNode);
}
// Last node.
else if (bKeepRoot || uNodePrevious)
@@ -973,7 +975,7 @@ bool LedgerEntrySet::dirNext (
if (!sleNode)
{ // This should never happen
WriteLog (lsFATAL, LedgerEntrySet) << "Corrupt directory: index:" << uRootIndex << " next:" << uNodeNext;
throw std::runtime_error ("Corrupt directory");
return false;
}
return dirNext (uRootIndex, sleNode, uDirEntry, uEntryIndex);