From c050ff43bf5a8310b18081c5cd3d9bcd123416b8 Mon Sep 17 00:00:00 2001 From: monero-project Date: Tue, 24 Jun 2014 13:20:15 -0400 Subject: [PATCH 1/5] Fix copy/paste bug, thx Boolberry --- src/cryptonote_core/tx_pool.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index ce1bc1ad2..7f2caaaca 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -152,7 +152,7 @@ namespace cryptonote << "transaction id = " << get_transaction_hash(tx)); auto it_in_set = key_image_set.find(get_transaction_hash(tx)); - CHECK_AND_ASSERT_MES(key_image_set.size(), false, "transaction id not found in key_image set, img=" << txin.k_image << ENDL + CHECK_AND_ASSERT_MES(it_in_set != key_image_set.end, false, "transaction id not found in key_image set, img=" << txin.k_image << ENDL << "transaction id = " << get_transaction_hash(tx)); key_image_set.erase(it_in_set); if(!key_image_set.size()) @@ -351,7 +351,7 @@ namespace cryptonote ss << "id: " << txe.first << ENDL << "blob_size: " << txd.blob_size << ENDL << "fee: " << txd.fee << ENDL - << "kept_by_block: " << txd.kept_by_block << ENDL + << "kept_by_block: " << (txd.kept_by_block ? "true":"false") << ENDL << "max_used_block_height: " << txd.max_used_block_height << ENDL << "max_used_block_id: " << txd.max_used_block_id << ENDL << "last_failed_height: " << txd.last_failed_height << ENDL @@ -363,7 +363,7 @@ namespace cryptonote << obj_to_json_str(txd.tx) << ENDL << "blob_size: " << txd.blob_size << ENDL << "fee: " << txd.fee << ENDL - << "kept_by_block: " << txd.kept_by_block << ENDL + << "kept_by_block: " << (txd.kept_by_block ? "true":"false") << ENDL << "max_used_block_height: " << txd.max_used_block_height << ENDL << "max_used_block_id: " << txd.max_used_block_id << ENDL << "last_failed_height: " << txd.last_failed_height << ENDL From 2a2b36d425490199815614f536151e1eb1d7fb5d Mon Sep 17 00:00:00 2001 From: monero-project Date: Tue, 24 Jun 2014 13:30:41 -0400 Subject: [PATCH 2/5] fix function typo --- src/cryptonote_core/tx_pool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 7f2caaaca..1778c590a 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -152,7 +152,7 @@ namespace cryptonote << "transaction id = " << get_transaction_hash(tx)); auto it_in_set = key_image_set.find(get_transaction_hash(tx)); - CHECK_AND_ASSERT_MES(it_in_set != key_image_set.end, false, "transaction id not found in key_image set, img=" << txin.k_image << ENDL + CHECK_AND_ASSERT_MES(it_in_set != key_image_set.end(), false, "transaction id not found in key_image set, img=" << txin.k_image << ENDL << "transaction id = " << get_transaction_hash(tx)); key_image_set.erase(it_in_set); if(!key_image_set.size()) From eba62452c007623bf559e836cbe7e9f2f66a35e9 Mon Sep 17 00:00:00 2001 From: mydesktop Date: Thu, 26 Jun 2014 16:42:24 -0400 Subject: [PATCH 3/5] set max block size for gbt --- src/cryptonote_config.h | 1 + src/cryptonote_core/tx_pool.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 295f59e51..d271d2e4a 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -6,6 +6,7 @@ #define CRYPTONOTE_MAX_BLOCK_NUMBER 500000000 #define CRYPTONOTE_MAX_BLOCK_SIZE 500000000 // block header blob limit, never used! +#define CRYPTONOTE_GETBLOCKTEMPLATE_MAX_BLOCK_SIZE 196608 //size of block (bytes) that is the maximum that miners will produce #define CRYPTONOTE_MAX_TX_SIZE 1000000000 #define CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER 0 #define CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX 18 // addresses start with "4" 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 From b87577f4441fd53d513ecf64a905104db3db20e2 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Sun, 29 Jun 2014 18:04:29 -0600 Subject: [PATCH 4/5] Do not fall over when refreshing balance fails --- src/wallet/wallet2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index a63eb4be7..7f8bb65fd 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -309,7 +309,8 @@ void wallet2::refresh(size_t & blocks_fetched, bool& received_money) else { LOG_ERROR("pull_blocks failed, try_count=" << try_count); - throw; + //throw; + return; } } } From 55721da1fd2491891a5a7e8ff48daccf28c76abe Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Mon, 30 Jun 2014 06:45:20 -0400 Subject: [PATCH 5/5] Revert "Do not fall over when refreshing balance fails" --- src/wallet/wallet2.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 7f8bb65fd..a63eb4be7 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -309,8 +309,7 @@ void wallet2::refresh(size_t & blocks_fetched, bool& received_money) else { LOG_ERROR("pull_blocks failed, try_count=" << try_count); - //throw; - return; + throw; } } }