Use the new, simpler traverse logic.

This commit is contained in:
JoelKatz
2012-10-24 15:46:19 -07:00
parent febd52b5d1
commit 253e3f5243
4 changed files with 43 additions and 41 deletions

View File

@@ -3,6 +3,7 @@
//
#include <boost/format.hpp>
#include <boost/foreach.hpp>
#include "TransactionEngine.h"
@@ -18,12 +19,12 @@ SETUP_LOG();
void TransactionEngine::txnWrite()
{
// Write back the account states
for (std::map<uint256, LedgerEntrySetEntry>::iterator it = mNodes.begin(), end = mNodes.end();
it != end; ++it)
typedef std::pair<const uint256, LedgerEntrySetEntry> u256_LES_pair;
BOOST_FOREACH(u256_LES_pair& it, mNodes)
{
const SLE::pointer& sleEntry = it->second.mEntry;
const SLE::pointer& sleEntry = it.second.mEntry;
switch (it->second.mAction)
switch (it.second.mAction)
{
case taaNONE:
assert(false);
@@ -54,7 +55,7 @@ void TransactionEngine::txnWrite()
{
cLog(lsINFO) << "applyTransaction: taaDELETE: " << sleEntry->getText();
if (!mLedger->peekAccountStateMap()->delItem(it->first))
if (!mLedger->peekAccountStateMap()->delItem(it.first))
assert(false);
}
break;