aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/tx_pool.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-03-14 19:28:38 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-03-15 08:32:51 +0000
commit3396a9f2aff1b4e3c12a663e0458934c8d42b32f (patch)
treeaaa35be649ba8203f65ebe5c9309af3e64555e40 /src/cryptonote_core/tx_pool.cpp
parentMerge pull request #1857 (diff)
downloadmonero-3396a9f2aff1b4e3c12a663e0458934c8d42b32f.tar.xz
Add intervening v5 fork for increased min block size
Minimum mixin 4 and enforced ringct is moved from v5 to v6. v5 is now used for an increased minimum block size (from 60000 to 300000) to cater for larger typical/minimum transaction size. The fee algorithm is also changed to decrease the base per kB fee, and add a cheap tier for those transactions which we do not care if they get delayed (or even included in a block).
Diffstat (limited to 'src/cryptonote_core/tx_pool.cpp')
-rw-r--r--src/cryptonote_core/tx_pool.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index e943c961d..4dd2832ac 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -59,8 +59,6 @@ namespace cryptonote
// codebase. As it stands, it is at best nontrivial to test
// whether or not changing these parameters (or adding new)
// will work correctly.
- size_t const TRANSACTION_SIZE_LIMIT_V1 = (((CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1 * 125) / 100) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE);
- size_t const TRANSACTION_SIZE_LIMIT_V2 = (((CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2 * 125) / 100) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE);
time_t const MIN_RELAY_TIME = (60 * 5); // only start re-relaying transactions after that many seconds
time_t const MAX_RELAY_TIME = (60 * 60 * 4); // at most that many seconds between resends
float const ACCEPT_THRESHOLD = 1.0f;
@@ -78,6 +76,11 @@ namespace cryptonote
{
return amount * ACCEPT_THRESHOLD;
}
+
+ uint64_t get_transaction_size_limit(uint8_t version)
+ {
+ return get_min_block_size(version) * 125 / 100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
+ }
}
//---------------------------------------------------------------------------------
//---------------------------------------------------------------------------------
@@ -149,7 +152,7 @@ namespace cryptonote
return false;
}
- size_t tx_size_limit = (version < 2 ? TRANSACTION_SIZE_LIMIT_V1 : TRANSACTION_SIZE_LIMIT_V2);
+ size_t tx_size_limit = get_transaction_size_limit(version);
if (!kept_by_block && blob_size >= tx_size_limit)
{
LOG_PRINT_L1("transaction is too big: " << blob_size << " bytes, maximum size: " << tx_size_limit);
@@ -641,15 +644,6 @@ 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;
@@ -666,7 +660,6 @@ namespace cryptonote
sorted_it++;
continue;
}
-#endif
// Skip transactions that are not ready to be
// included into the blockchain or that are
@@ -705,7 +698,7 @@ namespace cryptonote
{
CRITICAL_REGION_LOCAL(m_transactions_lock);
size_t n_removed = 0;
- size_t tx_size_limit = (version < 2 ? TRANSACTION_SIZE_LIMIT_V1 : TRANSACTION_SIZE_LIMIT_V2);
+ size_t tx_size_limit = get_transaction_size_limit(version);
for (auto it = m_transactions.begin(); it != m_transactions.end(); ) {
if (it->second.blob_size >= tx_size_limit) {
LOG_PRINT_L1("Transaction " << get_transaction_hash(it->second.tx) << " is too big (" << it->second.blob_size << " bytes), removing it from pool");