Skip to content

Commit

Permalink
[BugFix] Fixed an OverFlowException
Browse files Browse the repository at this point in the history
  • Loading branch information
Coding-Enthusiast committed Jan 25, 2018
1 parent abc2289 commit 263665d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using WatchOnlyBitcoinWallet.Models;
Expand All @@ -19,7 +20,7 @@ public override async Task<Response> UpdateBalancesAsync(List<BitcoinAddress> ad
resp.Errors.AddRange(apiResp.Errors);
break;
}
decimal bal = (int)apiResp.Result["final_balance"] * Satoshi;
decimal bal = (Int64)apiResp.Result["final_balance"] * Satoshi;
addr.Difference = bal - addr.Balance;
addr.Balance = bal;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public override async Task<Response> UpdateBalancesAsync(List<Models.BitcoinAddr
try
{
string result = await client.GetStringAsync("https://blockexplorer.com/api/addr/" + addr.Address + "/balance");
decimal bal = int.Parse(result) * Satoshi;
decimal bal = Int64.Parse(result) * Satoshi;
addr.Difference = bal - addr.Balance;
addr.Balance = bal;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using WatchOnlyBitcoinWallet.Models;
Expand All @@ -19,7 +20,7 @@ public override async Task<Response> UpdateBalancesAsync(List<BitcoinAddress> ad
resp.Errors.AddRange(apiResp.Errors);
break;
}
decimal bal = (int)apiResp.Result["final_balance"] * Satoshi;
decimal bal = (Int64)apiResp.Result["final_balance"] * Satoshi;
addr.Difference = bal - addr.Balance;
addr.Balance = bal;
}
Expand Down

0 comments on commit 263665d

Please sign in to comment.