Skip to content

Commit

Permalink
add message new server connected
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielTavaresA committed Jun 30, 2024
1 parent 2ab5e66 commit 9d9c243
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ final case class ConnectionMediator(

// Connect to some servers
case ConnectionMediator.ConnectTo(urlList) =>
log.info(s"ConnectTo $urlList")
val urlDiff = urlList.toSet.diff(serverMap.values.map(g => g.serverAddress).toSet)
urlDiff.map(url =>
Http().singleWebSocketRequest(
Expand Down Expand Up @@ -74,6 +75,8 @@ final case class ConnectionMediator(
if (serverMap.isEmpty) {
monitorRef ! Monitor.AtLeastOneServerConnected
gossipManagerRef ! Monitor.AtLeastOneServerConnected
} else {
gossipManagerRef ! ConnectionMediator.NewServerConnected(serverRef, greetServer)
}
serverMap += ((serverRef, greetServer))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class GossipManagerSuite extends TestKit(ActorSystem("GossipManagerSuiteActorSys
val response = Right(JsonRpcResponse(
RpcValidator.JSON_RPC_VERSION,
ResultObject(0),
Some(1)
Some(4)
))

// by processing the reponse, gossipManager should send again a rumor to a new peer
Expand Down

0 comments on commit 9d9c243

Please sign in to comment.