Commit 6b944337 authored by Mariusz's avatar Mariusz

Added `ineffective_delete_comment_operation` in order to follow comments that weren't removed

parent 588ea1e1
...@@ -650,7 +650,11 @@ void delete_comment_evaluator::do_apply( const delete_comment_operation& o ) ...@@ -650,7 +650,11 @@ void delete_comment_evaluator::do_apply( const delete_comment_operation& o )
if( _db.has_hardfork( HIVE_HARDFORK_0_19__977 ) ) if( _db.has_hardfork( HIVE_HARDFORK_0_19__977 ) )
FC_ASSERT( comment_cashout->net_rshares <= 0, "Cannot delete a comment with net positive votes." ); FC_ASSERT( comment_cashout->net_rshares <= 0, "Cannot delete a comment with net positive votes." );
if( comment_cashout->net_rshares > 0 ) return; if( comment_cashout->net_rshares > 0 )
{
_db.push_virtual_operation( ineffective_delete_comment_operation( o.author, o.permlink ) );
return;
}
const auto& vote_idx = _db.get_index<comment_vote_index>().indices().get<by_comment_voter>(); const auto& vote_idx = _db.get_index<comment_vote_index>().indices().get<by_comment_voter>();
......
...@@ -252,6 +252,11 @@ struct get_impacted_account_visitor ...@@ -252,6 +252,11 @@ struct get_impacted_account_visitor
_impacted.emplace(op.voter); _impacted.emplace(op.voter);
} }
void operator()(const ineffective_delete_comment_operation& op)
{
_impacted.emplace(op.author);
}
void operator()(const comment_payout_update_operation& op) void operator()(const comment_payout_update_operation& op)
{ {
_impacted.insert(op.author); _impacted.insert(op.author);
......
...@@ -224,7 +224,7 @@ struct filtering_visitor ...@@ -224,7 +224,7 @@ struct filtering_visitor
(return_vesting_delegation_operation)(comment_benefactor_reward_operation)(producer_reward_operation) (return_vesting_delegation_operation)(comment_benefactor_reward_operation)(producer_reward_operation)
(clear_null_account_balance_operation)(proposal_pay_operation)(sps_fund_operation) (clear_null_account_balance_operation)(proposal_pay_operation)(sps_fund_operation)
(hardfork_hive_operation)(hardfork_hive_restore_operation)(delayed_voting_operation) (hardfork_hive_operation)(hardfork_hive_restore_operation)(delayed_voting_operation)
(consolidate_treasury_balance_operation)(effective_comment_vote_operation) ) (consolidate_treasury_balance_operation)(effective_comment_vote_operation)(ineffective_delete_comment_operation) )
private: private:
uint32_t _filter = 0; uint32_t _filter = 0;
......
...@@ -101,7 +101,8 @@ enum enum_vops_filter : uint32_t ...@@ -101,7 +101,8 @@ enum enum_vops_filter : uint32_t
hardfork_hive_restore_operation = 0x080000, hardfork_hive_restore_operation = 0x080000,
delayed_voting_operation = 0x100000, delayed_voting_operation = 0x100000,
consolidate_treasury_balance_operation = 0x200000, consolidate_treasury_balance_operation = 0x200000,
effective_comment_vote_operation = 0x400000 effective_comment_vote_operation = 0x400000,
ineffective_delete_comment_operation = 0x800000
}; };
/** Allows to specify range of blocks to retrieve virtual operations for. /** Allows to specify range of blocks to retrieve virtual operations for.
......
...@@ -397,6 +397,7 @@ struct count_operation_visitor ...@@ -397,6 +397,7 @@ struct count_operation_visitor
void operator()( const hardfork_operation& ) const {} void operator()( const hardfork_operation& ) const {}
void operator()( const comment_payout_update_operation& ) const {} void operator()( const comment_payout_update_operation& ) const {}
void operator()(const effective_comment_vote_operation&) const {} void operator()(const effective_comment_vote_operation&) const {}
void operator()(const ineffective_delete_comment_operation&) const {}
void operator()( const return_vesting_delegation_operation& ) const {} void operator()( const return_vesting_delegation_operation& ) const {}
void operator()( const comment_benefactor_reward_operation& ) const {} void operator()( const comment_benefactor_reward_operation& ) const {}
void operator()( const producer_reward_operation& ) const {} void operator()( const producer_reward_operation& ) const {}
......
...@@ -167,6 +167,16 @@ namespace hive { namespace protocol { ...@@ -167,6 +167,16 @@ namespace hive { namespace protocol {
asset pending_payout = asset( 0, HBD_SYMBOL ); //supplemented by account history RocksDB plugin (needed by HiveMind) asset pending_payout = asset( 0, HBD_SYMBOL ); //supplemented by account history RocksDB plugin (needed by HiveMind)
}; };
struct ineffective_delete_comment_operation : public virtual_operation
{
ineffective_delete_comment_operation() = default;
ineffective_delete_comment_operation(const account_name_type& _author, const string& _permlink) :
author(_author), permlink(_permlink) {}
account_name_type author;
string permlink;
};
struct return_vesting_delegation_operation : public virtual_operation struct return_vesting_delegation_operation : public virtual_operation
{ {
return_vesting_delegation_operation() {} return_vesting_delegation_operation() {}
...@@ -272,6 +282,7 @@ FC_REFLECT( hive::protocol::fill_transfer_from_savings_operation, (from)(to)(amo ...@@ -272,6 +282,7 @@ FC_REFLECT( hive::protocol::fill_transfer_from_savings_operation, (from)(to)(amo
FC_REFLECT( hive::protocol::hardfork_operation, (hardfork_id) ) FC_REFLECT( hive::protocol::hardfork_operation, (hardfork_id) )
FC_REFLECT( hive::protocol::comment_payout_update_operation, (author)(permlink) ) FC_REFLECT( hive::protocol::comment_payout_update_operation, (author)(permlink) )
FC_REFLECT( hive::protocol::effective_comment_vote_operation, (voter)(author)(permlink)(weight)(rshares)(pending_payout)) FC_REFLECT( hive::protocol::effective_comment_vote_operation, (voter)(author)(permlink)(weight)(rshares)(pending_payout))
FC_REFLECT( hive::protocol::ineffective_delete_comment_operation, (author)(permlink))
FC_REFLECT( hive::protocol::return_vesting_delegation_operation, (account)(vesting_shares) ) FC_REFLECT( hive::protocol::return_vesting_delegation_operation, (account)(vesting_shares) )
FC_REFLECT( hive::protocol::comment_benefactor_reward_operation, (benefactor)(author)(permlink)(hbd_payout)(hive_payout)(vesting_payout) ) FC_REFLECT( hive::protocol::comment_benefactor_reward_operation, (benefactor)(author)(permlink)(hbd_payout)(hive_payout)(vesting_payout) )
FC_REFLECT( hive::protocol::producer_reward_operation, (producer)(vesting_shares) ) FC_REFLECT( hive::protocol::producer_reward_operation, (producer)(vesting_shares) )
......
...@@ -107,7 +107,8 @@ namespace hive { namespace protocol { ...@@ -107,7 +107,8 @@ namespace hive { namespace protocol {
hardfork_hive_restore_operation, hardfork_hive_restore_operation,
delayed_voting_operation, delayed_voting_operation,
consolidate_treasury_balance_operation, consolidate_treasury_balance_operation,
effective_comment_vote_operation effective_comment_vote_operation,
ineffective_delete_comment_operation
> operation; > operation;
/*void operation_get_required_authorities( const operation& op, /*void operation_get_required_authorities( const operation& op,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment