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

Commit

Permalink
Merge pull request #1334 from GolosChain/1333-operation-dump-fix-cust…
Browse files Browse the repository at this point in the history
…om-json

Not write follow operations dump in wrong cases #1333
  • Loading branch information
afalaleev authored Jun 19, 2019
2 parents e9a5f5e + 808599b commit d6122da
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 d6122da

Please sign in to comment.