mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-18 23:58:59 +02:00
sync period defined as long in milliseconds
This commit is contained in:
@@ -460,11 +460,11 @@ namespace monero {
|
||||
}
|
||||
|
||||
/**
|
||||
* Start background synchronizing with a maximum number of seconds between syncs.
|
||||
* Start background synchronizing with a maximum period between syncs.
|
||||
*
|
||||
* @param sync_rate_in_seconds - maximum number of seconds between wallet syncs for updates (default 10 seconds)
|
||||
* @param syncPeriodInMs - maximum period between syncs in milliseconds
|
||||
*/
|
||||
virtual void start_syncing(uint32_t sync_rate_in_seconds = 10) {
|
||||
virtual void start_syncing(uint64_t sync_period_in_ms = 10000) {
|
||||
throw std::runtime_error("start_syncing() not supported");
|
||||
}
|
||||
|
||||
|
||||
@@ -1372,21 +1372,15 @@ namespace monero {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start automatic syncing as its own thread.
|
||||
*/
|
||||
void monero_wallet_core::start_syncing(uint32_t sync_rate_in_seconds) {
|
||||
void monero_wallet_core::start_syncing(uint64_t sync_period_in_ms) {
|
||||
if (!m_is_connected) throw std::runtime_error("Wallet is not connected to daemon");
|
||||
m_syncing_interval = sync_rate_in_seconds * 1000; // set sync rate // TODO: use ms instead of seconds?
|
||||
m_syncing_interval = sync_period_in_ms;
|
||||
if (!m_syncing_enabled) {
|
||||
m_syncing_enabled = true;
|
||||
run_sync_loop(); // sync wallet on loop in background
|
||||
run_sync_loop(); // sync wallet on loop in background
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop automatic syncing as its own thread.
|
||||
*/
|
||||
void monero_wallet_core::stop_syncing() {
|
||||
m_syncing_enabled = false;
|
||||
m_w2->stop();
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace monero {
|
||||
monero_sync_result sync(monero_wallet_listener& listener) override;
|
||||
monero_sync_result sync(uint64_t start_height) override;
|
||||
monero_sync_result sync(uint64_t start_height, monero_wallet_listener& listener) override;
|
||||
void start_syncing(uint32_t sync_rate) override;
|
||||
void start_syncing(uint64_t sync_period_in_ms) override;
|
||||
void stop_syncing() override;
|
||||
void rescan_spent() override;
|
||||
void rescan_blockchain() override;
|
||||
|
||||
Reference in New Issue
Block a user