Some cleanups.

This commit is contained in:
JoelKatz
2012-11-25 08:54:23 -08:00
parent 553d55b5db
commit 73ad63849c
3 changed files with 13 additions and 9 deletions

View File

@@ -328,8 +328,8 @@ bool LedgerEntrySet::threadTx(SLE::ref threadTo, Ledger::ref ledger,
if (!threadTo->thread(mSet.getTxID(), mSet.getLgrSeq(), prevTxID, prevLgrID))
return false;
if (prevTxID.isZero() || TransactionMetaSet::thread(mSet.getAffectedNode(threadTo->getIndex(), sfModifiedNode),
prevTxID, prevLgrID))
if (prevTxID.isZero() ||
TransactionMetaSet::thread(mSet.getAffectedNode(threadTo, sfModifiedNode), prevTxID, prevLgrID))
return true;
assert(false);
@@ -408,8 +408,7 @@ void LedgerEntrySet::calcRawMeta(Serializer& s, TER result)
if (type == &sfDeletedNode)
{
assert(origNode);
assert(curNode);
assert(origNode && curNode);
threadOwners(origNode, mLedger, newMod); // thread transaction to owners
STObject prevs(sfPreviousFields);
@@ -432,6 +431,7 @@ void LedgerEntrySet::calcRawMeta(Serializer& s, TER result)
}
else if (type == &sfModifiedNode)
{
assert(curNode && origNode);
if (curNode->isThreadedType()) // thread transaction to node it modified
threadTx(curNode, mLedger, newMod);
@@ -455,7 +455,7 @@ void LedgerEntrySet::calcRawMeta(Serializer& s, TER result)
}
else if (type == &sfCreatedNode) // if created, thread to owner(s)
{
assert(!origNode);
assert(curNode && !origNode);
threadOwners(curNode, mLedger, newMod);
if (curNode->isThreadedType()) // always thread to self
@@ -470,6 +470,7 @@ void LedgerEntrySet::calcRawMeta(Serializer& s, TER result)
if (!news.empty())
mSet.getAffectedNode(it.first).addObject(news);
}
else assert(false);
}
// add any new modified nodes to the modification set