From c49e3c0555ed93b6e712d2788b4a72526f66b8d2 Mon Sep 17 00:00:00 2001
From: Jake Taylor <jake@elixxir.io>
Date: Wed, 30 Dec 2020 12:37:00 -0600
Subject: [PATCH] added comments

---
 api/client.go      | 1 +
 bindings/client.go | 8 ++++----
 network/follow.go  | 6 ++++++
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/api/client.go b/api/client.go
index f7f879de1..44de05e00 100644
--- a/api/client.go
+++ b/api/client.go
@@ -339,6 +339,7 @@ func (c *Client) GetSwitchboard() interfaces.Switchboard {
 // events.
 func (c *Client) GetRoundEvents() interfaces.RoundEvents {
 	jww.INFO.Printf("GetRoundEvents()")
+	jww.WARN.Printf("GetRoundEvents does not handle Client Errors edge case!")
 	return c.network.GetInstance().GetRoundEvents()
 }
 
diff --git a/bindings/client.go b/bindings/client.go
index 2789061f4..2091e95bf 100644
--- a/bindings/client.go
+++ b/bindings/client.go
@@ -291,15 +291,15 @@ func (c *Client) RegisterRoundEventsHandler(rid int, cb RoundEventCallback,
 }
 
 // RegisterMessageDeliveryCB allows the caller to get notified if the rounds a
-// message was sent in sucesfully completed. Under the hood, this uses the same
-// interface as RegisterRoundEventsHandler, but provides a convienet way to use
+// message was sent in successfully completed. Under the hood, this uses the same
+// interface as RegisterRoundEventsHandler, but provides a convent way to use
 // the interface in its most common form, looking up the result of message
-// retreval
+// retrieval
 //
 // The callbacks will return at timeoutMS if no state update occurs
 //
 // This function takes the marshaled send report to ensure a memory leak does
-// not occur as a result of both sides of the bindings holding a refrence to
+// not occur as a result of both sides of the bindings holding a reference to
 // the same pointer.
 func (c *Client) RegisterMessageDeliveryCB(marshaledSendReport []byte,
 	mdc MessageDeliveryCallback, timeoutMS int) (*Unregister, error) {
diff --git a/network/follow.go b/network/follow.go
index 1b810dbec..fdde48242 100644
--- a/network/follow.go
+++ b/network/follow.go
@@ -173,6 +173,12 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) {
 						return
 					}
 
+					// FIXME: Should be able to trigger proper type of round event
+					// FIXME: without mutating the RoundInfo. Signature also needs verified
+					// FIXME: before keys are deleted
+					update.State = uint32(states.FAILED)
+					m.Instance.GetRoundEvents().TriggerRoundEvent(update)
+
 					// Delete all existing keys and trigger a re-registration with the relevant Node
 					m.Session.Cmix().Remove(nid)
 					m.Instance.GetAddGatewayChan() <- nGw
-- 
GitLab