Merge commit 'aa6f3e9051787bfc1b4284f1684544cca9bfc9c9' into betting

This commit is contained in:
Eric Frias 2017-06-21 16:08:58 -04:00
commit 636f28eac6
6 changed files with 18 additions and 7 deletions

View file

@ -1 +1 @@
2.0.170328
2.0.170410

View file

@ -684,6 +684,11 @@ std::map<std::string, full_account> 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<force_settlement_index>().indices().get<by_account>().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<asset_index>().indices().get<by_issuer>().equal_range(account->id);

View file

@ -44,6 +44,7 @@ namespace graphene { namespace app {
vector<vesting_balance_object> vesting_balances;
vector<limit_order_object> limit_orders;
vector<call_order_object> call_orders;
vector<force_settlement_object> settle_orders;
vector<proposal_object> proposals;
vector<asset_id_type> assets;
vector<withdraw_permission_object> 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)
)

View file

@ -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<transaction_index&>(get_mutable_index(implementation_ids, impl_transaction_object_type));
const auto& dedupe_index = transaction_idx.indices().get<by_expiration>();
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()

View file

@ -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>( [&]( 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()

View file

@ -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();