From 85a04cb16866b66df4330e7ee770793cf6b2cf53 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 10:27:37 -0400 Subject: [PATCH 01/12] Make some tx_pool methods private --- src/cryptonote_core/tx_pool.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h index 649af41a3..72eff378d 100644 --- a/src/cryptonote_core/tx_pool.h +++ b/src/cryptonote_core/tx_pool.h @@ -36,9 +36,6 @@ namespace cryptonote bool take_tx(const crypto::hash &id, transaction &tx, size_t& blob_size, uint64_t& fee); bool have_tx(const crypto::hash &id); - bool have_tx_keyimg_as_spent(const crypto::key_image& key_im); - bool have_tx_keyimges_as_spent(const transaction& tx); - bool on_blockchain_inc(uint64_t new_block_height, const crypto::hash& top_block_id); bool on_blockchain_dec(uint64_t new_block_height, const crypto::hash& top_block_id); void on_idle(); @@ -53,9 +50,6 @@ namespace cryptonote bool get_transactions(std::list& txs); bool get_transaction(const crypto::hash& h, transaction& tx); size_t get_transactions_count(); - bool remove_transaction_keyimages(const transaction& tx); - bool have_key_images(const std::unordered_set& kic, const transaction& tx); - bool append_key_images(std::unordered_set& kic, const transaction& tx); std::string print_pool(bool short_format); /*bool flush_pool(const std::strig& folder); @@ -89,6 +83,12 @@ namespace cryptonote private: bool remove_stuck_transactions(); + bool have_tx_keyimg_as_spent(const crypto::key_image& key_im); + bool have_tx_keyimges_as_spent(const transaction& tx); + bool remove_transaction_keyimages(const transaction& tx); + bool have_key_images(const std::unordered_set& kic, const transaction& tx); + bool append_key_images(std::unordered_set& kic, const transaction& tx); + bool is_transaction_ready_to_go(tx_details& txd); typedef std::unordered_map transactions_container; typedef std::unordered_map > key_images_container; From 9872d205ff8fb1c961cd335c760ebf238c25ab9a Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 10:47:17 -0400 Subject: [PATCH 02/12] Make some tx_pool methods static --- src/cryptonote_core/tx_pool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h index 72eff378d..6bb6189ec 100644 --- a/src/cryptonote_core/tx_pool.h +++ b/src/cryptonote_core/tx_pool.h @@ -86,8 +86,8 @@ namespace cryptonote bool have_tx_keyimg_as_spent(const crypto::key_image& key_im); bool have_tx_keyimges_as_spent(const transaction& tx); bool remove_transaction_keyimages(const transaction& tx); - bool have_key_images(const std::unordered_set& kic, const transaction& tx); - bool append_key_images(std::unordered_set& kic, const transaction& tx); + static bool have_key_images(const std::unordered_set& kic, const transaction& tx); + static bool append_key_images(std::unordered_set& kic, const transaction& tx); bool is_transaction_ready_to_go(tx_details& txd); typedef std::unordered_map transactions_container; From 4d25350a823866a602dca84847f7d7e3b810c823 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 10:31:44 -0400 Subject: [PATCH 03/12] Use const where appropriate in tx_pool --- src/cryptonote_core/cryptonote_core.cpp | 3 +- src/cryptonote_core/tx_pool.cpp | 61 ++++++++++--------------- src/cryptonote_core/tx_pool.h | 22 ++++----- 3 files changed, 36 insertions(+), 50 deletions(-) diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 2a0129f4e..751d12f79 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -452,7 +452,8 @@ namespace cryptonote //----------------------------------------------------------------------------------------------- bool core::get_pool_transactions(std::list& txs) { - return m_mempool.get_transactions(txs); + m_mempool.get_transactions(txs); + return true; } //----------------------------------------------------------------------------------------------- bool core::get_short_chain_history(std::list& ids) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index bf932404a..11e899c1c 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -204,22 +204,20 @@ namespace cryptonote return true; } //--------------------------------------------------------------------------------- - size_t tx_memory_pool::get_transactions_count() + size_t tx_memory_pool::get_transactions_count() const { CRITICAL_REGION_LOCAL(m_transactions_lock); return m_transactions.size(); } //--------------------------------------------------------------------------------- - bool tx_memory_pool::get_transactions(std::list& txs) + void tx_memory_pool::get_transactions(std::list& txs) const { CRITICAL_REGION_LOCAL(m_transactions_lock); BOOST_FOREACH(const auto& tx_vt, m_transactions) txs.push_back(tx_vt.second.tx); - - return true; } //--------------------------------------------------------------------------------- - bool tx_memory_pool::get_transaction(const crypto::hash& id, transaction& tx) + bool tx_memory_pool::get_transaction(const crypto::hash& id, transaction& tx) const { CRITICAL_REGION_LOCAL(m_transactions_lock); auto it = m_transactions.find(id); @@ -239,7 +237,7 @@ namespace cryptonote return true; } //--------------------------------------------------------------------------------- - bool tx_memory_pool::have_tx(const crypto::hash &id) + bool tx_memory_pool::have_tx(const crypto::hash &id) const { CRITICAL_REGION_LOCAL(m_transactions_lock); if(m_transactions.count(id)) @@ -247,7 +245,7 @@ namespace cryptonote return false; } //--------------------------------------------------------------------------------- - bool tx_memory_pool::have_tx_keyimges_as_spent(const transaction& tx) + bool tx_memory_pool::have_tx_keyimges_as_spent(const transaction& tx) const { CRITICAL_REGION_LOCAL(m_transactions_lock); BOOST_FOREACH(const auto& in, tx.vin) @@ -259,23 +257,23 @@ namespace cryptonote return false; } //--------------------------------------------------------------------------------- - bool tx_memory_pool::have_tx_keyimg_as_spent(const crypto::key_image& key_im) + bool tx_memory_pool::have_tx_keyimg_as_spent(const crypto::key_image& key_im) const { CRITICAL_REGION_LOCAL(m_transactions_lock); return m_spent_key_images.end() != m_spent_key_images.find(key_im); } //--------------------------------------------------------------------------------- - void tx_memory_pool::lock() + void tx_memory_pool::lock() const { m_transactions_lock.lock(); } //--------------------------------------------------------------------------------- - void tx_memory_pool::unlock() + void tx_memory_pool::unlock() const { m_transactions_lock.unlock(); } //--------------------------------------------------------------------------------- - bool tx_memory_pool::is_transaction_ready_to_go(tx_details& txd) + bool tx_memory_pool::is_transaction_ready_to_go(tx_details& txd) const { //not the best implementation at this time, sorry :( //check is ring_signature already checked ? @@ -339,38 +337,25 @@ namespace cryptonote return true; } //--------------------------------------------------------------------------------- - std::string tx_memory_pool::print_pool(bool short_format) + std::string tx_memory_pool::print_pool(bool short_format) const { std::stringstream ss; CRITICAL_REGION_LOCAL(m_transactions_lock); - BOOST_FOREACH(transactions_container::value_type& txe, m_transactions) - { - if(short_format) - { - tx_details& txd = txe.second; - ss << "id: " << txe.first << ENDL - << "blob_size: " << txd.blob_size << ENDL - << "fee: " << txd.fee << ENDL - << "kept_by_block: " << (txd.kept_by_block ? "true":"false") << ENDL - << "max_used_block_height: " << txd.max_used_block_height << ENDL - << "max_used_block_id: " << txd.max_used_block_id << ENDL - << "last_failed_height: " << txd.last_failed_height << ENDL - << "last_failed_id: " << txd.last_failed_id << ENDL; - }else - { - tx_details& txd = txe.second; - ss << "id: " << txe.first << ENDL - << obj_to_json_str(txd.tx) << ENDL - << "blob_size: " << txd.blob_size << ENDL - << "fee: " << txd.fee << ENDL - << "kept_by_block: " << (txd.kept_by_block ? "true":"false") << ENDL - << "max_used_block_height: " << txd.max_used_block_height << ENDL - << "max_used_block_id: " << txd.max_used_block_id << ENDL - << "last_failed_height: " << txd.last_failed_height << ENDL - << "last_failed_id: " << txd.last_failed_id << ENDL; + for (const transactions_container::value_type& txe : m_transactions) { + const tx_details& txd = txe.second; + ss << "id: " << txe.first << std::endl; + if (!short_format) { + ss << obj_to_json_str(*const_cast(&txd.tx)) << std::endl; } - + ss << "blob_size: " << txd.blob_size << std::endl + << "fee: " << print_money(txd.fee) << std::endl + << "kept_by_block: " << (txd.kept_by_block ? 'T' : 'F') << std::endl + << "max_used_block_height: " << txd.max_used_block_height << std::endl + << "max_used_block_id: " << txd.max_used_block_id << std::endl + << "last_failed_height: " << txd.last_failed_height << std::endl + << "last_failed_id: " << txd.last_failed_id << std::endl; } + return ss.str(); } //--------------------------------------------------------------------------------- diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h index 6bb6189ec..91fc18b5b 100644 --- a/src/cryptonote_core/tx_pool.h +++ b/src/cryptonote_core/tx_pool.h @@ -35,22 +35,22 @@ namespace cryptonote //gets tx and remove it from pool bool take_tx(const crypto::hash &id, transaction &tx, size_t& blob_size, uint64_t& fee); - bool have_tx(const crypto::hash &id); + bool have_tx(const crypto::hash &id) const; bool on_blockchain_inc(uint64_t new_block_height, const crypto::hash& top_block_id); bool on_blockchain_dec(uint64_t new_block_height, const crypto::hash& top_block_id); void on_idle(); - void lock(); - void unlock(); + void lock() const; + void unlock() const; // load/store operations bool init(const std::string& config_folder); bool deinit(); bool fill_block_template(block &bl, size_t median_size, uint64_t already_generated_coins, size_t &total_size, uint64_t &fee); - bool get_transactions(std::list& txs); - bool get_transaction(const crypto::hash& h, transaction& tx); - size_t get_transactions_count(); - std::string print_pool(bool short_format); + void get_transactions(std::list& txs) const; + bool get_transaction(const crypto::hash& h, transaction& tx) const; + size_t get_transactions_count() const; + std::string print_pool(bool short_format) const; /*bool flush_pool(const std::strig& folder); bool inflate_pool(const std::strig& folder);*/ @@ -83,17 +83,17 @@ namespace cryptonote private: bool remove_stuck_transactions(); - bool have_tx_keyimg_as_spent(const crypto::key_image& key_im); - bool have_tx_keyimges_as_spent(const transaction& tx); + bool have_tx_keyimg_as_spent(const crypto::key_image& key_im) const; + bool have_tx_keyimges_as_spent(const transaction& tx) const; bool remove_transaction_keyimages(const transaction& tx); static bool have_key_images(const std::unordered_set& kic, const transaction& tx); static bool append_key_images(std::unordered_set& kic, const transaction& tx); - bool is_transaction_ready_to_go(tx_details& txd); + bool is_transaction_ready_to_go(tx_details& txd) const; typedef std::unordered_map transactions_container; typedef std::unordered_map > key_images_container; - epee::critical_section m_transactions_lock; + mutable epee::critical_section m_transactions_lock; transactions_container m_transactions; key_images_container m_spent_key_images; epee::math_helper::once_a_time_seconds<30> m_remove_stuck_tx_interval; From a3f57648696c522a65fed2cde151a43eab17980d Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 11:02:05 -0400 Subject: [PATCH 04/12] Add transaction size limit Transactions larger than the limit will not enter the pool --- src/cryptonote_core/tx_pool.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 11e899c1c..5927c9587 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -22,6 +22,11 @@ DISABLE_VS_WARNINGS(4244 4345 4503) //'boost::foreach_detail_::or_' : decorated namespace cryptonote { + namespace + { + size_t const TRANSACTION_SIZE_LIMIT = (((CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE * 125) / 100) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE); + } + //--------------------------------------------------------------------------------- tx_memory_pool::tx_memory_pool(blockchain_storage& bchs): m_blockchain(bchs) { @@ -54,6 +59,13 @@ namespace cryptonote return false; } + if (!kept_by_block && blob_size >= TRANSACTION_SIZE_LIMIT) + { + LOG_ERROR("transaction is too big: " << blob_size << " bytes, maximum size: " << TRANSACTION_SIZE_LIMIT); + tvc.m_verifivation_failed = true; + return false; + } + //check key images for transaction if it is not kept by block if(!kept_by_block) { @@ -446,6 +458,8 @@ namespace cryptonote //--------------------------------------------------------------------------------- bool tx_memory_pool::init(const std::string& config_folder) { + CRITICAL_REGION_LOCAL(m_transactions_lock); + m_config_folder = config_folder; std::string state_file_path = config_folder + "/" + CRYPTONOTE_POOLDATA_FILENAME; boost::system::error_code ec; @@ -456,6 +470,16 @@ namespace cryptonote { LOG_PRINT_L0("Failed to load memory pool from file " << state_file_path); } + + for (auto it = m_transactions.begin(); it != m_transactions.end(); ) { + auto it2 = it++; + if (it2->second.blob_size >= TRANSACTION_SIZE_LIMIT) { + LOG_PRINT_L0("Transaction " << get_transaction_hash(it2->second.tx) << " is too big (" << it2->second.blob_size << " bytes), removing it from pool"); + remove_transaction_keyimages(it2->second.tx); + m_transactions.erase(it2); + } + } + return res; } From 8e99cee062c1398ba9d734d0e603a6dbd78a815a Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 11:04:13 -0400 Subject: [PATCH 05/12] Start fresh if tx_pool deserialize fails --- src/cryptonote_core/tx_pool.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 5927c9587..dc71bd918 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -468,7 +468,10 @@ namespace cryptonote bool res = tools::unserialize_obj_from_file(*this, state_file_path); if(!res) { - LOG_PRINT_L0("Failed to load memory pool from file " << state_file_path); + LOG_ERROR("Failed to load memory pool from file " << state_file_path); + + m_transactions.clear(); + m_spent_key_images.clear(); } for (auto it = m_transactions.begin(); it != m_transactions.end(); ) { @@ -480,7 +483,8 @@ namespace cryptonote } } - return res; + // Ignore deserialization error + return true; } //--------------------------------------------------------------------------------- From d9f3421ce75ca4e429c0df2fd77993ff33f90289 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 11:05:46 -0400 Subject: [PATCH 06/12] Minimum tx fee for entering pool --- src/cryptonote_core/tx_pool.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index dc71bd918..3c924d5e8 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -59,6 +59,14 @@ namespace cryptonote return false; } + uint64_t fee = inputs_amount - outputs_amount; + if (!kept_by_block && fee < DEFAULT_FEE) + { + LOG_ERROR("transaction fee is not enough: " << print_money(fee) << ", minumim fee: " << print_money(DEFAULT_FEE)); + tvc.m_verifivation_failed = true; + return false; + } + if (!kept_by_block && blob_size >= TRANSACTION_SIZE_LIMIT) { LOG_ERROR("transaction is too big: " << blob_size << " bytes, maximum size: " << TRANSACTION_SIZE_LIMIT); From c017bb06566c2ef2f3aed29cbe2050ca264ecb2c Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 11:10:27 -0400 Subject: [PATCH 07/12] Use print_money in log --- src/cryptonote_core/tx_pool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 3c924d5e8..0c13a508c 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -54,7 +54,7 @@ namespace cryptonote if(outputs_amount >= inputs_amount) { - LOG_PRINT_L0("transaction use more money then it has: use " << outputs_amount << ", have " << inputs_amount); + LOG_PRINT_L0("transaction use more money then it has: use " << print_money(outputs_amount) << ", have " << print_money(inputs_amount)); tvc.m_verifivation_failed = true; return false; } From 232e23e90f9d959d55114150ea120d3da0e76b22 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 11:14:13 -0400 Subject: [PATCH 08/12] Decrease max block size from 200% median to 130% --- src/cryptonote_core/tx_pool.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 0c13a508c..406df8bd7 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -390,7 +390,9 @@ namespace cryptonote total_size = 0; fee = 0; - size_t max_total_size = 2 * median_size - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE; // Max block size + // Maximum block size is 130% of the median block size. This gives a + // little extra headroom for the max size transaction. + size_t max_total_size = (130 * median_size) / 100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE; std::unordered_set k_images; // Tx size limit as in wallet2.h From e3b8c58496a012767bd7affd70bb653d8464c104 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 17:10:35 -0400 Subject: [PATCH 09/12] Don't check for min fee when adding tx to block This is now done when transactions enter the pool. --- src/cryptonote_core/tx_pool.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 406df8bd7..38f7f29cd 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -418,11 +418,6 @@ namespace cryptonote if (max_total_size < total_size + tx.second.blob_size) continue; - // Check to see if the minimum fee is included; - // exclude tx missing minimum fee - if (tx.second.fee < DEFAULT_FEE) - continue; - // Skip transactions that are too large // TODO: Correct upper_transactions_size_limit // such that it is based on median block size; From 23c914ccfe471d3c46b5a294f14acc9db5ec4a92 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 17:11:21 -0400 Subject: [PATCH 10/12] Don't check max tx size when adding to block This is now done when adding transactions to the pool. --- src/cryptonote_core/tx_pool.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 38f7f29cd..5f2bc1571 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -418,14 +418,6 @@ namespace cryptonote if (max_total_size < total_size + tx.second.blob_size) continue; - // Skip transactions that are too large - // TODO: Correct upper_transactions_size_limit - // such that it is based on median block size; - // We need to make a similar patch for - // wallet2.h - if (tx.second.blob_size > upper_transaction_size_limit) - continue; - // If adding this tx will make the block size // greater than CRYPTONOTE_GETBLOCKTEMPLATE_MAX // _BLOCK_SIZE bytes, reject the tx; this will From e48cf2a3a9c361b3c338598c0a5992186fe496dd Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 18:47:18 -0400 Subject: [PATCH 11/12] Remove second tx size check --- src/cryptonote_core/tx_pool.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 5f2bc1571..b72562b89 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -426,13 +426,6 @@ namespace cryptonote if ( (total_size + tx.second.blob_size) > CRYPTONOTE_GETBLOCKTEMPLATE_MAX_BLOCK_SIZE ) continue; - // If adding this tx will make the block size - // greater than 130% of the median, reject the - // tx; this will keep down largely punitive tx - // from being included - if ( (total_size + tx.second.blob_size) > ((130 * median_size) / 100) ) - continue; - // If we've exceeded the penalty free size, // stop including more tx if (total_size > median_size) From 61e447f7c8fd530cd8c36852c01b2d2b3f059ae1 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 17 Jul 2014 19:18:24 -0400 Subject: [PATCH 12/12] Remove dead code --- src/cryptonote_core/tx_pool.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index b72562b89..5dd86c797 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -395,23 +395,6 @@ namespace cryptonote size_t max_total_size = (130 * median_size) / 100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE; std::unordered_set k_images; - // Tx size limit as in wallet2.h - // tx_pool.cpp uses size_t for tx sizes, whereas - // wallet2.h uses uint64_t; just use size_t here - // for now - size_t upper_transaction_size_limit = ((CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE * 125) / 100) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE; - - // Calculate size limit based on median too; useful - // for when we actually fix wallet2.h's maximum - // allowable tx size - // - // Can be removed when wallet2.h calculates max - // tx size based on the median too; just use - // upper_transaction_size_limit_median in all cases - size_t upper_transaction_size_limit_median = ((median_size * 125) / 100) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE; - if (upper_transaction_size_limit_median > upper_transaction_size_limit) - upper_transaction_size_limit = upper_transaction_size_limit_median; - BOOST_FOREACH(transactions_container::value_type& tx, m_transactions) { // Can not exceed maximum block size