From 85cd5bc47f506240fb44282eae52c507dfb9fce0 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Thu, 28 Feb 2013 19:41:03 -0800 Subject: [PATCH] Fix the bug that crashed ec2. Must hold a TransactionAcquire::pointer to call a function that calls erase. --- src/cpp/ripple/LedgerConsensus.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpp/ripple/LedgerConsensus.cpp b/src/cpp/ripple/LedgerConsensus.cpp index 79fe9f9454..a2e56d5cbf 100644 --- a/src/cpp/ripple/LedgerConsensus.cpp +++ b/src/cpp/ripple/LedgerConsensus.cpp @@ -1044,7 +1044,10 @@ bool LedgerConsensus::peerHasSet(Peer::ref peer, const uint256& hashSet, ripple: set.push_back(peer); boost::unordered_map::iterator acq = mAcquiring.find(hashSet); if (acq != mAcquiring.end()) - acq->second->peerHas(peer); + { + TransactionAcquire::pointer ta = acq->second; // make sure it doesn't go away + ta->peerHas(peer); + } return true; }