Skip to content

Commit

Permalink
Merge pull request #335 from oxarbitrage/issue325
Browse files Browse the repository at this point in the history
remove flat_index fully
  • Loading branch information
oxarbitrage authored Jul 31, 2017
2 parents 74c650d + 3e49787 commit 5815865
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 142 deletions.
10 changes: 4 additions & 6 deletions libraries/chain/db_init.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
* Copyright (c) 2017 Cryptonomex, Inc., and contributors.
*
* The MIT License
*
Expand Down Expand Up @@ -208,7 +208,7 @@ void database::initialize_indexes()
add_index< primary_index<simple_index<dynamic_global_property_object >> >();
add_index< primary_index<simple_index<account_statistics_object >> >();
add_index< primary_index<simple_index<asset_dynamic_data_object >> >();
add_index< primary_index<flat_index< block_summary_object >> >();
add_index< primary_index<simple_index<block_summary_object >> >();
add_index< primary_index<simple_index<chain_property_object > > >();
add_index< primary_index<simple_index<witness_schedule_object > > >();
add_index< primary_index<simple_index<budget_record_object > > >();
Expand Down Expand Up @@ -241,9 +241,6 @@ void database::init_genesis(const genesis_state_type& genesis_state)

transaction_evaluation_state genesis_eval_state(this);

flat_index<block_summary_object>& bsi = get_mutable_index_type< flat_index<block_summary_object> >();
bsi.resize(0xffff+1);

// Create blockchain accounts
fc::ecc::private_key null_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key")));
create<account_balance_object>([](account_balance_object& b) {
Expand Down Expand Up @@ -404,7 +401,8 @@ void database::init_genesis(const genesis_state_type& genesis_state)
p.chain_id = chain_id;
p.immutable_parameters = genesis_state.immutable_parameters;
} );
create<block_summary_object>([&](block_summary_object&) {});
for (uint32_t i = 0; i <= 0x10000; i++)
create<block_summary_object>( [&]( block_summary_object&) {});

// Create initial accounts
for( const auto& account : genesis_state.initial_accounts )
Expand Down
4 changes: 1 addition & 3 deletions libraries/chain/include/graphene/chain/asset_object.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
* Copyright (c) 2017 Cryptonomex, Inc., and contributors.
*
* The MIT License
*
Expand All @@ -24,7 +24,6 @@
#pragma once
#include <graphene/chain/protocol/asset_ops.hpp>
#include <boost/multi_index/composite_key.hpp>
#include <graphene/db/flat_index.hpp>
#include <graphene/db/generic_index.hpp>

/**
Expand Down Expand Up @@ -228,7 +227,6 @@ namespace graphene { namespace chain {
>
>
> asset_bitasset_data_object_multi_index_type;
//typedef flat_index<asset_bitasset_data_object> asset_bitasset_data_index;
typedef generic_index<asset_bitasset_data_object, asset_bitasset_data_object_multi_index_type> asset_bitasset_data_index;

struct by_symbol;
Expand Down
1 change: 0 additions & 1 deletion libraries/chain/include/graphene/chain/worker_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ typedef multi_index_container<
>
> worker_object_multi_index_type;

//typedef flat_index<worker_object> worker_index;
using worker_index = generic_index<worker_object, worker_object_multi_index_type>;

} } // graphene::chain
Expand Down
132 changes: 0 additions & 132 deletions libraries/db/include/graphene/db/flat_index.hpp

This file was deleted.

0 comments on commit 5815865

Please sign in to comment.