Skip to content

Commit

Permalink
Revert "Merge pull request helium#868 from helium/pevm/clarify-connec…
Browse files Browse the repository at this point in the history
…ted"

This reverts commit 209e5da, reversing
changes made to b638132.
  • Loading branch information
evanmcc committed Aug 11, 2021
1 parent d085ded commit 5eb837b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/miner.erl
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,8 @@ block_age() ->
-spec p2p_status() -> [{Check::string(), Result::string()}].
p2p_status() ->
SwarmTID = blockchain_swarm:tid(),
In = application:get_env(blockchain, max_inbound_connections, 2),
Out = application:get_env(blockchain, outbound_gossip_connections, 6),

SessionCt =
try
length(libp2p_swarm:sessions(SwarmTID))
catch _:_ ->
0
end,

CheckSessions = fun() ->
case (SessionCt > ((In + Out) / 2)) of
case (catch length(libp2p_swarm:sessions(SwarmTID)) > 5) of
true -> "yes";
_ -> "no"
end
Expand Down Expand Up @@ -182,8 +172,7 @@ p2p_status() ->
end,
lists:foldr(fun({Fun, Name}, Acc) ->
[{Name, Fun()} | Acc]
end, [], [{CheckSessions, "well-connected"},
{fun() -> integer_to_list(SessionCt) end, "sessions"},
end, [], [{CheckSessions, "connected"},
{CheckPublicAddr, "dialable"},
{CheckNatType, "nat_type"},
{CheckHeight, "height"}]).
Expand Down

0 comments on commit 5eb837b

Please sign in to comment.