From 648f397954e8f9dd3dd5baee6f2f8bcaa8677c89 Mon Sep 17 00:00:00 2001 From: "Richard T. Carback III" <rick.carback@gmail.com> Date: Tue, 6 Oct 2020 19:37:29 +0000 Subject: [PATCH] Working reception --- api/send.go | 2 +- cmd/root.go | 3 ++- network/follow.go | 6 +----- network/message/handler.go | 1 + 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/api/send.go b/api/send.go index a83862dd9..e4a544a50 100644 --- a/api/send.go +++ b/api/send.go @@ -37,7 +37,7 @@ func (c *Client) SendUnsafe(m message.Send, param params.Unsafe) ([]id.Round, // if it fails. func (c *Client) SendCMIX(msg format.Message, param params.CMIX) (id.Round, error) { - jww.INFO.Printf("SendCMIX(%v)", msg) + jww.INFO.Printf("SendCMIX(%s)", string(msg.GetContents())) return c.network.SendCMIX(msg, param) } diff --git a/cmd/root.go b/cmd/root.go index 92477b699..285d0edb7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -178,7 +178,8 @@ var rootCmd = &cobra.Command{ done = true break case m := <-recvCh: - fmt.Printf("Message received: %v", m) + fmt.Printf("Message received: %s", string( + m.Payload)) break } } diff --git a/network/follow.go b/network/follow.go index 264e0c2c0..fb77f3a9f 100644 --- a/network/follow.go +++ b/network/follow.go @@ -62,7 +62,7 @@ var followCnt int = 0 // executes each iteration of the follower func (m *manager) follow(rng csprng.Source, comms followNetworkComms) { - jww.INFO.Printf("follow: %d", followCnt) + jww.TRACE.Printf("follow: %d", followCnt) followCnt++ //randomly select a gateway to poll @@ -148,8 +148,4 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) { // messages for the user (bloom not implemented yet) checkedRounds.RangeUncheckedMasked(gwRoundsState, roundChecker, int(m.param.MaxCheckedRounds)) - - wr := m.Instance.GetWaitingRounds() - - jww.INFO.Printf("WaitingRounds: %+v, %d", wr.GetSlice(), wr.Len()) } diff --git a/network/message/handler.go b/network/message/handler.go index 66eb7ad26..33a2d5e1a 100644 --- a/network/message/handler.go +++ b/network/message/handler.go @@ -62,6 +62,7 @@ func (m *Manager) handleMessage(ecrMsg format.Message) { } else { // if it doesnt match any form of encrypted, hear it as a raw message // and add it to garbled messages to be handled later + msg = ecrMsg raw := message.Receive{ Payload: msg.GetRawContents(), MessageType: message.Raw, -- GitLab