Skip to content

Commit

Permalink
merge cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
factom-clay committed Aug 3, 2018
1 parent ea07292 commit 366e5fe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion kubectl/k_portForward.sh
Expand Up @@ -33,4 +33,4 @@ EOF
################################
# End of AWK Scripts #
################################
kubectl get pods -l role=member | awk "$scriptVariable"
(echo bootstrap-node-f5db45b97-6wqtn; kubectl get pods -l role=member) | awk "$scriptVariable"
34 changes: 15 additions & 19 deletions state/dbStateManager.go
Expand Up @@ -8,9 +8,7 @@ import (
"bytes"
"encoding/hex"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"

"github.com/FactomProject/factomd/common/adminBlock"
Expand All @@ -20,7 +18,6 @@ import (
"github.com/FactomProject/factomd/common/entryBlock"
"github.com/FactomProject/factomd/common/entryCreditBlock"
"github.com/FactomProject/factomd/common/factoid"
"github.com/FactomProject/factomd/common/globals"
"github.com/FactomProject/factomd/common/identity"
"github.com/FactomProject/factomd/common/interfaces"
"github.com/FactomProject/factomd/common/messages"
Expand Down Expand Up @@ -231,7 +228,7 @@ func (dbs *DBState) MarshalBinary() (rval []byte, err error) {
if err != nil {
return nil, err
}
}
}
err = b.PushBinaryMarshallable(dbs.SaveStruct)
if err != nil {
return nil, err
Expand Down Expand Up @@ -348,10 +345,11 @@ func (dbs *DBState) UnmarshalBinaryData(p []byte) (newData []byte, err error) {
}

if ok == true {
dbs.SaveStruct = new(SaveState)
err = b.PopBinaryMarshallable(dbs.SaveStruct)
if err != nil {
return
dbs.SaveStruct = new(SaveState)
err = b.PopBinaryMarshallable(dbs.SaveStruct)
if err != nil {
return
}
}

err = b.PopBinaryMarshallable(dbs.DBHash)
Expand Down Expand Up @@ -388,7 +386,8 @@ func (dbs *DBState) UnmarshalBinaryData(p []byte) (newData []byte, err error) {
return
}

l, err := b.PopVarInt()
l, err2 := b.PopVarInt()
err = err2
if err != nil {
return
}
Expand All @@ -401,7 +400,8 @@ func (dbs *DBState) UnmarshalBinaryData(p []byte) (newData []byte, err error) {
dbs.EntryBlocks = append(dbs.EntryBlocks, eb)
}

entries, rest, err := entryBlock.UnmarshalEntryList(b.DeepCopyBytes())
entries, rest, err2 := entryBlock.UnmarshalEntryList(b.DeepCopyBytes())
err = err2
if err != nil {
return
}
Expand Down Expand Up @@ -454,7 +454,7 @@ func (dbs *DBState) UnmarshalBinary(p []byte) error {
}

type DBStateList struct {
SrcNetwork bool // True if I got this block from the network.
SrcNetwork bool // True if I got this block from the network.
LastEnd int
LastBegin int
TimeToAsk interfaces.Timestamp
Expand Down Expand Up @@ -572,10 +572,10 @@ func (dbsl *DBStateList) MarshalBinary() (rval []byte, err error) {
}

for _, v := range dbsl.DBStates {
err = buf.PushBinaryMarshallable(v)
if err != nil {
return nil, err
}
err = buf.PushBinaryMarshallable(v)
if err != nil {
return nil, err
}
}

return buf.DeepCopyBytes(), nil
Expand Down Expand Up @@ -951,7 +951,6 @@ func (list *DBStateList) FixupLinks(p *DBState, d *DBState) (progress bool) {
}
}


err = d.AdminBlock.InsertIdentityABEntries()
if err != nil {
fmt.Println(err)
Expand Down Expand Up @@ -1079,7 +1078,6 @@ func (list *DBStateList) ProcessBlocks(d *DBState) (progress bool) {
out.WriteString("\n")
}


prt("pl 1st", pl)
prt("pln 1st", pln)

Expand Down Expand Up @@ -1267,7 +1265,6 @@ func (list *DBStateList) SaveDBStateToDB(d *DBState) (progress bool) {
// Take the height, and some function of the identity chain, and use that to decide to trim. That
// way, not all nodes in a simulation Trim() at the same time.


if !d.Signed || !d.ReadyToSave || list.State.DB == nil {
return
}
Expand Down Expand Up @@ -1486,7 +1483,6 @@ func (list *DBStateList) SaveDBStateToDB(d *DBState) (progress bool) {
d.ReadyToSave = false
d.Saved = true


return
}

Expand Down

0 comments on commit 366e5fe

Please sign in to comment.