dynamic tx size scaling for tx mempool

This commit is contained in:
mydesktop 2014-05-26 20:57:50 -04:00
parent e995a7777a
commit 328a52a543

View file

@ -361,6 +361,17 @@ namespace cryptonote
// Tx size limit as in wallet2.h // Tx size limit as in wallet2.h
uint64_t upper_transaction_size_limit = ((CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE * 125) / 100) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE; uint64_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
uint64_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) BOOST_FOREACH(transactions_container::value_type& tx, m_transactions)
{ {
// Can not exceed maximum block size // Can not exceed maximum block size