Skip to content
Snippets Groups Projects
Commit d53ef07d authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Add debug messages so that critical message buffer storage can be linked with...

Add debug messages so that critical message buffer storage can be linked with msgDigest of messages received.
parent 9670bcd9
Branches
Tags
3 merge requests!510Release,!226WIP: Api2.0,!207WIP: Client Restructure
......@@ -9,13 +9,14 @@ package message
import (
"fmt"
"gitlab.com/elixxir/client/event"
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/xx_network/primitives/id"
"strconv"
"sync"
"time"
"gitlab.com/elixxir/client/event"
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/xx_network/primitives/id"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/primitives/format"
......@@ -191,7 +192,7 @@ func (h *handler) handleMessageHelper(ecrMsg format.Message, bundle Bundle) bool
return true
}
im := fmt.Sprintf("Message cannot be identify: keyFP: %v, round: %d "+
im := fmt.Sprintf("Message cannot be identified: keyFP: %v, round: %d "+
"msgDigest: %s, not determined to be for client",
ecrMsg.GetKeyFP(), bundle.Round, ecrMsg.Digest())
jww.TRACE.Printf(im)
......
......@@ -9,6 +9,8 @@ package message
import (
"encoding/json"
"time"
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/cmix/identity/receptionID"
......@@ -20,7 +22,6 @@ import (
"gitlab.com/xx_network/primitives/netTime"
"golang.org/x/crypto/blake2b"
"google.golang.org/protobuf/proto"
"time"
)
const currentMeteredCmixMessageVersion = 0
......@@ -145,6 +146,8 @@ func (mcmb *MeteredCmixMessageBuffer) Add(m format.Message, ri *pb.RoundInfo,
jww.FATAL.Panic(
"Cannot handle a metered cMix message with a length of 0.")
}
jww.TRACE.Printf("Metered Messages Add(MsgDigest: %s)",
m.Digest())
msg := buildMsg(m, ri, identity)
addedMsgFace := mcmb.mb.Add(msg)
......
......@@ -10,11 +10,12 @@ package utility
import (
"encoding/base64"
"encoding/json"
"sync"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/xx_network/primitives/netTime"
"sync"
)
// MessageHash stores the hash of a message, which is used as the key for each
......@@ -198,6 +199,8 @@ func (mb *MessageBuffer) load() error {
// Add adds a message to the buffer in "not processing" state.
func (mb *MessageBuffer) Add(m interface{}) interface{} {
h := mb.handler.HashMessage(m)
jww.TRACE.Printf("Critical Messages Add(%s)",
base64.StdEncoding.EncodeToString(h[:]))
mb.mux.Lock()
defer mb.mux.Unlock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment