aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormydesktop <dev.mc2@gmail.com>2014-05-26 20:57:50 -0400
committermydesktop <dev.mc2@gmail.com>2014-05-26 20:57:50 -0400
commit328a52a5438435666ba3564afe73e866aae2b5c9 (patch)
tree88993b36c83ebc55069c1d20ef5d6046149c3b57 /src
parentMerge remote-tracking branch 'origin/master' into 0.8.8update (diff)
downloadmonero-328a52a5438435666ba3564afe73e866aae2b5c9.tar.xz
dynamic tx size scaling for tx mempool
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/tx_pool.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index a95002dc8..5eb99db40 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -361,6 +361,17 @@ namespace cryptonote
// 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;
+ // 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)
{
// Can not exceed maximum block size