From 29431351331a9e7001d0c501e06ea4f34363bd38 Mon Sep 17 00:00:00 2001 From: Reverse Flash Date: Tue, 5 Jul 2016 17:47:39 -0400 Subject: [PATCH 1/2] adding payout time sort order --- libraries/app/database_api.cpp | 11 +++++++++++ libraries/app/include/steemit/app/state.hpp | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index 14b95091c1..fd25d9cdd3 100755 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -1331,6 +1331,17 @@ state database_api::get_state( string path )const _state.content[key] = std::move(d); } } + else if( part[0] == "cashout" ) { + auto trending_disc = get_discussions_by_cashout( {tag,20} ); + + auto& didx = _state.discussion_idx[tag]; + for( const auto& d : trending_disc ) { + auto key = d.author +"/" + d.permlink; + didx.cashout.push_back( key ); + if( d.author.size() ) accounts.insert(d.author); + _state.content[key] = std::move(d); + } + } else if( part[0] == "active" ) { auto trending_disc = get_discussions_by_active( {tag,20} ); diff --git a/libraries/app/include/steemit/app/state.hpp b/libraries/app/include/steemit/app/state.hpp index 8d569cafd7..0340d6d46d 100644 --- a/libraries/app/include/steemit/app/state.hpp +++ b/libraries/app/include/steemit/app/state.hpp @@ -25,6 +25,7 @@ namespace steemit { namespace app { vector updated; /// creation date vector active; /// last update or reply vector votes; /// last update or reply + vector cashout; /// last update or reply vector maturing; /// about to be paid out vector best; /// total lifetime payout vector hot; /// total lifetime payout @@ -166,7 +167,7 @@ FC_REFLECT_DERIVED( steemit::app::extended_account, FC_REFLECT( steemit::app::vote_state, (voter)(weight)(rshares)(percent)(time) ); FC_REFLECT( steemit::app::account_vote, (authorperm)(weight)(rshares)(percent)(time) ); -FC_REFLECT( steemit::app::discussion_index, (category)(trending)(updated)(created)(responses)(active)(votes)(maturing)(best)(hot) ) +FC_REFLECT( steemit::app::discussion_index, (category)(trending)(updated)(created)(responses)(active)(votes)(maturing)(best)(hot)(cashout) ) FC_REFLECT( steemit::app::category_index, (trending)(active)(recent)(best) ) FC_REFLECT_DERIVED( steemit::app::discussion, (steemit::chain::comment_object), (url)(root_title)(pending_payout_value)(total_pending_payout_value)(active_votes)(replies) ) From 7c4d8cac795d2ac41d282976c476b529b811c730 Mon Sep 17 00:00:00 2001 From: Reverse Flash Date: Tue, 5 Jul 2016 18:07:41 -0400 Subject: [PATCH 2/2] update version to 8.5 --- libraries/chain/include/steemit/chain/config.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/chain/include/steemit/chain/config.hpp b/libraries/chain/include/steemit/chain/config.hpp index 2c2c3d20d3..c23b98e228 100644 --- a/libraries/chain/include/steemit/chain/config.hpp +++ b/libraries/chain/include/steemit/chain/config.hpp @@ -3,7 +3,7 @@ */ #pragma once -#define STEEMIT_BLOCKCHAIN_VERSION ( version(0, 8, 4) ) +#define STEEMIT_BLOCKCHAIN_VERSION ( version(0, 8, 5) ) #define STEEMIT_BLOCKCHAIN_HARDFORK_VERSION ( hardfork_version( STEEMIT_BLOCKCHAIN_VERSION ) ) #ifdef IS_TEST_NET