Skip to content

Commit

Permalink
Merge pull request #1461 from bitshares/fixes
Browse files Browse the repository at this point in the history
Fix for errors while loading object_database
  • Loading branch information
pmconrad authored Dec 4, 2018
2 parents 8fb3dd0 + 59db3f5 commit 91eb971
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 @@ -577,7 +577,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 )
{
result.push_back(item);
Expand All @@ -587,7 +587,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 91eb971

Please sign in to comment.