未验证 提交 8cc500ee 编写于 作者: D Daniel Larimer 提交者: GitHub

Merge pull request #2161 from EOSIO/chainbase_txn_container_expiry_ordering

Fix DB memory leak in transaction containers
......@@ -1885,15 +1885,16 @@ void chain_controller::clear_expired_transactions()
//transactions must have expired by at least two forking windows in order to be removed.
auto& transaction_idx = _db.get_mutable_index<transaction_multi_index>();
const auto& dedupe_index = transaction_idx.indices().get<by_expiration>();
while( (!dedupe_index.empty()) && (head_block_time() > fc::time_point(dedupe_index.rbegin()->expiration) ) )
transaction_idx.remove(*dedupe_index.rbegin());
while( (!dedupe_index.empty()) && (head_block_time() > fc::time_point(dedupe_index.begin()->expiration) ) ) {
transaction_idx.remove(*dedupe_index.begin());
}
//Look for expired transactions in the pending generated list, and remove them.
//transactions must have expired by at least two forking windows in order to be removed.
auto& generated_transaction_idx = _db.get_mutable_index<generated_transaction_multi_index>();
const auto& generated_index = generated_transaction_idx.indices().get<by_expiration>();
while( (!generated_index.empty()) && (head_block_time() > generated_index.rbegin()->expiration) ) {
_destroy_generated_transaction(*generated_index.rbegin());
while( (!generated_index.empty()) && (head_block_time() > generated_index.begin()->expiration) ) {
_destroy_generated_transaction(*generated_index.begin());
}
} FC_CAPTURE_AND_RETHROW() }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册