Skip to content

Commit

Permalink
Removed http serve from replay_test, cleanup state references in proc…
Browse files Browse the repository at this point in the history
…esslist.go
  • Loading branch information
factom-clay committed Aug 30, 2018
1 parent 2182c85 commit b3bb183
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
24 changes: 12 additions & 12 deletions state/processList.go
Expand Up @@ -686,18 +686,18 @@ func (p *ProcessList) Process(s *State) (progress bool) {
VMListLoop:
for j := vm.Height; j < len(vm.List); j++ {

state.processCnt++
x := p.decodeState(state.Syncing, state.DBSig, state.EOM, state.DBSigDone, state.EOMDone,
len(state.LeaderPL.FedServers), state.EOMProcessed, state.DBSigProcessed)

// Compute a syncing state string and report if it has changed
if state.SyncingState[state.SyncingStateCurrent] != x {
state.LogPrintf("processStatus", x)
state.SyncingStateCurrent = (state.SyncingStateCurrent + 1) % len(state.SyncingState)
state.SyncingState[state.SyncingStateCurrent] = x
s.processCnt++
x := p.decodeState(s.Syncing, s.DBSig, s.EOM, s.DBSigDone, s.EOMDone,
len(s.LeaderPL.FedServers), s.EOMProcessed, s.DBSigProcessed)

// Compute a syncing s string and report if it has changed
if s.SyncingState[s.SyncingStateCurrent] != x {
s.LogPrintf("processStatus", x)
s.SyncingStateCurrent = (s.SyncingStateCurrent + 1) % len(s.SyncingState)
s.SyncingState[s.SyncingStateCurrent] = x
}
if extraDebug {
p.State.LogMessage("process", fmt.Sprintf("Consider %v/%v/%v", p.DBHeight, i, j), vm.List[j])
s.LogMessage("process", fmt.Sprintf("Consider %v/%v/%v", p.DBHeight, i, j), vm.List[j])
}
if vm.List[j] == nil {
//p.State.AddStatus(fmt.Sprintf("ProcessList.go Process: Found nil list at vm %d vm height %d ", i, j))
Expand All @@ -715,7 +715,7 @@ func (p *ProcessList) Process(s *State) (progress bool) {
}
}

// p.State.LogPrintf("process","nil at %v/%v/%v", p.DBHeight, i, j)
// s.LogPrintf("process","nil at %v/%v/%v", p.DBHeight, i, j)
break VMListLoop
}

Expand Down Expand Up @@ -831,7 +831,7 @@ func (p *ProcessList) Process(s *State) (progress bool) {
} else {
s.LogMessage("process", "Waiting on saving", msg)
// If we don't have the Entry Blocks (or we haven't processed the signatures) we can't do more.
// p.State.AddStatus(fmt.Sprintf("Can't do more: dbht: %d vm: %d vm-height: %d Entry Height: %d", p.DBHeight, i, j, state.EntryDBHeightComplete))
// p.State.AddStatus(fmt.Sprintf("Can't do more: dbht: %d vm: %d vm-height: %d Entry Height: %d", p.DBHeight, i, j, s.EntryDBHeightComplete))
if extraDebug {
p.State.LogPrintf("process", "Waiting on saving blocks to progress complete %d processing %d-:-%d", s.EntryDBHeightComplete, p.DBHeight, vm.LeaderMinute)
}
Expand Down
11 changes: 4 additions & 7 deletions state/replay_test.go
Expand Up @@ -7,13 +7,10 @@ package state_test
import (
"fmt"
"math/rand"
"net/http/pprof"
"testing"
"time"

"log"
"net/http"
"net/http/pprof"

"github.com/FactomProject/factomd/common/constants"
"github.com/FactomProject/factomd/common/interfaces"
"github.com/FactomProject/factomd/common/primitives"
Expand All @@ -37,9 +34,9 @@ func Test_Replay(test *testing.T) {
time interfaces.Timestamp
}

go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
//go func() {
// log.Println(http.ListenAndServe("localhost:6060", nil))
//}()

XTrans := 61440 //102400000 //61440 //145000

Expand Down
6 changes: 3 additions & 3 deletions state/state.go
Expand Up @@ -392,9 +392,9 @@ type State struct {
pstate string
SyncingState [256]string
SyncingStateCurrent int
processCnt int64 // count of attempts to process .. so we can see if the thread is running
MMRInfo // fields for MMR processing

processCnt int64 // count of attempts to process .. so we can see if the thread is running
MMRInfo // fields for MMR processing

reportedActivations [activations.ACTIVATION_TYPE_COUNT + 1]bool // flags about which activations we have reported (+1 because we don't use 0)
}
Expand Down

0 comments on commit b3bb183

Please sign in to comment.