aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoodleDoodleNoodleDoodleNoodleDoodleNoo <xeven77@outlook.com>2015-07-11 21:24:42 -0700
committerNoodleDoodleNoodleDoodleNoodleDoodleNoo <xeven77@outlook.com>2015-07-15 23:20:20 -0700
commit2e293a563e3c237060638670d190dce467045868 (patch)
treebd93371d28ac2797bf26eab343939380b925ef29
parentPause miner before preparing for incoming blocks (diff)
downloadmonero-2e293a563e3c237060638670d190dce467045868.tar.xz
Fixed binary size issue due to embedded checkpoint data.
Fixed OSX compilation issues due to random lmdb resize points. Fixed infinite loop bug when calling core::get_block_template(..).
Diffstat (limited to '')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp1
-rw-r--r--src/blocks/CMakeLists.txt1
-rw-r--r--src/blocks/blocks.datbin19200004 -> 0 bytes
-rw-r--r--src/blocks/checkpoints.datbin0 -> 19200004 bytes
-rw-r--r--src/cryptonote_core/CMakeLists.txt2
-rw-r--r--src/cryptonote_core/tx_pool.cpp12
-rw-r--r--src/daemon/CMakeLists.txt8
7 files changed, 15 insertions, 9 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 22f7dcd49..1304795fc 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -30,6 +30,7 @@
#include <boost/filesystem.hpp>
#include <memory> // std::unique_ptr
#include <cstring> // memcpy
+#include <random>
#include "cryptonote_core/cryptonote_format_utils.h"
#include "crypto/crypto.h"
diff --git a/src/blocks/CMakeLists.txt b/src/blocks/CMakeLists.txt
index 0ad885388..4020132a9 100644
--- a/src/blocks/CMakeLists.txt
+++ b/src/blocks/CMakeLists.txt
@@ -35,3 +35,4 @@ else()
set_target_properties(blocks PROPERTIES LINKER_LANGUAGE C)
endif()
+
diff --git a/src/blocks/blocks.dat b/src/blocks/blocks.dat
index 249956e75..e69de29bb 100644
--- a/src/blocks/blocks.dat
+++ b/src/blocks/blocks.dat
Binary files differ
diff --git a/src/blocks/checkpoints.dat b/src/blocks/checkpoints.dat
new file mode 100644
index 000000000..249956e75
--- /dev/null
+++ b/src/blocks/checkpoints.dat
Binary files differ
diff --git a/src/cryptonote_core/CMakeLists.txt b/src/cryptonote_core/CMakeLists.txt
index 564dc3210..6315fc4f0 100644
--- a/src/cryptonote_core/CMakeLists.txt
+++ b/src/cryptonote_core/CMakeLists.txt
@@ -84,7 +84,7 @@ target_link_libraries(cryptonote_core
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SERIALIZATION_LIBRARY}
LINK_PRIVATE
- ${Blocks}
+ ${Blocks}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index 12fd3fe62..ac71a0e52 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -511,8 +511,8 @@ namespace cryptonote
// Can not exceed maximum block size
if (max_total_size < total_size + tx_it->second.blob_size)
{
- sorted_it++;
- continue;
+ sorted_it++;
+ continue;
}
// If adding this tx will make the block size
@@ -522,8 +522,8 @@ namespace cryptonote
// to propagate at 60s block times.
if ( (total_size + tx_it->second.blob_size) > CRYPTONOTE_GETBLOCKTEMPLATE_MAX_BLOCK_SIZE )
{
- sorted_it++;
- continue;
+ sorted_it++;
+ continue;
}
// If we've exceeded the penalty free size,
@@ -536,8 +536,8 @@ namespace cryptonote
// missing key images
if (!is_transaction_ready_to_go(tx_it->second) || have_key_images(k_images, tx_it->second.tx))
{
- sorted_it++;
- continue;
+ sorted_it++;
+ continue;
}
bl.tx_hashes.push_back(tx_it->first);
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index 8275429db..90befa8d1 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -27,8 +27,12 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(blocksdat "")
-if(APPLE AND PER_BLOCK_CHECKPOINT)
- add_custom_command(OUTPUT blocksdat.o COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ${CMAKE_C_COMPILER} -o stub.o -c stub.c COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ld -r -sectcreate __DATA __blocks_dat ../blocks/blocks.dat -o ${CMAKE_CURRENT_BINARY_DIR}/blocksdat.o stub.o)
+if(PER_BLOCK_CHECKPOINT)
+ if(APPLE)
+ add_custom_command(OUTPUT blocksdat.o COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && touch stub.c && ${CMAKE_C_COMPILER} -o stub.o -c stub.c COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ld -r -sectcreate __DATA __blocks_dat ../blocks/checkpoints.dat -o ${CMAKE_CURRENT_BINARY_DIR}/blocksdat.o stub.o && rm -f stub.*)
+ else()
+ add_custom_command(OUTPUT blocksdat.o COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && cp ../blocks/checkpoints.dat blocks.dat && ld -r -b binary -o ${CMAKE_CURRENT_BINARY_DIR}/blocksdat.o blocks.dat && rm -f blocks.dat)
+ endif()
set(blocksdat "blocksdat.o")
endif()