From b4e238a2e451d73c0f76a1b24075b4634f28c8cf Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 5 Jun 2012 15:41:44 -0700 Subject: [PATCH] With luck, a fix for the crash. --- src/LedgerConsensus.cpp | 10 ++++------ src/LedgerConsensus.h | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index dd787bafb2..0c14e9bdc4 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -584,12 +584,11 @@ void LedgerConsensus::Saccept(boost::shared_ptr This, SHAMap::p } void LedgerConsensus::applyTransactions(SHAMap::pointer set, Ledger::pointer ledger, - std::deque& failedTransactions) + std::list& failedTransactions) { TransactionEngine engine(ledger); - SHAMapItem::pointer item = set->peekFirstItem(); - while (item) + for (SHAMapItem::pointer item = set->peekFirstItem(); !!item; item = set->peekNextItem(item->getTag())) { Log(lsINFO) << "Processing candidate transaction: " << item->getTag().GetHex(); #ifndef TRUST_NETWORK @@ -622,14 +621,13 @@ void LedgerConsensus::applyTransactions(SHAMap::pointer set, Ledger::pointer led Log(lsWARNING) << " Throws"; } #endif - item = set->peekNextItem(item->getTag()); } int successes; do { successes = 0; - std::deque::iterator it = failedTransactions.begin(); + std::list::iterator it = failedTransactions.begin(); while (it != failedTransactions.end()) { try @@ -674,7 +672,7 @@ void LedgerConsensus::accept(SHAMap::pointer set) } #endif - std::deque failedTransactions; + std::list failedTransactions; applyTransactions(set, newLCL, failedTransactions); newLCL->setClosed(); newLCL->setAccepted(); diff --git a/src/LedgerConsensus.h b/src/LedgerConsensus.h index 3a6aeaecde..ea77f87aff 100644 --- a/src/LedgerConsensus.h +++ b/src/LedgerConsensus.h @@ -2,7 +2,6 @@ #define __LEDGER_CONSENSUS__ #include -#include #include #include @@ -114,7 +113,7 @@ protected: void removePosition(LedgerProposal&, bool ours); void sendHaveTxSet(const std::vector& txSetHashes); void applyTransactions(SHAMap::pointer transactionSet, Ledger::pointer targetLedger, - std::deque& failedTransactions); + std::list& failedTransactions); // manipulating our own position void takeInitialPosition(Ledger::pointer initialLedger);