From 0ecdc90d4df2ebd80a6d4cfa4388f4b8a608c9c1 Mon Sep 17 00:00:00 2001 From: elmato Date: Tue, 14 Feb 2017 21:38:40 +0000 Subject: [PATCH] Add the array of ids (that are being removed) to the removed_objects signal --- libraries/chain/db_block.cpp | 9 +++++++-- libraries/chain/include/graphene/chain/database.hpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/chain/db_block.cpp b/libraries/chain/db_block.cpp index 33403edf..f55f0396 100644 --- a/libraries/chain/db_block.cpp +++ b/libraries/chain/db_block.cpp @@ -556,12 +556,17 @@ void database::notify_changed_objects() vector changed_ids; changed_ids.reserve(head_undo.old_values.size()); for( const auto& item : head_undo.old_values ) changed_ids.push_back(item.first); + vector removed_ids; removed_ids.reserve( head_undo.removed.size() ); vector 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); changed_objects(changed_ids); - removed_objects(removed); + removed_objects(removed_ids, removed); } } FC_CAPTURE_AND_LOG( () ) } diff --git a/libraries/chain/include/graphene/chain/database.hpp b/libraries/chain/include/graphene/chain/database.hpp index 47fd63b9..9e0f1af1 100644 --- a/libraries/chain/include/graphene/chain/database.hpp +++ b/libraries/chain/include/graphene/chain/database.hpp @@ -204,7 +204,7 @@ namespace graphene { namespace chain { /** this signal is emitted any time an object is removed and contains a * pointer to the last value of every object that was removed. */ - fc::signal&)> removed_objects; + fc::signal&, const vector&)> removed_objects; //////////////////// db_witness_schedule.cpp ////////////////////