Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Do not promote author by auction curator payout #1014
Browse files Browse the repository at this point in the history
  • Loading branch information
maslenitsa93 committed Jul 24, 2019
1 parent 27817d7 commit 9983335
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
24 changes: 4 additions & 20 deletions libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2387,18 +2387,9 @@ namespace golos { namespace chain {
return delegators_reward;
}

uint64_t database::pay_curator(const comment_vote_object& cvo, uint64_t claim, const account_name_type& author, const std::string& permlink) {
void database::pay_curator(const comment_vote_object& cvo, uint64_t claim, const account_name_type& author, const std::string& permlink) {
const auto &voter = get(cvo.voter);

uint64_t to_author = 0;
if (has_hardfork(STEEMIT_HARDFORK_0_21__1014)) {
to_author = (uint128_t(claim) * cvo.author_promote_rate / STEEMIT_100_PERCENT).to_uint64();
claim -= to_author;
if (claim == 0) {
return to_author;
}
}

if (has_hardfork(STEEMIT_HARDFORK_0_19__756)) {
claim -= pay_delegators(voter, cvo, claim);
}
Expand All @@ -2410,8 +2401,6 @@ namespace golos { namespace chain {
modify(voter, [&](account_object &a) {
a.curation_rewards += claim;
});

return to_author;
}
/**
* This method will iterate through all comment_vote_objects and give them
Expand Down Expand Up @@ -2449,12 +2438,11 @@ namespace golos { namespace chain {
}

if (claim > 0) { // min_amt is non-zero satoshis
if (has_hardfork(STEEMIT_HARDFORK_0_21__1014)) {
claim -= (uint128_t(claim) * (*itr->vote).author_promote_rate / STEEMIT_100_PERCENT).to_uint64();
}
unclaimed_rewards -= claim;
<<<<<<< 371901d7973e0b5d18d053f3f218243cb0ee8350
actual_rewards += pay_curator(*itr->vote, claim, c.comment.author, to_string(c.comment.permlink));
=======
unclaimed_rewards += pay_curator(*itr->vote, claim, c.comment.author, to_string(c.comment.permlink));
>>>>>>> Allow curator promote author with rate of his reward #1014
} else {
break;
}
Expand All @@ -2463,12 +2451,8 @@ namespace golos { namespace chain {
// pay needed claim + rest unclaimed tokens (close to zero value) to curator with greates weight
// BTW: it has to be unclaimed_rewards.value not heaviest_vote_after_auw_weight + unclaimed_rewards.value, coz
// unclaimed_rewards already contains this.
<<<<<<< 371901d7973e0b5d18d053f3f218243cb0ee8350
actual_rewards = pay_curator(*heaviest_itr->vote, unclaimed_rewards.value, c.comment.author, to_string(c.comment.permlink));
unclaimed_rewards = 0;
=======
unclaimed_rewards = pay_curator(*heaviest_itr->vote, unclaimed_rewards.value, c.comment.author, to_string(c.comment.permlink));
>>>>>>> Allow curator promote author with rate of his reward #1014
}
}
if (!c.comment.allow_curation_rewards) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/golos/chain/database.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ namespace golos { namespace chain {

bool _resize(uint32_t block_num);

uint64_t pay_curator(const comment_vote_object& cvo, uint64_t claim, const account_name_type& author, const std::string& permlink);
void pay_curator(const comment_vote_object& cvo, uint64_t claim, const account_name_type& author, const std::string& permlink);

void adjust_sbd_balance(const account_object &a, const asset &delta);

Expand Down

0 comments on commit 9983335

Please sign in to comment.