Commit eda528d7 authored by Mariusz's avatar Mariusz

A virtual operation `comment_payout_update_operation` carries an information if a `paidout` is done

parent 2e979ee0
......@@ -2733,7 +2733,9 @@ share_type database::cashout_comment_helper( util::comment_reward_context& ctx,
c.last_payout = head_block_time();
} );
push_virtual_operation( comment_payout_update_operation( get_account(comment_cashout.author_id).name, to_string( comment_cashout.permlink ) ) );
push_virtual_operation( comment_payout_update_operation( get_account(comment_cashout.author_id).name,
to_string( comment_cashout.permlink ),
comment_cashout.cashout_time == fc::time_point_sec::maximum() ) );
const auto& vote_idx = get_index< comment_vote_index >().indices().get< by_comment_voter >();
auto vote_itr = vote_idx.lower_bound( comment.get_id() );
......
......@@ -252,6 +252,11 @@ struct get_impacted_account_visitor
_impacted.emplace(op.voter);
}
void operator()(const comment_payout_update_operation& op)
{
_impacted.insert(op.author);
}
void operator()( const comment_benefactor_reward_operation& op )
{
_impacted.insert( op.benefactor );
......
......@@ -145,10 +145,11 @@ namespace hive { namespace protocol {
struct comment_payout_update_operation : public virtual_operation
{
comment_payout_update_operation() {}
comment_payout_update_operation( const account_name_type& a, const string& p ) : author( a ), permlink( p ) {}
comment_payout_update_operation( const account_name_type& a, const string& p, bool ip ) : author( a ), permlink( p ), is_paidout( ip ) {}
account_name_type author;
string permlink;
bool is_paidout;
};
struct effective_comment_vote_operation : public virtual_operation
......@@ -270,7 +271,7 @@ FC_REFLECT( hive::protocol::shutdown_witness_operation, (owner) )
FC_REFLECT( hive::protocol::fill_order_operation, (current_owner)(current_orderid)(current_pays)(open_owner)(open_orderid)(open_pays) )
FC_REFLECT( hive::protocol::fill_transfer_from_savings_operation, (from)(to)(amount)(request_id)(memo) )
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)(is_paidout) )
FC_REFLECT( hive::protocol::effective_comment_vote_operation, (voter)(author)(permlink)(weight)(rshares)(vote_percent)(pending_payout))
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) )
......
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