From 7f44b793c1e3a5209caad473595bd02e6da40792 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Wed, 31 May 2017 18:06:11 -0400 Subject: [PATCH] Fix a bug where initial_bts_accounts' balances weren't correctly accounted in total_supply --- libraries/chain/db_init.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/chain/db_init.cpp b/libraries/chain/db_init.cpp index 942ab3f3..81880f59 100644 --- a/libraries/chain/db_init.cpp +++ b/libraries/chain/db_init.cpp @@ -642,11 +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()) + 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;