diff options
author | NoodleDoodleNoodleDoodleNoodleDoodleNoo <NoodleDoodleNoodleDoodleNoodleDoodleNoo@users.noreply.github.com> | 2015-07-10 22:09:21 -0700 |
---|---|---|
committer | NoodleDoodleNoodleDoodleNoodleDoodleNoo <NoodleDoodleNoodleDoodleNoodleDoodleNoo@users.noreply.github.com> | 2015-07-10 22:09:21 -0700 |
commit | 5d304cabfd35a58ccece0d9728d5459db3e7adf1 (patch) | |
tree | 11bcf8331fabd6df2200b407e1007d5a48128a37 /src/cryptonote_core/tx_pool.cpp | |
parent | Merge pull request #331 (diff) | |
download | monero-5d304cabfd35a58ccece0d9728d5459db3e7adf1.tar.xz |
Fix loop bug when calling core::get_block_template, causing calling thread to lock up.
Diffstat (limited to 'src/cryptonote_core/tx_pool.cpp')
-rw-r--r-- | src/cryptonote_core/tx_pool.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 6dea31c7c..f6dbf1414 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -503,7 +503,10 @@ namespace cryptonote // Can not exceed maximum block size if (max_total_size < total_size + tx_it->second.blob_size) + { + sorted_it++; continue; + } // If adding this tx will make the block size // greater than CRYPTONOTE_GETBLOCKTEMPLATE_MAX @@ -511,7 +514,10 @@ namespace cryptonote // keep block sizes from becoming too unwieldly // to propagate at 60s block times. if ( (total_size + tx_it->second.blob_size) > CRYPTONOTE_GETBLOCKTEMPLATE_MAX_BLOCK_SIZE ) + { + sorted_it++; continue; + } // If we've exceeded the penalty free size, // stop including more tx @@ -522,7 +528,10 @@ namespace cryptonote // included into the blockchain or that are // missing key images if (!is_transaction_ready_to_go(tx_it->second) || have_key_images(k_images, tx_it->second.tx)) + { + sorted_it++; continue; + } bl.tx_hashes.push_back(tx_it->first); total_size += tx_it->second.blob_size; |