diff options
Diffstat (limited to 'shard/lib/app/directory.ex')
-rw-r--r-- | shard/lib/app/directory.ex | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/shard/lib/app/directory.ex b/shard/lib/app/directory.ex index 96e3a2b..e9482f7 100644 --- a/shard/lib/app/directory.ex +++ b/shard/lib/app/directory.ex @@ -145,6 +145,11 @@ defmodule SApp.Directory do {:noreply, state} end + def handle_cast({:peer_connected, peer_pid}, state) do + SNet.Manager.send_pid(peer_pid, {:interested, [state.id]}) + {:noreply, state} + end + def handle_cast({:interested, peer_pid, auth}, state) do if SNet.Group.in_group?(state.netgroup, peer_pid, auth) do SNet.Manager.send_pid(peer_pid, {state.id, nil, {:update, SData.SignRev.signed(state.items), true}}) @@ -197,9 +202,7 @@ defmodule SApp.Directory do defp send_deps(state) do dict = SData.SignRev.get(state.items) - IO.puts("items: #{inspect dict}") deps = for {_, {m, stored}} <- dict, stored, do: m - IO.puts("stored: #{inspect deps}") GenServer.cast(Shard.Manager, {:dep_list, state.id, deps}) end |