diff --git a/Logic/Financial/BitcoinUtility.cs b/Logic/Financial/BitcoinUtility.cs index b0663f29..34b2a296 100644 --- a/Logic/Financial/BitcoinUtility.cs +++ b/Logic/Financial/BitcoinUtility.cs @@ -80,32 +80,7 @@ namespace Swarmops.Logic.Financial public static Dictionary GetHotwalletSatoshisPerChain(Organization organization) { - Dictionary satoshisTotalLookup = new Dictionary(); - - HotBitcoinAddresses addresses = HotBitcoinAddresses.ForOrganization(organization); - - foreach (HotBitcoinAddress address in addresses) - { - HotBitcoinAddressUnspents unspents = HotBitcoinAddressUnspents.ForAddress(address); - Int64 satoshisUnspentAddress = 0; - - foreach (HotBitcoinAddressUnspent unspent in unspents) - { - satoshisUnspentAddress += unspent.AmountSatoshis; - } - - if (satoshisUnspentAddress > 0) - { - if (!satoshisTotalLookup.ContainsKey(address.Chain)) - { - satoshisTotalLookup[address.Chain] = 0; - } - - satoshisTotalLookup[address.Chain] += satoshisUnspentAddress; - } - } - - return satoshisTotalLookup; + return HotBitcoinAddresses.GetSatoshisInHotwallet(organization); } @@ -127,7 +102,7 @@ namespace Swarmops.Logic.Financial // the "/1.0" converts to double implicitly conversionRateLookup[BitcoinChain.Core] = fiatCentsPerCoreCoin/1.0/BitcoinUtility.SatoshisPerBitcoin; - satoshisTotalLookup = GetHotwalletSatoshisPerChain(organization); + satoshisTotalLookup = HotBitcoinAddresses.GetSatoshisInHotwallet(organization); Int64 presentationCurrencyCents = 0;