Skip to content

Commit

Permalink
Revert "Revert "Saved the second pass data""
Browse files Browse the repository at this point in the history
This reverts commit 261cdb3.
  • Loading branch information
carryforward committed Nov 13, 2017
1 parent 7429f9f commit 5ef31c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions engine/NetStart.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ func NetStart(s *state.State, p *FactomParams, listenToStdin bool) {

if p.Sync2 >= 0 {
s.EntryDBHeightComplete = uint32(p.Sync2)
} else {
height, err := s.DB.FetchDatabaseEntryHeight()
if err != nil {
os.Stderr.WriteString(fmt.Sprintf("ERROR: %v", err))
} else {
s.EntryDBHeightComplete = height
}
}

mLog.Init(p.RuntimeLog, p.Cnt)
Expand Down
10 changes: 10 additions & 0 deletions state/entrySyncing.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,16 @@ func (s *State) GoSyncEntries() {
}
}
}

if s.EntryDBHeightComplete%1000 == 0 {
if firstMissing < 0 {
//Only save EntryDBHeightComplete IF it's a multiple of 1000 AND there are no missing entries
err := s.DB.SaveDatabaseEntryHeight(s.EntryDBHeightComplete)
if err != nil {
fmt.Printf("ERROR: %v\n", err)
}
}
}
}
lastfirstmissing = firstMissing
if firstMissing < 0 {
Expand Down

0 comments on commit 5ef31c5

Please sign in to comment.