1
0
Fork 0
forked from lthn/blockchain

Merge branch 'release' into develop

This commit is contained in:
sowle 2020-05-18 17:58:21 +03:00
commit 9d2262c5e6
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
7 changed files with 29 additions and 13 deletions

View file

@ -925,6 +925,7 @@ using namespace std;
class interruptible_http_client : public http_simple_client
{
std::shared_ptr<idle_handler_base> m_pcb;
bool m_permanent_error = false;
virtual bool handle_target_data(std::string& piece_of_transfer)
{
@ -943,6 +944,7 @@ using namespace std;
if (p_hri && !(p_hri->m_response_code >= 200 && p_hri->m_response_code < 300))
{
LOG_PRINT_L0("HTTP request to " << url << " failed with code: " << p_hri->m_response_code);
m_permanent_error = true;
return false;
}
return r;
@ -1002,24 +1004,33 @@ using namespace std;
};
uint64_t current_err_count = 0;
bool r = false;
m_permanent_error = false;
while (!r && current_err_count < fails_count)
{
LOG_PRINT_L0("Attempt to invoke http: " << url << " (offset:" << state_received_bytes_base << ")");
LOG_PRINT_L0("Attempt " << current_err_count + 1 << "/" << fails_count << " to get " << url << " (offset:" << state_received_bytes_base << ")");
fields_list additional_params_local = additional_params;
additional_params_local.push_back(std::make_pair<std::string, std::string>("Range", std::string("bytes=") + std::to_string(state_received_bytes_base) + "-"));
r = this->invoke_cb(local_cb, url, timeout, method, body, additional_params_local);
if (!r)
{
if (stopped)
if (stopped || m_permanent_error)
break;
current_err_count++;
state_received_bytes_base += state_received_bytes_current;
state_received_bytes_current = 0;
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
boost::this_thread::sleep_for(boost::chrono::milliseconds(2000));
}
}
if (current_err_count >= fails_count)
{
LOG_PRINT_YELLOW("Downloading from " << url << " FAILED as it's reached maximum (" << fails_count << ") number of attempts. Downloaded " << state_received_bytes_base << " bytes.", LOG_LEVEL_0);
}
else if (m_permanent_error)
{
LOG_PRINT_YELLOW("Downloading from " << url << " FAILED due to permanent HTTP error. Downloaded " << state_received_bytes_base << " bytes.", LOG_LEVEL_0);
}
fs.close();
return r;
}

View file

@ -149,7 +149,7 @@ epoch_context_full* create_epoch_context(
LOG_CUSTOM_WITH_CALLSTACK("CRITICAL: std::calloc(" << alloc_size << ") failed in create_epoch_context()", 0);
return nullptr; // Signal out-of-memory by returning null pointer.
}
LOG_CUSTOM("context for epoch " << epoch_number << " allocated, size: " << alloc_size << " bytes", 0);
LOG_CUSTOM("context for epoch " << epoch_number << " allocated, size: " << alloc_size << " bytes, full dataset size: " << full_dataset_size << " bytes", 0);
hash512* const light_cache = reinterpret_cast<hash512*>(alloc_data + context_alloc_size);
const hash256 epoch_seed = calculate_epoch_seed(epoch_number);

View file

