diff --git a/libraries/chain/database.cpp b/libraries/chain/database.cpp index 787eee8c64..58a3a1d0c3 100644 --- a/libraries/chain/database.cpp +++ b/libraries/chain/database.cpp @@ -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); } @@ -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 @@ -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; } @@ -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) { diff --git a/libraries/chain/include/golos/chain/database.hpp b/libraries/chain/include/golos/chain/database.hpp index 532eba671b..3600785f65 100644 --- a/libraries/chain/include/golos/chain/database.hpp +++ b/libraries/chain/include/golos/chain/database.hpp @@ -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);