Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix on storage state dumper parameter HeightToStartRealTimeSyncing #91

Merged
merged 2 commits into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions StatesDumper/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class Settings
/// <summary>
/// Height to begin real-time syncing and dumping on, consequently, dumping every block into a single files
/// </summary>
public uint HeightToStartRealTimeSyncing { get; }
public int HeightToStartRealTimeSyncing { get; }
/// <summary>
/// Persisting actions
/// </summary>
Expand All @@ -29,7 +29,7 @@ private Settings(IConfigurationSection section)
/// Geting settings for storage changes state dumper
this.BlockCacheSize = GetValueOrDefault(section.GetSection("BlockCacheSize"), 1000u, p => uint.Parse(p));
this.HeightToBegin = GetValueOrDefault(section.GetSection("HeightToBegin"), 0u, p => uint.Parse(p));
this.HeightToStartRealTimeSyncing = GetValueOrDefault(section.GetSection("HeightToStartRealTimeSyncing"), 2883000u, p => uint.Parse(p));
this.HeightToStartRealTimeSyncing = GetValueOrDefault(section.GetSection("HeightToStartRealTimeSyncing"), -1, p => int.Parse(p));
this.PersistAction = GetValueOrDefault(section.GetSection("PersistAction"), PersistActions.StorageChanges, p => (PersistActions)Enum.Parse(typeof(PersistActions), p));
}

Expand Down
2 changes: 1 addition & 1 deletion StatesDumper/StatesDumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void OnCommitStorage(Snapshot snapshot)
uint blockIndex = snapshot.Height;
if (bs_cache.Count > 0)
{
if ((blockIndex % Settings.Default.BlockCacheSize == 0) || (blockIndex > Settings.Default.HeightToStartRealTimeSyncing))
if ((blockIndex % Settings.Default.BlockCacheSize == 0) || (Settings.Default.HeightToStartRealTimeSyncing != -1 && blockIndex > Settings.Default.HeightToStartRealTimeSyncing))
vncoelho marked this conversation as resolved.
Show resolved Hide resolved
{
string dirPath = "./Storage";
Directory.CreateDirectory(dirPath);
Expand Down
2 changes: 1 addition & 1 deletion StatesDumper/StatesDumper/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"PersistAction": "StorageChanges",
"BlockCacheSize": 1000,
"HeightToBegin": 0,
"HeightToRealTimeSyncing": 2883000
"HeightToStartRealTimeSyncing": -1
}
}