Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Compatibility Fixes for Nodeos 1.8.x #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/watcher_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ namespace eosio {

typedef std::unordered_multimap<transaction_id_type, sequenced_action> action_queue_t;

chain_plugin* chain_plug = nullptr;
fc::optional<boost::signals2::scoped_connection> accepted_block_conn;
fc::optional<boost::signals2::scoped_connection> applied_tx_conn;
chain_plugin* chain_plug;
fc::optional<boost::signals2::scoped_connection> accepted_block_connection;
fc::optional<boost::signals2::scoped_connection> applied_transaction_connection;
std::set<watcher_plugin_impl::filter_entry> filter_on;
http_async_client httpc;
fc::url receiver_url;
Expand All @@ -93,9 +93,9 @@ namespace eosio {


bool filter(const action_trace& act) {
if( filter_on.find({act.receipt.receiver, act.act.name}) != filter_on.end())
if( filter_on.find({act.receiver, act.act.name}) != filter_on.end())
return true;
else if( filter_on.find({act.receipt.receiver, 0}) != filter_on.end())
else if( filter_on.find({act.receiver, 0}) != filter_on.end())
return true;
return false;
}
Expand All @@ -119,15 +119,17 @@ namespace eosio {
//~ ilog("on_action_trace - tx id: ${u}", ("u",tx_id));
if( filter(act)) {
action_queue.insert(std::make_pair(tx_id, sequenced_action(act.act, act_sequence,
act.receipt.receiver)));
act.receiver)));
//~ ilog("Added to action_queue: ${u}", ("u",act.act));
}
act_sequence++;

/*
for( const auto& iline : act.inline_traces ) {
//~ ilog("Processing inline_trace: ${u}", ("u",iline));
act_sequence = on_action_trace(iline, tx_id, act_sequence);
}
*/

return act_sequence;
}
Expand Down Expand Up @@ -267,16 +269,17 @@ namespace eosio {

my->chain_plug = app().find_plugin<chain_plugin>();
auto& chain = my->chain_plug->chain();
my->accepted_block_conn.emplace(chain.accepted_block.connect(
[&](const block_state_ptr& b_state) {

my->accepted_block_connection.emplace(
chain.accepted_block.connect([&](const block_state_ptr& b_state) {
my->on_accepted_block(b_state);
}));

my->applied_tx_conn.emplace(chain.applied_transaction.connect(
[&](const transaction_trace_ptr& tt) {
my->on_applied_tx(tt);
}
));
my->applied_transaction_connection.emplace(
chain.applied_transaction.connect([&](std::tuple<const transaction_trace_ptr&, const signed_transaction&> t) {
my->on_applied_tx(std::get<0>(t));
}));

} FC_LOG_AND_RETHROW()
}

Expand All @@ -286,8 +289,8 @@ namespace eosio {
}

void watcher_plugin::plugin_shutdown() {
my->applied_tx_conn.reset();
my->accepted_block_conn.reset();
my->applied_transaction_connection.reset();
my->accepted_block_connection.reset();
my->httpc.stop();
}

Expand Down