Skip to content

Commit

Permalink
Fix for prefix length in atomic whereami
Browse files Browse the repository at this point in the history
  • Loading branch information
factom-clay committed Oct 18, 2019
2 parents 34634bc + 8ca1815 commit 3eafd46
Show file tree
Hide file tree
Showing 85 changed files with 1,305 additions and 997 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions common/entryBlock/eblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/FactomProject/factomd/common/interfaces"
"github.com/FactomProject/factomd/common/primitives"
llog "github.com/FactomProject/factomd/log"
)

// EBlock is the Entry Block. It holds the hashes of the Entries and its Merkle
Expand Down Expand Up @@ -319,6 +320,7 @@ func (e *EBlock) unmarshalBodyBinaryData(data []byte) (newData []byte, err error
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()
e.Init()
Expand Down
2 changes: 2 additions & 0 deletions common/entryBlock/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/FactomProject/factomd/common/interfaces"
"github.com/FactomProject/factomd/common/primitives"
"github.com/FactomProject/factomd/common/primitives/random"
llog "github.com/FactomProject/factomd/log"
)

// An Entry is the element which carries user data
Expand Down Expand Up @@ -314,6 +315,7 @@ func (e *Entry) UnmarshalBinaryData(data []byte) (_ []byte, err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()

Expand Down
2 changes: 2 additions & 0 deletions common/messages/ack.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/FactomProject/factomd/common/messages/msgbase"
"github.com/FactomProject/factomd/common/primitives"

llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -218,6 +219,7 @@ func (m *Ack) UnmarshalBinaryData(data []byte) (newData []byte, err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()

Expand Down
2 changes: 2 additions & 0 deletions common/messages/addServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -150,6 +151,7 @@ func (m *AddServerMsg) UnmarshalBinaryData(data []byte) (newData []byte, err err
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling Add Server Message: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling Add Server Message: %v", r)
}
}()
newData = data
Expand Down
3 changes: 3 additions & 0 deletions common/messages/bounce.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/FactomProject/factomd/common/interfaces"
"github.com/FactomProject/factomd/common/messages/msgbase"
"github.com/FactomProject/factomd/common/primitives"

llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -167,6 +169,7 @@ func (m *Bounce) UnmarshalBinaryData(data []byte) (newData []byte, err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()
newData = data
Expand Down
2 changes: 2 additions & 0 deletions common/messages/bounceReply.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -137,6 +138,7 @@ func (m *BounceReply) UnmarshalBinaryData(data []byte) (newData []byte, err erro
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()

Expand Down
2 changes: 2 additions & 0 deletions common/messages/changeServerKey.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -170,6 +171,7 @@ func (m *ChangeServerKeyMsg) UnmarshalBinaryData(data []byte) (newData []byte, e
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling Add Server Message: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling Add Server Message: %v", r)
}
}()
newData = data
Expand Down
2 changes: 2 additions & 0 deletions common/messages/commitChain.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -191,6 +192,7 @@ func (m *CommitChainMsg) UnmarshalBinaryData(data []byte) (newData []byte, err e
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling Commit Chain Message: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling Commit Chain Message: %v", r)
}
}()

Expand Down
2 changes: 2 additions & 0 deletions common/messages/commitEntry.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -148,6 +149,7 @@ func (m *CommitEntryMsg) UnmarshalBinaryData(data []byte) (newData []byte, err e
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling Commit entry Message: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling Commit entry Message: %v", r)
}
}()
newData = data
Expand Down
6 changes: 5 additions & 1 deletion common/messages/dataResponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -184,6 +185,7 @@ func (m *DataResponse) UnmarshalBinaryData(data []byte) (newData []byte, err err
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()
newData = data
Expand Down Expand Up @@ -237,7 +239,8 @@ func (m *DataResponse) UnmarshalBinary(data []byte) error {
func attemptEntryUnmarshal(data []byte) (entry interfaces.IEBEntry, err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Bytes do not represent an entry")
err = fmt.Errorf("Bytes do not represent an entry %v", r)
llog.LogPrintf("recovery", "Bytes do not represent an entry %v", r)
}
}()

Expand All @@ -253,6 +256,7 @@ func attemptEBlockUnmarshal(data []byte) (eblock interfaces.IEntryBlock, err err
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Bytes do not represent an eblock: %v\n", r)
llog.LogPrintf("recovery", "Bytes do not represent an eblock: %v", r)
}
}()

Expand Down
4 changes: 4 additions & 0 deletions common/messages/dbstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -54,6 +55,7 @@ var _ interfaces.IMsg = (*DBStateMsg)(nil)
func (a *DBStateMsg) IsSameAs(b *DBStateMsg) bool {
defer func() {
if r := recover(); r != nil {
llog.LogPrintf("recovery", "DBState msg comparison failed %v", r)
return
}
}()
Expand Down Expand Up @@ -564,6 +566,7 @@ func (m *DBStateMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling Directory Block State Message: %v", r)
llog.LogPrintf("recovery", "DBState msg comparison failed %v", r)
}
}()

Expand Down Expand Up @@ -795,6 +798,7 @@ func (sl *SigList) UnmarshalBinaryData(data []byte) (newData []byte, err error)
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling SigList in Full Server Fault: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling SigList in Full Server Fault: %v", r)
}
}()

