Skip to content

Commit

Permalink
all content actions with usernames are filtered out
Browse files Browse the repository at this point in the history
  • Loading branch information
petrkotegov committed Feb 14, 2019
1 parent 1c90f6d commit 64c9070
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions uos_rates/include/eosio/uos_rates/data_processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ namespace uos {
auto block_height = current_calc_block - block_num;


//Todo:fix from to(action exclude duplicate )
if (trx["action"].as_string() == "makecontent" ) {

auto from = trx["data"]["acc"].as_string();
Expand All @@ -238,16 +237,20 @@ namespace uos {
if(content_type_id == "4")
return result;

if(prev_cumulative_emission.find(to) != prev_cumulative_emission.end())
{
elog("makecontent to user rejected "+ from + " to " + to);
return result;
}

if(st_make_id_contents.insert(to).second == false)
{
elog(" \n Duplicate social transaction makecontent - id_contens: " + to + " pirate: "+ from);
} else
{
ownership_t ownership(from, to, block_height);
result.push_back(std::make_shared<ownership_t>(ownership));
return result;
}

ownership_t ownership(from, to, block_height);
result.push_back(std::make_shared<ownership_t>(ownership));
}

if (trx["action"].as_string() == "usertocont") {
Expand All @@ -271,22 +274,26 @@ namespace uos {
result.push_back(std::make_shared<downvote_t>(downvote));
}
}
//Todo:fix from to(action exclude duplicate )

if (trx["action"].as_string() == "makecontorg") {

auto from = trx["data"]["organization_id"].as_string();
auto to = trx["data"]["content_id"].as_string();

if(prev_cumulative_emission.find(to) != prev_cumulative_emission.end())
{
elog("makecontorg to user rejected "+ from + " to " + to);
return result;
}

if(st_make_id_contents.insert(to).second == false)
{
elog(" \n Duplicate social transaction makecontorg - id_content:" + to + " pirate: "+ from);
} else
{
ownership_t ownershiporg(from, to, block_height);
result.push_back(std::make_shared<ownership_t>(ownershiporg));
return result;
}

ownership_t ownershiporg(from, to, block_height);
result.push_back(std::make_shared<ownership_t>(ownershiporg));
}

return result;
Expand All @@ -305,6 +312,11 @@ namespace uos {
}
//add the content
else {
if(prev_cumulative_emission.find(to) != prev_cumulative_emission.end())
{
elog("makeconent rejected again " + from + " " + to);
return;
}
if(content.find(to) == content.end())
content[to] = fc::mutable_variant_object();
}
Expand Down

0 comments on commit 64c9070

Please sign in to comment.