From 3d9ae3d86e747fea37b1473086f97dd8202e1642 Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Fri, 7 Apr 2017 18:57:31 -0300 Subject: [PATCH 1/5] market_history plugin fix fix get_trade_history and calls that use it(get_ticker, get_24_volume), --- libraries/plugins/market_history/market_history_plugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/plugins/market_history/market_history_plugin.cpp b/libraries/plugins/market_history/market_history_plugin.cpp index 28cbb7c7..6ec38968 100644 --- a/libraries/plugins/market_history/market_history_plugin.cpp +++ b/libraries/plugins/market_history/market_history_plugin.cpp @@ -110,7 +110,7 @@ struct operation_process_fill_order hkey.sequence += 200; itr = history_idx.lower_bound( hkey ); - + /* while( itr != history_idx.end() ) { if( itr->key.base == hkey.base && itr->key.quote == hkey.quote ) @@ -120,6 +120,7 @@ struct operation_process_fill_order } else break; } + */ auto max_history = _plugin.max_history(); From 2c05590cd431dfa96a4c69d30bd3de0c58f02496 Mon Sep 17 00:00:00 2001 From: Abit Date: Sun, 9 Apr 2017 00:20:13 +0200 Subject: [PATCH 2/5] Fix clear_expired_transactions memory leak #256 --- libraries/chain/db_update.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/chain/db_update.cpp b/libraries/chain/db_update.cpp index 2219136e..1c7c2e1c 100644 --- a/libraries/chain/db_update.cpp +++ b/libraries/chain/db_update.cpp @@ -162,8 +162,8 @@ void database::clear_expired_transactions() //Transactions must have expired by at least two forking windows in order to be removed. auto& transaction_idx = static_cast(get_mutable_index(implementation_ids, impl_transaction_object_type)); const auto& dedupe_index = transaction_idx.indices().get(); - while( (!dedupe_index.empty()) && (head_block_time() > dedupe_index.rbegin()->trx.expiration) ) - transaction_idx.remove(*dedupe_index.rbegin()); + while( (!dedupe_index.empty()) && (head_block_time() > dedupe_index.begin()->trx.expiration) ) + transaction_idx.remove(*dedupe_index.begin()); } FC_CAPTURE_AND_RETHROW() } void database::clear_expired_proposals() From a4a8b67eba214322a96a629f2f5fde259c92214f Mon Sep 17 00:00:00 2001 From: Abit Date: Sun, 9 Apr 2017 00:57:41 +0200 Subject: [PATCH 3/5] Fix account_history filtering by account #258 --- libraries/plugins/account_history/account_history_plugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/plugins/account_history/account_history_plugin.cpp b/libraries/plugins/account_history/account_history_plugin.cpp index bdd1fb23..56d1f278 100644 --- a/libraries/plugins/account_history/account_history_plugin.cpp +++ b/libraries/plugins/account_history/account_history_plugin.cpp @@ -139,10 +139,13 @@ void account_history_plugin_impl::update_account_histories( const signed_block& const auto& stats_obj = account_id(db).statistics(db); const auto& ath = db.create( [&]( account_transaction_history_object& obj ){ obj.operation_id = oho.id; + obj.account = account_id; + obj.sequence = stats_obj.total_ops+1; obj.next = stats_obj.most_recent_op; }); db.modify( stats_obj, [&]( account_statistics_object& obj ){ obj.most_recent_op = ath.id; + obj.total_ops = ath.sequence; }); } } @@ -187,7 +190,7 @@ void account_history_plugin::plugin_initialize(const boost::program_options::var database().add_index< primary_index< simple_index< operation_history_object > > >(); database().add_index< primary_index< account_transaction_history_index > >(); - LOAD_VALUE_SET(options, "tracked-accounts", my->_tracked_accounts, graphene::chain::account_id_type); + LOAD_VALUE_SET(options, "track-account", my->_tracked_accounts, graphene::chain::account_id_type); } void account_history_plugin::plugin_startup() From 4971dba0f5d2a10eaa53fc0dabec8319d8748a83 Mon Sep 17 00:00:00 2001 From: Sigve Kvalsvik Date: Mon, 10 Apr 2017 14:09:01 +0200 Subject: [PATCH 4/5] Update gui_version --- gui_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui_version b/gui_version index 462b6bda..b018b938 100644 --- a/gui_version +++ b/gui_version @@ -1 +1 @@ -2.0.170328 +2.0.170410 From a3fe0e128ca0847912e091af8cc9125edf3ecc08 Mon Sep 17 00:00:00 2001 From: alt Date: Sat, 15 Apr 2017 12:24:51 +1000 Subject: [PATCH 5/5] return force settlement order with the get_full_account api --- libraries/app/database_api.cpp | 5 +++++ libraries/app/include/graphene/app/full_account.hpp | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index 5c882d07..09052f20 100644 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -666,6 +666,11 @@ std::map database_api_impl::get_full_accounts( const [&acnt] (const call_order_object& call) { acnt.call_orders.emplace_back(call); }); + auto settle_range = _db.get_index_type().indices().get().equal_range(account->id); + std::for_each(settle_range.first, settle_range.second, + [&acnt] (const force_settlement_object& settle) { + acnt.settle_orders.emplace_back(settle); + }); // get assets issued by user auto asset_range = _db.get_index_type().indices().get().equal_range(account->id); diff --git a/libraries/app/include/graphene/app/full_account.hpp b/libraries/app/include/graphene/app/full_account.hpp index a8c87844..dea5eb7e 100644 --- a/libraries/app/include/graphene/app/full_account.hpp +++ b/libraries/app/include/graphene/app/full_account.hpp @@ -44,6 +44,7 @@ namespace graphene { namespace app { vector vesting_balances; vector limit_orders; vector call_orders; + vector settle_orders; vector proposals; vector assets; vector withdraws; @@ -51,7 +52,7 @@ namespace graphene { namespace app { } } -FC_REFLECT( graphene::app::full_account, +FC_REFLECT( graphene::app::full_account, (account) (statistics) (registrar_name) @@ -63,7 +64,8 @@ FC_REFLECT( graphene::app::full_account, (vesting_balances) (limit_orders) (call_orders) - (proposals) + (settle_orders) + (proposals) (assets) (withdraws) )