From eba62452c007623bf559e836cbe7e9f2f66a35e9 Mon Sep 17 00:00:00 2001 From: mydesktop Date: Thu, 26 Jun 2014 16:42:24 -0400 Subject: set max block size for gbt --- src/cryptonote_core/tx_pool.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/cryptonote_core/tx_pool.cpp') diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 1778c590a..bf932404a 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -424,6 +424,14 @@ namespace cryptonote 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 + // keep block sizes from becoming too unwieldly + // to propagate at 60s block times. + 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 -- cgit v1.2.3