mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 10:01:02 +00:00
Remove blocks_per_sync limits
The code used to cap at 5000 blocks per sync. It also treated 0 as 1. Remove these checks; if specified as 0 do no periodic syncs at all. Then the user is responsible for syncing in some external process.
This commit is contained in:
parent
c3ba844f03
commit
b8c03a5f10
2 changed files with 5 additions and 6 deletions
|
@ -3378,7 +3378,7 @@ bool Blockchain::cleanup_handle_incoming_blocks(bool force_sync)
|
||||||
store_blockchain();
|
store_blockchain();
|
||||||
m_sync_counter = 0;
|
m_sync_counter = 0;
|
||||||
}
|
}
|
||||||
else if (m_sync_counter >= m_db_blocks_per_sync)
|
else if (m_db_blocks_per_sync && m_sync_counter >= m_db_blocks_per_sync)
|
||||||
{
|
{
|
||||||
if(m_db_sync_mode == db_async)
|
if(m_db_sync_mode == db_async)
|
||||||
{
|
{
|
||||||
|
|
|
@ -372,11 +372,10 @@ namespace cryptonote
|
||||||
|
|
||||||
if(options.size() >= 3 && !safemode)
|
if(options.size() >= 3 && !safemode)
|
||||||
{
|
{
|
||||||
blocks_per_sync = atoll(options[2].c_str());
|
char *endptr;
|
||||||
if(blocks_per_sync > 5000)
|
uint64_t bps = strtoull(options[2].c_str(), &endptr, 0);
|
||||||
blocks_per_sync = 5000;
|
if (*endptr == '\0')
|
||||||
if(blocks_per_sync == 0)
|
blocks_per_sync = bps;
|
||||||
blocks_per_sync = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool auto_remove_logs = command_line::get_arg(vm, command_line::arg_db_auto_remove_logs) != 0;
|
bool auto_remove_logs = command_line::get_arg(vm, command_line::arg_db_auto_remove_logs) != 0;
|
||||||
|
|
Loading…
Reference in a new issue