Expand Down
2 changes: 2 additions & 0 deletions common/messages/dbstateMissing.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -234,6 +235,7 @@ func (m *DBStateMissing) UnmarshalBinaryData(data []byte) (newData []byte, err e
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling Directory Block State Missing Message: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling Directory Block State Missing Message: %v", r)
}
}()
newData = data
Expand Down
2 changes: 2 additions & 0 deletions common/messages/directoryBlockSignature.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/FactomProject/factomd/common/primitives"

"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -289,6 +290,7 @@ func (m *DirectoryBlockSignature) UnmarshalBinaryData(data []byte) (newData []by
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()

Expand Down
3 changes: 3 additions & 0 deletions common/messages/electionMsgs/addAuditInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"github.com/FactomProject/factomd/common/primitives"
"github.com/FactomProject/factomd/elections"
"github.com/FactomProject/factomd/state"

llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -159,6 +161,7 @@ func (m *AddAuditInternal) UnmarshalBinaryData(data []byte) (newData []byte, err
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()
return
Expand Down
3 changes: 3 additions & 0 deletions common/messages/electionMsgs/addLeaderInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"github.com/FactomProject/factomd/common/primitives"
"github.com/FactomProject/factomd/elections"
"github.com/FactomProject/factomd/state"

llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -176,6 +178,7 @@ func (m *AddLeaderInternal) UnmarshalBinaryData(data []byte) (newData []byte, er
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()
return
Expand Down
3 changes: 3 additions & 0 deletions common/messages/electionMsgs/authoritylistInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/FactomProject/factomd/common/messages/msgbase"
"github.com/FactomProject/factomd/common/primitives"
"github.com/FactomProject/factomd/elections"

llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -137,6 +139,7 @@ func (m *AuthorityListInternal) UnmarshalBinaryData(data []byte) (newData []byte
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()
return nil, fmt.Errorf("Not implmented for AuthorityListInternal")
Expand Down
3 changes: 3 additions & 0 deletions common/messages/electionMsgs/electionAdapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
//"github.com/FactomProject/factomd/state"

"github.com/FactomProject/factomd/electionsCore/messages"

llog "github.com/FactomProject/factomd/log"
)

// ElectionAdapter is used to drive the election package, abstracting away factomd
Expand Down Expand Up @@ -48,6 +50,7 @@ type ElectionAdapter struct {
func (ea *ElectionAdapter) VolunteerControlsStatus() (status string) {
defer func() {
if r := recover(); r != nil {
llog.LogPrintf("recovery", "Fail in VolunteerControlsStatus %v", r)
status = ""
return
}
Expand Down
3 changes: 3 additions & 0 deletions common/messages/electionMsgs/eomSigInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
"github.com/FactomProject/factomd/elections"
"github.com/FactomProject/factomd/state"
"github.com/FactomProject/factomd/util/atomic"

llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -309,6 +311,7 @@ func (m *EomSigInternal) UnmarshalBinaryData(data []byte) (newData []byte, err e
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()
return
Expand Down
3 changes: 3 additions & 0 deletions common/messages/electionMsgs/fedVoteMsg.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/FactomProject/factomd/elections"
"github.com/FactomProject/factomd/state"
"github.com/FactomProject/goleveldb/leveldb/errors"

llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -272,6 +274,7 @@ func (m *FedVoteMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error
defer func() {
if r := recover(); r != nil {
os.Stderr.WriteString("Error UnmashalBinaryData FedVoteMsg")
llog.LogPrintf("recovery", "Error UnmashalBinaryData FedVoteMsg")
err = fmt.Errorf("Error unmarshalling: %v", r)
}
}()
Expand Down
7 changes: 4 additions & 3 deletions common/messages/electionMsgs/fedVotePropose.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (

"github.com/FactomProject/factomd/common/constants"
"github.com/FactomProject/factomd/common/interfaces"
"github.com/FactomProject/factomd/common/messages/msgbase"
"github.com/FactomProject/factomd/common/primitives"
"github.com/FactomProject/factomd/elections"
"github.com/FactomProject/factomd/state"
log "github.com/sirupsen/logrus"

//"github.com/FactomProject/factomd/state"
"github.com/FactomProject/factomd/common/messages/msgbase"
llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

var _ = fmt.Print
Expand Down Expand Up @@ -210,6 +210,7 @@ func (m *FedVoteProposalMsg) UnmarshalBinaryData(data []byte) (newData []byte, e
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()

Expand Down
4 changes: 3 additions & 1 deletion common/messages/electionMsgs/fedVoteVolunteerMsg.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"fmt"
"os"
"reflect"
//"github.com/FactomProject/factomd/state"

"github.com/FactomProject/factomd/common/constants"
"github.com/FactomProject/factomd/common/interfaces"
Expand All @@ -18,6 +17,8 @@ import (
"github.com/FactomProject/factomd/elections"
"github.com/FactomProject/factomd/state"
"github.com/FactomProject/goleveldb/leveldb/errors"

llog "github.com/FactomProject/factomd/log"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -283,6 +284,7 @@ func (m *FedVoteVolunteerMsg) UnmarshalBinaryData(data []byte) (newData []byte,
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
llog.LogPrintf("recovery", "Error unmarshalling: %v", r)
}
}()

Expand Down
Loading

0 comments on commit 3eafd46

Please sign in to comment.