@ -21,8 +21,8 @@ namespace tools
};
#ifndef TESTNET
static constexpr pre_download_entry c_pre_download_lmdb = { "http://95.217.43.225/pre-download/zano_lmdb_94_425000.pak", "e6ac69dcf8e7a7017d032cb4326d661c541a3b6a328e6299e6d61c3acde5d49f", 684683820, 1021865984 };
static constexpr pre_download_entry c_pre_download_mdbx = { "http://95.217.43.225/pre-download/zano_mdbx_94_425000.pak", "e1f50efba1149a349eb626037dda30052c0233091693a00a10dd5363d5de1206", 535268266, 1073725440 };
static constexpr pre_download_entry c_pre_download_lmdb = { "http://95.217.43.225/pre-download/zano_lmdb_94_524999.pak", "ac46a4932813e28fe11ec160a2be4e48c961dce701ecace5133184cff2754d3d", 747173581, 1087696896 };
static constexpr pre_download_entry c_pre_download_mdbx = { "http://95.217.43.225/pre-download/zano_mdbx_94_524999.pak", "b195fdc1bda7173469db0b313f2ead2dbda1788639ba0aedb7001a6cc640fc47", 561335640, 1342156800 };
#else
static constexpr pre_download_entry c_pre_download_lmdb = { "http://95.217.43.225/pre-download/zano_testnet_lmdb_96_99000.pak", "9e8522b287ac7637ca770970542e94702f9fbaa267633cfcaeee4383dfe15bd0", 83851119, 131493888 };
static constexpr pre_download_entry c_pre_download_mdbx = { "http://95.217.43.225/pre-download/zano_testnet_mdbx_96_99000.pak", "de33646711f2276e5b22db5741d7b2bf6a8e4c4231d393b730f9a4fce1d7ec03", 63257747, 268431360 };
@ -88,7 +88,7 @@ namespace tools
};
tools::create_directories_if_necessary(working_folder);
r = cl.download_and_unzip(cb, downloading_file_path, url, 1000 /* timout */, "GET", std::string(), 3 /* fails count */);
r = cl.download_and_unzip(cb, downloading_file_path, url, 5000 /* timout */, "GET", std::string(), 30 /* fails count */);
if (!r)
{
LOG_PRINT_RED("Download failed", LOG_LEVEL_0);

View file

@ -19,9 +19,11 @@ namespace currency
#ifdef TESTNET
ADD_CHECKPOINT(50000, "cb05a7bdc7f78c5cdb6ef1048f85b27c569f44879233903ce5f5a4e5bd590a3d");
ADD_CHECKPOINT(100000, "6b8b54356a9d44f6c1ebdacb8593d8f5ab2e2e2ca4493e7ae7baf4b3755c5e16");
ADD_CHECKPOINT(350000, "885841f079e5a38f1921f4a5319f0d52fdbab64bb2026ca3cabad1c032d22db7");
#else
// MAINNET
ADD_CHECKPOINT(425000, "46a6c36d5dec2d484d5e4845a8525ca322aafc06915ed9c8da2a241b51b7d1e8");
ADD_CHECKPOINT(525000, "8c1ac57e67448130207a224b2d6e33ccdc64d6dd1c59dbcf9ad2361dc0d07d51");
#endif
return true;

View file

@ -7214,7 +7214,7 @@ var SendComponent = /** @class */ (function () {
return null;
}]),
comment: new _angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormControl"](''),
mixin: new _angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormControl"](0, _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required),
mixin: new _angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormControl"](10, _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required),
fee: new _angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormControl"](this.variablesService.default_fee, [_angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required, function (g) {
if ((new bignumber_js__WEBPACK_IMPORTED_MODULE_6__["BigNumber"](g.value)).isLessThan(_this.variablesService.default_fee)) {
return { 'less_min': true };
@ -7246,7 +7246,7 @@ var SendComponent = /** @class */ (function () {
address: _this.variablesService.currentWallet.send_data['address'],
amount: _this.variablesService.currentWallet.send_data['amount'],
comment: _this.variablesService.currentWallet.send_data['comment'],
mixin: _this.variablesService.currentWallet.send_data['mixin'] || 0,
mixin: _this.variablesService.currentWallet.send_data['mixin'] || 10,
fee: _this.variablesService.currentWallet.send_data['fee'] || _this.variablesService.default_fee,
hide: _this.variablesService.currentWallet.send_data['hide'] || false
});

View file

@ -5,9 +5,9 @@
#define PROJECT_MAJOR_VERSION "1"
#define PROJECT_MINOR_VERSION "1"
#define PROJECT_REVISION "5"
#define PROJECT_REVISION "6"
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION
#define PROJECT_VERSION_BUILD_NO 82
#define PROJECT_VERSION_BUILD_NO 85
#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 "]"

View file

@ -345,7 +345,10 @@ bool wallets_manager::init_local_daemon()
return static_cast<bool>(m_stop_singal_sent);
});
CHECK_AND_ASSERT_AND_SET_GUI(res, "pre-downloading failed");
if (!res)
{
LOG_PRINT_RED("pre-downloading failed, continue with normal network synchronization", LOG_LEVEL_0);
}
}