From 77fb78b841785ec1fb5405e1f0dd26636454975d Mon Sep 17 00:00:00 2001 From: Viktor Date: Thu, 1 Jun 2017 09:52:18 +0300 Subject: [PATCH] Fix a bug where initial_bts_accounts' balances weren't correctly accounted in total_supply --- libraries/chain/db_init.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libraries/chain/db_init.cpp b/libraries/chain/db_init.cpp index 913edbc8..1d344fc6 100644 --- a/libraries/chain/db_init.cpp +++ b/libraries/chain/db_init.cpp @@ -642,12 +642,14 @@ void database::init_genesis(const genesis_state_type& genesis_state) // Create balances for all bts accounts for( const auto& account : genesis_state.initial_bts_accounts ) - if (account.core_balance != share_type()) - create([&](account_balance_object& b) { - b.owner = get_account_id(account.name); - b.balance = account.core_balance; - }); + if (account.core_balance != share_type()) { + total_supplies[asset_id_type()] += account.core_balance; + create([&](account_balance_object& b) { + b.owner = get_account_id(account.name); + b.balance = account.core_balance; + }); + } // Create initial balances share_type total_allocation; for( const auto& handout : genesis_state.initial_balances )