debug_witness: Handle new params in changed/remove signals from database

This commit is contained in:
elmato 2017-03-08 01:52:25 +00:00
parent aab5fddb2f
commit cff792a740
2 changed files with 8 additions and 6 deletions

View file

@ -98,13 +98,13 @@ void debug_witness_plugin::plugin_startup()
// connect needed signals // connect needed signals
_applied_block_conn = db.applied_block.connect([this](const graphene::chain::signed_block& b){ on_applied_block(b); }); _applied_block_conn = db.applied_block.connect([this](const graphene::chain::signed_block& b){ on_applied_block(b); });
_changed_objects_conn = db.changed_objects.connect([this](const std::vector<graphene::db::object_id_type>& ids){ on_changed_objects(ids); }); _changed_objects_conn = db.changed_objects.connect([this](const std::vector<graphene::db::object_id_type>& ids, const fc::flat_set<graphene::chain::account_id_type>& impacted_accounts){ on_changed_objects(ids, impacted_accounts); });
_removed_objects_conn = db.removed_objects.connect([this](const std::vector<graphene::db::object_id_type>& ids, const std::vector<const graphene::db::object*>& objs){ on_removed_objects(ids, objs); }); _removed_objects_conn = db.removed_objects.connect([this](const std::vector<graphene::db::object_id_type>& ids, const std::vector<const graphene::db::object*>& objs, const fc::flat_set<graphene::chain::account_id_type>& impacted_accounts){ on_removed_objects(ids, objs, impacted_accounts); });
return; return;
} }
void debug_witness_plugin::on_changed_objects( const std::vector<graphene::db::object_id_type>& ids ) void debug_witness_plugin::on_changed_objects( const std::vector<graphene::db::object_id_type>& ids, const fc::flat_set<graphene::chain::account_id_type>& impacted_accounts )
{ {
if( _json_object_stream && (ids.size() > 0) ) if( _json_object_stream && (ids.size() > 0) )
{ {
@ -120,7 +120,7 @@ void debug_witness_plugin::on_changed_objects( const std::vector<graphene::db::o
} }
} }
void debug_witness_plugin::on_removed_objects( const std::vector<graphene::db::object_id_type>& ids, const std::vector<const graphene::db::object*> objs ) void debug_witness_plugin::on_removed_objects( const std::vector<graphene::db::object_id_type>& ids, const std::vector<const graphene::db::object*> objs, const fc::flat_set<graphene::chain::account_id_type>& impacted_accounts )
{ {
if( _json_object_stream ) if( _json_object_stream )
{ {

View file

@ -25,8 +25,10 @@
#include <graphene/app/plugin.hpp> #include <graphene/app/plugin.hpp>
#include <graphene/chain/database.hpp> #include <graphene/chain/database.hpp>
#include <graphene/chain/protocol/types.hpp>
#include <fc/thread/future.hpp> #include <fc/thread/future.hpp>
#include <fc/container/flat.hpp>
namespace graphene { namespace debug_witness_plugin { namespace graphene { namespace debug_witness_plugin {
@ -50,8 +52,8 @@ public:
private: private:
void on_changed_objects( const std::vector<graphene::db::object_id_type>& ids ); void on_changed_objects( const std::vector<graphene::db::object_id_type>& ids, const fc::flat_set<graphene::chain::account_id_type>& impacted_accounts );
void on_removed_objects( const std::vector<graphene::db::object_id_type>& ids, const std::vector<const graphene::db::object*> objs ); void on_removed_objects( const std::vector<graphene::db::object_id_type>& ids, const std::vector<const graphene::db::object*> objs, const fc::flat_set<graphene::chain::account_id_type>& impacted_accounts );
void on_applied_block( const graphene::chain::signed_block& b ); void on_applied_block( const graphene::chain::signed_block& b );
boost::program_options::variables_map _options; boost::program_options::variables_map _options;