Skip to content

Commit

Permalink
Fixed error while loading object database
Browse files Browse the repository at this point in the history
  • Loading branch information
srpatel19590 committed Aug 28, 2019
1 parent e80e9dd commit 0d0a6b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions libraries/app/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ vector<vector<account_id_type>> database_api_impl::get_key_references( vector<pu
auto itr = refs.account_to_address_memberships.find(a);
if( itr != refs.account_to_address_memberships.end() )
{
result.reserve( itr->second.size() );
result.reserve( result.size() + itr->second.size() );
for( auto item : itr->second )
{
wdump((a)(item)(item(_db).name));
Expand All @@ -565,7 +565,7 @@ vector<vector<account_id_type>> database_api_impl::get_key_references( vector<pu

if( itr != refs.account_to_key_memberships.end() )
{
result.reserve( itr->second.size() );
result.reserve( result.size() + itr->second.size() );
for( auto item : itr->second ) result.push_back(item);
}
final_result.emplace_back( std::move(result) );
Expand Down
14 changes: 6 additions & 8 deletions libraries/db/include/graphene/db/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,12 @@ namespace graphene { namespace db {
fc::raw::unpack(ds, _next_id);
fc::raw::unpack(ds, open_ver);
FC_ASSERT( open_ver == get_object_version(), "Incompatible Version, the serialization of objects in this index has changed" );
try {
vector<char> tmp;
while( true )
{
fc::raw::unpack( ds, tmp );
load( tmp );
}
} catch ( const fc::exception& ){}
vector<char> tmp;
while( ds.remaining() > 0 )
{
fc::raw::unpack( ds, tmp );
load( tmp );
}
}

virtual void save( const path& db ) override
Expand Down

0 comments on commit 0d0a6b7

Please sign in to comment.