Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Not write follow operations dump in wrong cases #1333
Browse files Browse the repository at this point in the history
  • Loading branch information
soft-bagel-93 committed Jun 18, 2019
1 parent e9a5f5e commit 808599b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,16 @@ class operation_dump_visitor {
fc::raw::pack(b, _block.timestamp);
}

// Not logs if operation failed in plugin, but logs if plugin not exists
// Not logs if operation failed in plugin or if plugin not exists and cannot check operation
auto operator()(const custom_json_operation& op) -> result_type {
if (op.id != "follow") { // follows, reblogs, delete_reblogs
return;
}

if (!_db.has_index<follow_index>()) {
return;
}

std::vector<follow_plugin_operation> fpops;

auto v = fc::json::from_string(op.json);
Expand All @@ -153,6 +157,10 @@ class operation_dump_visitor {
}

auto operator()(const follow_operation& op) -> result_type {
if (!_db.find_account(op.follower) || !_db.find_account(op.following)) {
return;
}

auto& b = write_op_header("follows", std::string(op.follower) + "/" + op.following);

fc::raw::pack(b, op.follower);
Expand Down

0 comments on commit 808599b

Please sign in to comment.