Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#801 remove children_rshares2 from consensus #1027

Merged
merged 4 commits into from Apr 25, 2017

Conversation

NateBrune
Copy link
Contributor

No description provided.

@mvandeberg
Copy link
Contributor

On reindex

3415714ms th_a       database.cpp:2733             _apply_block         ] 10 assert_exception: Assert Exception
ctx.total_reward_shares2 > 0: 
    {}
    th_a  reward.cpp:12 get_rshare_reward

    {"ctx":{"rshares":"856788000000","reward_weight":10000,"max_sbd":"1000000.000 SBD","total_reward_shares2":"0","total_reward_fund_steem":"5778040.000 STEEM","current_steem_price":{"base":"0.220 SBD","quote":"1.000 STEEM"}}}
    th_a  reward.cpp:35 get_rshare_reward

    {"comment":{"id":9,"author":"abit","permlink":"spam","category":"","parent_author":"","parent_permlink":"","title":"Spams","body":"Spams come here","json_metadata":"{}","last_update":"2016-04-08T08:49:15","created":"2016-04-08T08:49:15","active":"2016-04-08T08:49:15","last_payout":"1970-01-01T00:00:00","depth":0,"children":0,"net_rshares":"856788000000","abs_rshares":"1610152000000","vote_rshares":"1233470000000","children_abs_rshares":1610152,"cashout_time":"2016-04-10T12:20:51","max_cashout_time":"2016-04-22T14:50:48","total_vote_weight":"723855738986","reward_weight":10000,"total_payout_value":"0.000 SBD","curator_payout_value":"0.000 SBD","beneficiary_payout_value":"0.000 SBD","author_rewards":0,"net_votes":-1,"root_comment":9,"max_accepted_payout":"1000000.000 SBD","percent_steem_dollars":10000,"allow_replies":true,"allow_votes":true,"allow_curation_rewards":true,"beneficiaries":[]}}
    th_a  database.cpp:1696 cashout_comment_helper
3415714ms th_a       database.cpp:2733             _apply_block         ] next_block.block_num(): 2889020 

Copy link
Contributor

@mvandeberg mvandeberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not reindex

…nd undo regression from removing total_reward_shares2
@@ -1526,7 +1526,7 @@ vector<discussion> database_api::get_discussions_by_cashout( const discussion_qu
const auto& tidx = my->_db.get_index<tags::tag_index>().indices().get<tags::by_cashout>();
auto tidx_itr = tidx.lower_bound( boost::make_tuple( tag, fc::time_point::now() - fc::minutes(60) ) );

return get_discussions( query, tag, parent, tidx, tidx_itr, query.truncate_body, []( const comment_api_obj& c ){ return c.children_rshares2 <= 0; } );
return get_discussions( query, tag, parent, tidx, tidx_itr, query.truncate_body, []( const comment_api_obj& c ) { return c.cashout_time <= c.created; });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lambda argument is a filter. If the filter lambda returns true then the comment is not returned. The previous filter was to remove all comments whose discussion had more negative rshares.

I would pass in filter_default for the filter arg and then make the exit arg []( const comment_api_obj& c ){ return c.net_rshares <= 0; } to stop returning results on negative payout posts.

@@ -1553,12 +1552,14 @@ void vote_evaluator::do_apply( const vote_operation& o )
}
});


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert the line spacing changes in this file.

@mvandeberg mvandeberg merged commit 36ee1b1 into master Apr 25, 2017
@mvandeberg mvandeberg deleted the 801-remove-children-rshares2 branch April 25, 2017 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants