1
0
Fork 0
forked from lthn/blockchain

Merge branch 'master' into offsig

This commit is contained in:
sowle 2019-04-20 02:16:35 +03:00
commit 060d829f3a
8 changed files with 21 additions and 21 deletions

View file

@ -116,27 +116,27 @@ inline uint32_t random_math(uint32_t a, uint32_t b, uint32_t selector) noexcept
switch (selector % 11) switch (selector % 11)
{ {
default: default:
case 0:
return a * b;
case 1:
return a + b;
case 2: case 2:
return mul_hi32(a, b); return a + b;
case 3: case 3:
return std::min(a, b); return a * b;
case 4: case 4:
return rotl32(a, b); return mul_hi32(a, b);
case 5: case 5:
return rotr32(a, b); return std::min(a, b);
case 6: case 6:
return a & b; return rotl32(a, b);
case 7: case 7:
return a | b; return rotr32(a, b);
case 8: case 8:
return a ^ b; return a & b;
case 9: case 9:
return clz32(a) + clz32(b); return a | b;
case 10: case 10:
return a ^ b;
case 0:
return clz32(a) + clz32(b);
case 1:
return popcount32(a) + popcount32(b); return popcount32(a) + popcount32(b);
} }
} }

View file

@ -7,7 +7,7 @@
#pragma once #pragma once
#define CURRENCY_FORMATION_VERSION 79 #define CURRENCY_FORMATION_VERSION 80
#define CURRENCY_MAX_BLOCK_NUMBER 500000000 #define CURRENCY_MAX_BLOCK_NUMBER 500000000
@ -53,7 +53,7 @@
// #define CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT ((uint64_t)100000000) // should be TX_MINIMUM_FEE * CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER // #define CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT ((uint64_t)100000000) // should be TX_MINIMUM_FEE * CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER
// #define CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER 1000 // reward in minimum fees for a block in the zone // #define CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER 1000 // reward in minimum fees for a block in the zone
#define CURRENCY_TESTNET_CONST_REWARD 100000000000000 #define CURRENCY_BLOCK_REWARD 1000000000000 // 1.0 coin
#define WALLET_MAX_ALLOWED_OUTPUT_AMOUNT ((uint64_t)0xffffffffffffffffLL) #define WALLET_MAX_ALLOWED_OUTPUT_AMOUNT ((uint64_t)0xffffffffffffffffLL)

View file

@ -2377,7 +2377,7 @@ namespace currency
if (!height) if (!height)
return PREMINE_AMOUNT; return PREMINE_AMOUNT;
return CURRENCY_TESTNET_CONST_REWARD; return CURRENCY_BLOCK_REWARD;
} }
//----------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------
bool get_block_reward(bool is_pos, size_t median_size, size_t current_block_size, const boost::multiprecision::uint128_t& already_generated_coins, uint64_t &reward, uint64_t height) bool get_block_reward(bool is_pos, size_t median_size, size_t current_block_size, const boost::multiprecision::uint128_t& already_generated_coins, uint64_t &reward, uint64_t height)

View file

@ -804,7 +804,7 @@ namespace currency
LOG_ERROR("Failed to create block template"); LOG_ERROR("Failed to create block template");
return false; return false;
} }
res.difficulty = dt.convert_to<uint64_t>(); res.difficulty = dt.convert_to<std::string>();
blobdata block_blob = t_serializable_object_to_blob(b); blobdata block_blob = t_serializable_object_to_blob(b);
res.blocktemplate_blob = string_tools::buff_to_hex_nodelimer(block_blob); res.blocktemplate_blob = string_tools::buff_to_hex_nodelimer(block_blob);
@ -1112,7 +1112,7 @@ namespace currency
set_session_blob(job_id, b); set_session_blob(job_id, b);
job.blob = string_tools::buff_to_hex_nodelimer(currency::get_block_hashing_blob(b)); job.blob = string_tools::buff_to_hex_nodelimer(currency::get_block_hashing_blob(b));
//TODO: set up share difficulty here! //TODO: set up share difficulty here!
job.difficulty = std::to_string(bt_res.difficulty); //difficulty leaved as string field since it will be refactored into 128 bit format job.difficulty = bt_res.difficulty; //difficulty leaved as string field since it will be refactored into 128 bit format
job.job_id = "SOME_JOB_ID"; job.job_id = "SOME_JOB_ID";
get_current_hi(job.prev_hi); get_current_hi(job.prev_hi);
return true; return true;

View file

@ -791,7 +791,7 @@ namespace currency
struct response struct response
{ {
uint64_t difficulty; std::string difficulty;
uint64_t height; uint64_t height;
crypto::hash seed; crypto::hash seed;
blobdata blocktemplate_blob; blobdata blocktemplate_blob;

View file

@ -2,6 +2,6 @@
#define BUILD_COMMIT_ID "@VERSION@" #define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "1.0" #define PROJECT_VERSION "1.0"
#define PROJECT_VERSION_BUILD_NO 14 #define PROJECT_VERSION_BUILD_NO 15
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]" #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"

View file

@ -628,7 +628,7 @@ bool gen_no_attchments_in_coinbase::init_config_set_cp(currency::core& c, size_t
crc.pos_minimum_heigh = 1; crc.pos_minimum_heigh = 1;
c.get_blockchain_storage().set_core_runtime_config(crc); c.get_blockchain_storage().set_core_runtime_config(crc);
m_checkpoints.add_checkpoint(12, "446b25ca3816e36df92745ea91c3c54a8745db565bafd4d2aa7df9da49220a19"); m_checkpoints.add_checkpoint(12, "ea03a5c99aeedc2050ca5dae011a6c411b31f8b7fb9d0b82735c403b5c608b7b");
c.set_checkpoints(currency::checkpoints(m_checkpoints)); c.set_checkpoints(currency::checkpoints(m_checkpoints));
return true; return true;

View file

@ -1621,7 +1621,7 @@ multisig_and_checkpoints::multisig_and_checkpoints()
bool multisig_and_checkpoints::set_cp(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events) bool multisig_and_checkpoints::set_cp(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events)
{ {
currency::checkpoints checkpoints; currency::checkpoints checkpoints;
checkpoints.add_checkpoint(15, "37da2a30fd8cf1daa05ba11cb2ac5f7a3cc998bce56e4b575fbbea58f0592f5b"); checkpoints.add_checkpoint(15, "46f45b849160be33937c60fa564e820792b0aaa6cf4a080e6002b6f25d84d688");
c.set_checkpoints(std::move(checkpoints)); c.set_checkpoints(std::move(checkpoints));
return true; return true;