From 8ceaeb0aa29245004df4eeb8e24e4972fde3cae5 Mon Sep 17 00:00:00 2001 From: BhuzOr Date: Sun, 4 Jun 2017 23:29:55 +0200 Subject: [PATCH] Fix clear_expired_transactions memory leak Backport from Steem/BitShares: https://github.com/bitshares/bitshares-core/issues/256 --- libraries/chain/db_update.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/chain/db_update.cpp b/libraries/chain/db_update.cpp index d14d5cf2..d119d486 100644 --- a/libraries/chain/db_update.cpp +++ b/libraries/chain/db_update.cpp @@ -184,8 +184,8 @@ void database::clear_expired_transactions() //Transactions must have expired by at least two forking windows in order to be removed. auto& transaction_idx = static_cast(get_mutable_index(implementation_ids, impl_transaction_object_type)); const auto& dedupe_index = transaction_idx.indices().get(); - while( (!dedupe_index.empty()) && (head_block_time() > dedupe_index.rbegin()->trx.expiration) ) - transaction_idx.remove(*dedupe_index.rbegin()); + while( (!dedupe_index.empty()) && (head_block_time() > dedupe_index.begin()->trx.expiration) ) + transaction_idx.remove(*dedupe_index.begin()); } FC_CAPTURE_AND_RETHROW() } void database::clear_expired_proposals()