Merge remote-tracking branch 'origin/develop' into frontend
This commit is contained in:
commit
d77c193f62
10 changed files with 68 additions and 50 deletions
|
|
@ -139,7 +139,7 @@ namespace net_utils
|
|||
m_http_ver_hi(0),
|
||||
m_http_ver_lo(0),
|
||||
m_have_to_block(false),
|
||||
m_full_request_buf_size{}
|
||||
m_full_request_buf_size(0)
|
||||
{}
|
||||
|
||||
http_method m_http_method;
|
||||
|
|
|
|||
|
|
@ -107,13 +107,13 @@ namespace net_utils
|
|||
inline
|
||||
~blocked_mode_client()
|
||||
{
|
||||
NESTED_TRY_ENTRY();
|
||||
NESTED_TRY_ENTRY();
|
||||
|
||||
//profile_tools::local_coast lc("~blocked_mode_client()", 3);
|
||||
shutdown();
|
||||
|
||||
NESTED_CATCH_ENTRY(__func__);
|
||||
}
|
||||
NESTED_CATCH_ENTRY(__func__);
|
||||
}
|
||||
|
||||
inline void set_recv_timeout(int reciev_timeout)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -107,20 +107,20 @@ namespace profile_tools
|
|||
}
|
||||
~local_call_account()
|
||||
{
|
||||
NESTED_TRY_ENTRY();
|
||||
NESTED_TRY_ENTRY();
|
||||
|
||||
LOG_PRINT2("profile_details.log", "PROFILE "<< std::left << std::setw(50) << (m_name + ":")
|
||||
<< "av_time:" << std::setw(15) << epee::string_tools::print_fixed_decimal_point (m_count_of_call ? (m_summary_time_used / m_count_of_call) : 0, 3)
|
||||
<< "sum_time: " << std::setw(15) << epee::string_tools::print_fixed_decimal_point(m_summary_time_used, 3)
|
||||
<< "call_count: " << std::setw(15) << m_count_of_call, LOG_LEVEL_0);
|
||||
|
||||
NESTED_CATCH_ENTRY(__func__);
|
||||
}
|
||||
NESTED_CATCH_ENTRY(__func__);
|
||||
}
|
||||
|
||||
size_t m_count_of_call;
|
||||
uint64_t m_summary_time_used;
|
||||
std::string m_name;
|
||||
};
|
||||
};
|
||||
|
||||
struct call_frame
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,6 +18,12 @@
|
|||
#include "crypto.h"
|
||||
#include "hash.h"
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
# define crypto_assert(expression) assert(expression)
|
||||
#else
|
||||
# define crypto_assert(expression) ((void)0)
|
||||
#endif
|
||||
|
||||
namespace crypto {
|
||||
|
||||
DISABLE_GCC_AND_CLANG_WARNING(strict-aliasing)
|
||||
|
|
@ -142,10 +148,10 @@ namespace crypto {
|
|||
ge_p3 A = ge_p3();
|
||||
ge_p2 R = ge_p2();
|
||||
if (ge_frombytes_vartime(&A, reinterpret_cast<const unsigned char*>(&P)) != 0)
|
||||
{
|
||||
assert(false);
|
||||
throw std::runtime_error(__func__);
|
||||
}
|
||||
{
|
||||
crypto_assert(false);
|
||||
throw std::runtime_error(__func__);
|
||||
}
|
||||
ge_scalarmult(&R, reinterpret_cast<const unsigned char*>(&a), &A);
|
||||
key_image a_p = key_image();
|
||||
ge_tobytes(reinterpret_cast<unsigned char*>(&a_p), &R);
|
||||
|
|
@ -175,7 +181,7 @@ namespace crypto {
|
|||
ge_p3 point;
|
||||
ge_p2 point2;
|
||||
ge_p1p1 point3;
|
||||
assert(sc_check(&key2) == 0);
|
||||
crypto_assert(sc_check(&key2) == 0);
|
||||
if (ge_frombytes_vartime(&point, &key1) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -194,7 +200,11 @@ namespace crypto {
|
|||
char *end = buf.output_index;
|
||||
buf.derivation = derivation;
|
||||
tools::write_varint(end, output_index);
|
||||
assert(end <= buf.output_index + sizeof buf.output_index);
|
||||
if (!(end <= buf.output_index + sizeof buf.output_index))
|
||||
{
|
||||
crypto_assert(false);
|
||||
return;
|
||||
}
|
||||
hash_to_scalar(&buf, end - reinterpret_cast<char *>(&buf), res);
|
||||
}
|
||||
|
||||
|
|
@ -221,7 +231,7 @@ namespace crypto {
|
|||
void crypto_ops::derive_secret_key(const key_derivation &derivation, size_t output_index,
|
||||
const secret_key &base, secret_key &derived_key) {
|
||||
ec_scalar scalar;
|
||||
assert(sc_check(&base) == 0);
|
||||
crypto_assert(sc_check(&base) == 0);
|
||||
derivation_to_scalar(derivation, output_index, scalar);
|
||||
sc_add(&derived_key, &base, &scalar);
|
||||
}
|
||||
|
|
@ -241,10 +251,10 @@ namespace crypto {
|
|||
{
|
||||
ge_p3 t;
|
||||
public_key t2;
|
||||
assert(sc_check(&sec) == 0);
|
||||
crypto_assert(sc_check(&sec) == 0);
|
||||
ge_scalarmult_base(&t, &sec);
|
||||
ge_p3_tobytes(&t2, &t);
|
||||
assert(pub == t2);
|
||||
crypto_assert(pub == t2);
|
||||
}
|
||||
#endif
|
||||
buf.h = prefix_hash;
|
||||
|
|
@ -261,7 +271,7 @@ namespace crypto {
|
|||
ge_p3 tmp3;
|
||||
ec_scalar c;
|
||||
s_comm buf;
|
||||
assert(check_key(pub));
|
||||
crypto_assert(check_key(pub));
|
||||
buf.h = prefix_hash;
|
||||
buf.key = pub;
|
||||
if (ge_frombytes_vartime(&tmp3, &pub) != 0) {
|
||||
|
|
@ -290,7 +300,7 @@ namespace crypto {
|
|||
void crypto_ops::generate_key_image(const public_key &pub, const secret_key &sec, key_image &image) {
|
||||
ge_p3 point;
|
||||
ge_p2 point2;
|
||||
assert(sc_check(&sec) == 0);
|
||||
crypto_assert(sc_check(&sec) == 0);
|
||||
hash_to_ec(pub, point);
|
||||
ge_scalarmult(&point2, &sec, &point);
|
||||
ge_tobytes(&image, &point2);
|
||||
|
|
@ -322,20 +332,24 @@ POP_WARNINGS
|
|||
ge_dsmp image_pre;
|
||||
ec_scalar sum, k, h;
|
||||
rs_comm *const buf = reinterpret_cast<rs_comm *>(alloca(rs_comm_size(pubs_count)));
|
||||
assert(sec_index < pubs_count);
|
||||
if (!(sec_index < pubs_count))
|
||||
{
|
||||
crypto_assert(false);
|
||||
return;
|
||||
}
|
||||
#if !defined(NDEBUG)
|
||||
{
|
||||
ge_p3 t;
|
||||
public_key t2;
|
||||
key_image t3;
|
||||
assert(sc_check(&sec) == 0);
|
||||
crypto_assert(sc_check(&sec) == 0);
|
||||
ge_scalarmult_base(&t, &sec);
|
||||
ge_p3_tobytes(&t2, &t);
|
||||
assert(*pubs[sec_index] == t2);
|
||||
crypto_assert(*pubs[sec_index] == t2);
|
||||
generate_key_image(*pubs[sec_index], sec, t3);
|
||||
assert(image == t3);
|
||||
crypto_assert(image == t3);
|
||||
for (i = 0; i < pubs_count; i++) {
|
||||
assert(check_key(*pubs[i]));
|
||||
crypto_assert(check_key(*pubs[i]));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -384,7 +398,7 @@ POP_WARNINGS
|
|||
rs_comm *const buf = reinterpret_cast<rs_comm *>(alloca(rs_comm_size(pubs_count)));
|
||||
#if !defined(NDEBUG)
|
||||
for (i = 0; i < pubs_count; i++) {
|
||||
assert(check_key(*pubs[i]));
|
||||
crypto_assert(check_key(*pubs[i]));
|
||||
}
|
||||
#endif
|
||||
if (ge_frombytes_vartime(&image_unp, &image) != 0) {
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ namespace currency {
|
|||
|
||||
wide_difficulty_type next_difficulty(vector<uint64_t>& timestamps, vector<wide_difficulty_type>& cumulative_difficulties, size_t target_seconds)
|
||||
{
|
||||
TIME_MEASURE_START_PD(target_calculating_enum_blocks);
|
||||
|
||||
// timestamps - first is latest, back - is oldest timestamps
|
||||
if (timestamps.size() > DIFFICULTY_WINDOW)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -273,6 +273,10 @@ namespace nodetool
|
|||
#ifndef TESTNET
|
||||
//TODO:
|
||||
//ADD_HARDCODED_SEED_NODE(std::string("0.0.0.0:") + std::to_string(P2P_DEFAULT_PORT));
|
||||
ADD_HARDCODED_SEED_NODE("95.217.43.225", P2P_DEFAULT_PORT);
|
||||
ADD_HARDCODED_SEED_NODE("94.130.137.230", P2P_DEFAULT_PORT);
|
||||
ADD_HARDCODED_SEED_NODE("95.217.42.247", P2P_DEFAULT_PORT);
|
||||
ADD_HARDCODED_SEED_NODE("94.130.160.115", P2P_DEFAULT_PORT);
|
||||
ADD_HARDCODED_SEED_NODE("207.154.237.82", P2P_DEFAULT_PORT);
|
||||
ADD_HARDCODED_SEED_NODE("207.154.240.198", P2P_DEFAULT_PORT);
|
||||
ADD_HARDCODED_SEED_NODE("207.154.255.10", P2P_DEFAULT_PORT);
|
||||
|
|
|
|||
|
|
@ -114,23 +114,23 @@ namespace
|
|||
NESTED_TRY_ENTRY();
|
||||
|
||||
if (m_flush)
|
||||
{
|
||||
m_flush = false;
|
||||
|
||||
LOG_PRINT(m_oss.str(), m_log_level)
|
||||
|
||||
if (epee::log_space::console_color_default == m_color)
|
||||
{
|
||||
m_flush = false;
|
||||
|
||||
LOG_PRINT(m_oss.str(), m_log_level)
|
||||
|
||||
if (epee::log_space::console_color_default == m_color)
|
||||
{
|
||||
std::cout << m_oss.str();
|
||||
}
|
||||
else
|
||||
{
|
||||
epee::log_space::set_console_color(m_color, m_bright);
|
||||
std::cout << m_oss.str();
|
||||
epee::log_space::reset_console_color();
|
||||
}
|
||||
std::cout << std::endl;
|
||||
std::cout << m_oss.str();
|
||||
}
|
||||
else
|
||||
{
|
||||
epee::log_space::set_console_color(m_color, m_bright);
|
||||
std::cout << m_oss.str();
|
||||
epee::log_space::reset_console_color();
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
NESTED_CATCH_ENTRY(__func__);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -804,13 +804,12 @@ namespace
|
|||
NESTED_TRY_ENTRY();
|
||||
|
||||
if (m_connection_initialized)
|
||||
{
|
||||
m_config.remove_protocol_handler(this);
|
||||
m_connection_initialized = false;
|
||||
}
|
||||
{
|
||||
m_config.remove_protocol_handler(this);
|
||||
m_connection_initialized = false;
|
||||
}
|
||||
|
||||
LOG_PRINT_CC(
|
||||
m_context, "stratum_protocol_handler::dtor()", LOG_LEVEL_4);
|
||||
LOG_PRINT_CC(m_context, "stratum_protocol_handler::dtor()", LOG_LEVEL_4);
|
||||
|
||||
NESTED_CATCH_ENTRY(__func__);
|
||||
}
|
||||
|
|
@ -1094,7 +1093,8 @@ struct stratum_server_impl
|
|||
};
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
stratum_server::stratum_server(core* c)
|
||||
: m_p_core(c), m_threads_count{}
|
||||
: m_p_core(c)
|
||||
, m_threads_count(0)
|
||||
{
|
||||
m_impl = new stratum_server_impl();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
#define BUILD_COMMIT_ID "@VERSION@"
|
||||
#define PROJECT_VERSION "1.0"
|
||||
#define PROJECT_VERSION_BUILD_NO 29
|
||||
#define PROJECT_VERSION_BUILD_NO 30
|
||||
#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 "]"
|
||||
|
|
|
|||
|
|
@ -2216,7 +2216,7 @@ void wallet2::sign_transfer(const std::string& tx_sources_blob, std::string& sig
|
|||
|
||||
// calculate key images for each change output
|
||||
crypto::key_derivation derivation = AUTO_VAL_INIT(derivation);
|
||||
CHECK_AND_ASSERT_THROW_MES(
|
||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(
|
||||
crypto::generate_key_derivation(
|
||||
m_account.get_keys().m_account_address.m_view_public_key,
|
||||
ft.one_time_key,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue