aboutsummaryrefslogtreecommitdiff
path: root/shard/lib
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-11-07 15:14:22 +0100
committerAlex Auvolat <alex@adnab.me>2018-11-07 15:14:22 +0100
commitc0804534ac323b1162d3d394eda6838f63e0a582 (patch)
treebce457f103142e596a5454165d281f581db65293 /shard/lib
parentf25929e45cfbe25bb7401c9af126d353e1eaef86 (diff)
downloadshard-c0804534ac323b1162d3d394eda6838f63e0a582.tar.gz
shard-c0804534ac323b1162d3d394eda6838f63e0a582.zip
Fixes thanks to Dialyzer
Diffstat (limited to 'shard/lib')
-rw-r--r--shard/lib/app/file.ex4
-rw-r--r--shard/lib/app/pagestore.ex4
-rw-r--r--shard/lib/net/group.ex2
3 files changed, 5 insertions, 5 deletions
diff --git a/shard/lib/app/file.ex b/shard/lib/app/file.ex
index 7f03e1f..6c4a212 100644
--- a/shard/lib/app/file.ex
+++ b/shard/lib/app/file.ex
@@ -262,10 +262,10 @@ defmodule SApp.File do
{k, []}
end
end
- Logger.info("Missing pieces: #{map_size missing} / #{n_blocks}")
+ Logger.info("Missing pieces for #{state.id|>Base.encode16}: #{map_size missing} / #{n_blocks}")
missing
false ->
- Logger.info("Incomplete Merkle tree meta data, requesting info from peers.")
+ Logger.info("Incomplete Merkle tree meta data for #{state.id|>Base.encode16}, requesting info from peers.")
SApp.PageStore.set_roots(state.store, [state.info.merkle_root])
Process.send_after(self(), {:calc_missing, iter + 1}, iter * 1000)
nil
diff --git a/shard/lib/app/pagestore.ex b/shard/lib/app/pagestore.ex
index 79d39b7..3f7fc0d 100644
--- a/shard/lib/app/pagestore.ex
+++ b/shard/lib/app/pagestore.ex
@@ -144,7 +144,7 @@ defmodule SApp.PageStore do
end
def handle_cast({:rec_pull, hash, ask_to}, state) do
- if :dets.lookup state.store, hash == [] do
+ if :dets.lookup(state.store, hash) == [] do
why = {:cached, System.os_time(:seconds) + @cache_ttl}
init_rec_pull(state, hash, why, ask_to)
end
@@ -187,7 +187,7 @@ defmodule SApp.PageStore do
end
value = SData.term_unbin bin
for dep <- SData.Page.refs value do
- if :dets.lookup state.store, dep == [] do
+ if :dets.lookup(state.store, dep) == [] do
init_rec_pull(state, dep, sub_why, [conn_pid])
end
end
diff --git a/shard/lib/net/group.ex b/shard/lib/net/group.ex
index f3d5962..c982cd0 100644
--- a/shard/lib/net/group.ex
+++ b/shard/lib/net/group.ex
@@ -46,7 +46,7 @@ defmodule SNet.PubShardGroup do
GenServer.cast(notify_to, {:peer_connected, pid})
end
for peer_info <- Shard.Manager.get_shard_peers id do
- if SNet.Manager.get_connections_to peer_info == [] do
+ if SNet.Manager.get_connections_to(peer_info) == [] do
SNet.Manager.add_peer(peer_info,
callback: fn pid ->
GenServer.cast(notify_to, {:peer_connected, pid})