diff options
Diffstat (limited to 'shard/lib/app/blockstore.ex')
-rw-r--r-- | shard/lib/app/blockstore.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shard/lib/app/blockstore.ex b/shard/lib/app/blockstore.ex index 8e4fddc..5e93135 100644 --- a/shard/lib/app/blockstore.ex +++ b/shard/lib/app/blockstore.ex @@ -109,10 +109,10 @@ defmodule SApp.BlockStore do end def ask_random_peers(state, key) do - peers = :ets.lookup(:shard_peer_db, state.shard_id) + peers = Shard.Manager.get_shard_peers(state.shard_id) |> Enum.shuffle |> Enum.take(3) - for {_, peer} <- peers do + for peer <- peers do Shard.Manager.send(peer, {state.shard_id, state.path, {:get, key}}) end end |