Add path test for issue #23.

This commit is contained in:
Arthur Britto
2013-01-19 12:58:37 -08:00
parent 87c661f778
commit 51bbe5ffc8
4 changed files with 90 additions and 13 deletions

View File

@@ -525,6 +525,11 @@ TER LedgerEntrySet::dirAdd(
const uint256& uLedgerIndex,
boost::function<void (SLE::ref)> fDescriber)
{
cLog(lsDEBUG)
<< boost::str(boost::format("dirAdd: uRootIndex=%s uLedgerIndex=%s")
% uRootIndex.ToString()
% uLedgerIndex.ToString());
SLE::pointer sleNode;
STVector256 svIndexes;
SLE::pointer sleRoot = entryCache(ltDIR_NODE, uRootIndex);

View File

@@ -531,10 +531,6 @@ void LedgerMaster::pubThread()
cLog(lsDEBUG) << "Publishing ledger " << l->getLedgerSeq();
setFullLedger(l); // OPTIMIZEME: This is actually more work than we need to do
theApp->getOPs().pubLedger(l);
BOOST_FOREACH(callback& c, mOnValidate)
{
c(l);
}
}
}
}

View File

@@ -229,11 +229,16 @@ TER OfferCreateTransactor::takeOffers(
}
}
cLog(lsINFO) << "takeOffers: " << transToken(terResult);
// On storing meta data, delete offers that were found unfunded to prevent encountering them in future.
if (tesSUCCESS == terResult)
{
BOOST_FOREACH(const uint256& uOfferIndex, usOfferUnfundedFound)
{
cLog(lsINFO) << "takeOffers: found unfunded: " << uOfferIndex.ToString();
terResult = mEngine->getNodes().offerDelete(uOfferIndex);
if (tesSUCCESS != terResult)
break;
@@ -245,12 +250,16 @@ TER OfferCreateTransactor::takeOffers(
// On success, delete offers that became unfunded.
BOOST_FOREACH(const uint256& uOfferIndex, usOfferUnfundedBecame)
{
cLog(lsINFO) << "takeOffers: became unfunded: " << uOfferIndex.ToString();
terResult = mEngine->getNodes().offerDelete(uOfferIndex);
if (tesSUCCESS != terResult)
break;
}
}
cLog(lsINFO) << "takeOffers< " << transToken(terResult);
return terResult;
}