diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-02-21 00:48:14 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-02-21 00:48:14 +0200 |
commit | fb9e4e15edac48ce80da2e4c9aba1cb57a46c787 (patch) | |
tree | 6a09fc227edd499d46a513ff98fb641eae1dd52c | |
parent | Merge pull request #1719 (diff) | |
parent | tx_pool: revert template filling changes (diff) | |
download | monero-fb9e4e15edac48ce80da2e4c9aba1cb57a46c787.tar.xz |
Merge pull request #1752
c3283093 tx_pool: revert template filling changes (moneromooo-monero)
-rw-r--r-- | src/cryptonote_core/tx_pool.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index f48be1ff1..baceb1cb2 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -619,7 +619,11 @@ namespace cryptonote get_block_reward(median_size, total_size, already_generated_coins, best_coinbase, version); +#if 1 + size_t max_total_size = (130 * median_size) / 100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE; +#else size_t max_total_size = 2 * median_size - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE; +#endif std::unordered_set<crypto::key_image> k_images; LOG_PRINT_L2("Filling block template, median size " << median_size << ", " << m_txs_by_fee_and_receive_time.size() << " txes in the pool"); @@ -637,6 +641,15 @@ namespace cryptonote continue; } +#if 1 + // If we've exceeded the penalty free size, + // stop including more tx + if (total_size > median_size) + { + LOG_PRINT_L2(" would exceed median block size"); + break; + } +#else // If we're getting lower coinbase tx, // stop including more tx uint64_t block_reward; @@ -653,6 +666,7 @@ namespace cryptonote sorted_it++; continue; } +#endif // Skip transactions that are not ready to be // included into the blockchain or that are @@ -667,7 +681,9 @@ namespace cryptonote bl.tx_hashes.push_back(tx_it->first); total_size += tx_it->second.blob_size; fee += tx_it->second.fee; +#if 0 best_coinbase = coinbase; +#endif append_key_images(k_images, tx_it->second.tx); sorted_it++; LOG_PRINT_L2(" added, new block size " << total_size << "/" << max_total_size << ", coinbase " << print_money(best_coinbase)); |