Add the array of ids (that are being removed) to the removed_objects signal

This commit is contained in:
elmato 2017-02-14 21:38:40 +00:00
parent 6f1d8b548b
commit 0ecdc90d4d
2 changed files with 8 additions and 3 deletions

View file

@ -556,12 +556,17 @@ void database::notify_changed_objects()
vector<object_id_type> changed_ids; changed_ids.reserve(head_undo.old_values.size()); vector<object_id_type> changed_ids; changed_ids.reserve(head_undo.old_values.size());
for( const auto& item : head_undo.old_values ) changed_ids.push_back(item.first); for( const auto& item : head_undo.old_values ) changed_ids.push_back(item.first);
vector<object_id_type> removed_ids; removed_ids.reserve( head_undo.removed.size() );
vector<const object*> removed; removed.reserve( head_undo.removed.size() ); vector<const object*> removed; removed.reserve( head_undo.removed.size() );
for( const auto& item : head_undo.removed ) removed.emplace_back( item.second.get() ); for( const auto& item : head_undo.removed )
{
removed_ids.emplace_back( item.first );
removed.emplace_back( item.second.get() );
}
new_objects(new_ids); new_objects(new_ids);
changed_objects(changed_ids); changed_objects(changed_ids);
removed_objects(removed); removed_objects(removed_ids, removed);
} }
} FC_CAPTURE_AND_LOG( () ) } } FC_CAPTURE_AND_LOG( () ) }

View file

@ -204,7 +204,7 @@ namespace graphene { namespace chain {
/** this signal is emitted any time an object is removed and contains a /** this signal is emitted any time an object is removed and contains a
* pointer to the last value of every object that was removed. * pointer to the last value of every object that was removed.
*/ */
fc::signal<void(const vector<const object*>&)> removed_objects; fc::signal<void(const vector<object_id_type>&, const vector<const object*>&)> removed_objects;
//////////////////// db_witness_schedule.cpp //////////////////// //////////////////// db_witness_schedule.cpp ////////////////////