Skip to content

Commit a5851f8

Browse files
committed
-fix fileage of settingsfile -save previous down- and sync- state per node -keeping node states in memory even when not in new loaded changed settings -catch exception when node is not reachable -send extra notification when node is back online -send notification when node is not reachable -handle exception when pushover is not available or internet is down -bugfix divide by zero in calculation when previous mana was zero
1 parent 8f0029b commit a5851f8

File tree

5 files changed

+212
-78
lines changed

5 files changed

+212
-78
lines changed

Source/MonitorIotaNode/NodeEndpoint.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public NodeEndpoint(Uri uri)
2626
public NodeInfo RetrieveNodeInfo()
2727
{
2828
IRestResponse response = client.Get(request);
29+
if (!response.IsSuccessful) throw new Exception($"Error requesting {Uri.AbsoluteUri}");
2930
string json = response.Content;
3031
return JsonConvert.DeserializeObject<NodeInfo>(json);
3132
}

Source/MonitorIotaNode/NodeInfo.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ public class Mana
5353

5454
public static Mana operator -(Mana manaOne, Mana manaTwo) => manaOne + (-manaTwo);
5555

56-
public static Mana operator /(Mana manaOne, Mana manaTwo)
57-
{
58-
if (manaTwo.Access == 0 || manaTwo.Consensus == 0)
59-
{
60-
throw new DivideByZeroException();
61-
}
62-
return new Mana(manaOne.Access / manaTwo.Access, manaOne.Consensus / manaTwo.Consensus);
63-
}
64-
6556
public static Mana operator *(Mana manaOne, Mana manaTwo) => new Mana(manaOne.Access * manaTwo.Access, manaOne.Consensus * manaTwo.Consensus);
6657

6758
public static Mana operator *(Mana manaOne, int factor) => new Mana(manaOne.Access * factor, manaOne.Consensus * factor);

0 commit comments

Comments
 (0)