From 808599b7c5c464b5c823749d09378e9670bedc96 Mon Sep 17 00:00:00 2001 From: boostmultifruit Date: Tue, 18 Jun 2019 16:17:03 +0300 Subject: [PATCH] Not write follow operations dump in wrong cases #1333 --- .../plugins/operation_dump/operation_dump_visitor.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/operation_dump/include/golos/plugins/operation_dump/operation_dump_visitor.hpp b/plugins/operation_dump/include/golos/plugins/operation_dump/operation_dump_visitor.hpp index 12dcb72646..c5e93b2dfc 100644 --- a/plugins/operation_dump/include/golos/plugins/operation_dump/operation_dump_visitor.hpp +++ b/plugins/operation_dump/include/golos/plugins/operation_dump/operation_dump_visitor.hpp @@ -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()) { + return; + } + std::vector fpops; auto v = fc::json::from_string(op.json); @@ -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);