aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/app/identity.ex
diff options
context:
space:
mode:
Diffstat (limited to 'shard/lib/app/identity.ex')
-rw-r--r--shard/lib/app/identity.ex10
1 files changed, 5 insertions, 5 deletions
diff --git a/shard/lib/app/identity.ex b/shard/lib/app/identity.ex
index 204dfb1..de39c6d 100644
--- a/shard/lib/app/identity.ex
+++ b/shard/lib/app/identity.ex
@@ -87,25 +87,25 @@ defmodule SApp.Identity do
end
def handle_cast(:init_pull, state) do
- for {_, pid, _, _} <- Shard.Manager.list_peers do
+ for {_, pid, _} <- Shard.Manager.list_connections do
GenServer.cast(pid, {:send_msg, {:interested, [state.id]}})
end
{:noreply, state}
end
- def handle_cast({:interested, peer_id}, state) do
- Shard.Manager.send(peer_id, {state.id, nil, {:update, SData.SignRev.signed(state.state)}})
+ def handle_cast({:interested, peer_pid, _auth}, state) do
+ Shard.Manager.send_pid(peer_pid, {state.id, nil, {:update, SData.SignRev.signed(state.state)}})
{:noreply, state}
end
- def handle_cast({:msg, peer_id, _shard_id, nil, msg}, state) do
+ def handle_cast({:msg, conn_pid, _auth, _shard_id, nil, msg}, state) do
state = case msg do
{:update, signed} when signed != nil ->
case SData.SignRev.merge(state.state, signed, state.pk) do
{true, st2} ->
Shard.Manager.save_state(state.id, st2)
state = put_in(state.state, st2)
- bcast_state(state, [peer_id])
+ bcast_state(state, [conn_pid])
state
{false, _} ->
state