Fix a bug where initial_bts_accounts' balances weren't correctly accounted in total_supply

This commit is contained in:
Viktor 2017-06-01 09:52:18 +03:00
parent f90c8a4101
commit 77fb78b841

View file

@ -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>([&](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>([&](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 )