diff --git a/Ledger.cpp b/Ledger.cpp index d09612f17c..dd3883d42d 100644 --- a/Ledger.cpp +++ b/Ledger.cpp @@ -468,7 +468,9 @@ Ledger::pointer Ledger::switchPreviousLedger(Ledger::pointer oldPrevious, Ledger if(!tx || newLedger->addTransaction(tx)) { count++; - TxnDiff.erase(++it); + std::map >::iterator it2=it; + ++it; + TxnDiff.erase(it2); } else ++it; } @@ -492,7 +494,9 @@ Ledger::pointer Ledger::switchPreviousLedger(Ledger::pointer oldPrevious, Ledger if(newLedger->addTransaction(it->second)) { count++; - txnMap.erase(++it); + std::map::iterator it2=it; + ++it; + txnMap.erase(it2); } else ++it; }