From 2f44547e0dc4a5ffd3da14caa6b605d422d62573 Mon Sep 17 00:00:00 2001 From: Albert Werner Date: Tue, 24 Jun 2014 23:30:02 +0400 Subject: [PATCH] Minor fixies in comments --- src/cryptonote_config.h | 7 +++++-- src/cryptonote_core/blockchain_storage.cpp | 5 +++++ src/cryptonote_core/cryptonote_format_utils.cpp | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 10ed7713..25fd1caa 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -25,18 +25,21 @@ #define MONEY_SUPPLY #define EMISSION_SPEED_FACTOR (18) +//TODO Define number of blocks for block size median calculation #define CRYPTONOTE_REWARD_BLOCKS_WINDOW 100 #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE 10000 //size of block (bytes) after which reward for block calculated using block size #define CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE 600 -#define CRYPTONOTE_DISPLAY_DECIMAL_POINT 8 +//TODO Define number of digits +#define CRYPTONOTE_DISPLAY_DECIMAL_POINT //TODO Define number of smallest units in one coin #define COIN //TODO Define default fee for transactions #define DEFAULT_FEE +//TODO Define preferred block's target time +#define DIFFICULTY_TARGET 120 // seconds //TODO There are options to tune CryptoNote's difficulty retargeting function. //TODO We recommend not to change it. -#define DIFFICULTY_TARGET 120 // seconds #define DIFFICULTY_WINDOW 720 // blocks #define DIFFICULTY_LAG 15 #define DIFFICULTY_CUT 60 // timestamps to cut after sorting diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp index 214d7733..b8d86f7f 100755 --- a/src/cryptonote_core/blockchain_storage.cpp +++ b/src/cryptonote_core/blockchain_storage.cpp @@ -82,6 +82,11 @@ uint64_t blockchain_storage::get_current_blockchain_height() { bool blockchain_storage::init(const std::string& config_folder) { CRITICAL_REGION_LOCAL(m_blockchain_lock); + if (!config_folder.empty() && !tools::create_directories_if_necessary(config_folder)) { + LOG_ERROR("Failed to create data directory: " << m_config_folder); + return false; + } + m_config_folder = config_folder; LOG_PRINT_L0("Loading blockchain..."); if (!m_blocks.open(appendPath(config_folder, CRYPTONOTE_BLOCKS_FILENAME), appendPath(config_folder, CRYPTONOTE_BLOCKINDEXES_FILENAME), 1024)) { diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index 8592fed4..4456b903 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -622,7 +622,7 @@ namespace cryptonote //genesis block bl = boost::value_initialized(); - //TODO Uncomment this code block on teh first network lounch. It will generate and print you genesis block's hash. + //TODO Uncomment this code block on the first network launch. It will generate and print you genesis block's hash. //TODO Then you must copy it and put to genesis_coinbase_tx_hex variable /* account_public_address ac = boost::value_initialized(); @@ -630,10 +630,10 @@ namespace cryptonote construct_miner_tx(0, 0, 0, 0, 0, ac, bl.miner_tx); // zero fee in genesis blobdata txb = tx_to_blob(bl.miner_tx); std::string hex_tx_represent = string_tools::buff_to_hex_nodelimer(txb); - std::cout << "Genesis block hex: " << hex_to_represent << endl; + std::cout << "Genesis coinbase tx hex: " << hex_to_represent << std::endl; */ - //hard code coinbase tx in genesis block, because "tru" generating tx use random, but genesis should be always the same + //hard code coinbase tx in genesis block, because "true" generating tx use random, but genesis should be always the same //TODO After you obtain hash of the genesis block put it here and recompile sources! std::string genesis_coinbase_tx_hex = "";