Merge commit 'aa6f3e9051787bfc1b4284f1684544cca9bfc9c9' into betting
This commit is contained in:
commit
636f28eac6
6 changed files with 18 additions and 7 deletions
|
|
@ -1 +1 @@
|
||||||
2.0.170328
|
2.0.170410
|
||||||
|
|
|
||||||
|
|
@ -684,6 +684,11 @@ std::map<std::string, full_account> database_api_impl::get_full_accounts( const
|
||||||
[&acnt] (const call_order_object& call) {
|
[&acnt] (const call_order_object& call) {
|
||||||
acnt.call_orders.emplace_back(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
|
// get assets issued by user
|
||||||
auto asset_range = _db.get_index_type<asset_index>().indices().get<by_issuer>().equal_range(account->id);
|
auto asset_range = _db.get_index_type<asset_index>().indices().get<by_issuer>().equal_range(account->id);
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ namespace graphene { namespace app {
|
||||||
vector<vesting_balance_object> vesting_balances;
|
vector<vesting_balance_object> vesting_balances;
|
||||||
vector<limit_order_object> limit_orders;
|
vector<limit_order_object> limit_orders;
|
||||||
vector<call_order_object> call_orders;
|
vector<call_order_object> call_orders;
|
||||||
|
vector<force_settlement_object> settle_orders;
|
||||||
vector<proposal_object> proposals;
|
vector<proposal_object> proposals;
|
||||||
vector<asset_id_type> assets;
|
vector<asset_id_type> assets;
|
||||||
vector<withdraw_permission_object> withdraws;
|
vector<withdraw_permission_object> withdraws;
|
||||||
|
|
@ -63,6 +64,7 @@ FC_REFLECT( graphene::app::full_account,
|
||||||
(vesting_balances)
|
(vesting_balances)
|
||||||
(limit_orders)
|
(limit_orders)
|
||||||
(call_orders)
|
(call_orders)
|
||||||
|
(settle_orders)
|
||||||
(proposals)
|
(proposals)
|
||||||
(assets)
|
(assets)
|
||||||
(withdraws)
|
(withdraws)
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,8 @@ void database::clear_expired_transactions()
|
||||||
//Transactions must have expired by at least two forking windows in order to be removed.
|
//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));
|
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>();
|
const auto& dedupe_index = transaction_idx.indices().get<by_expiration>();
|
||||||
while( (!dedupe_index.empty()) && (head_block_time() > dedupe_index.rbegin()->trx.expiration) )
|
while( (!dedupe_index.empty()) && (head_block_time() > dedupe_index.begin()->trx.expiration) )
|
||||||
transaction_idx.remove(*dedupe_index.rbegin());
|
transaction_idx.remove(*dedupe_index.begin());
|
||||||
} FC_CAPTURE_AND_RETHROW() }
|
} FC_CAPTURE_AND_RETHROW() }
|
||||||
|
|
||||||
void database::clear_expired_proposals()
|
void database::clear_expired_proposals()
|
||||||
|
|
|
||||||
|
|
@ -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& stats_obj = account_id(db).statistics(db);
|
||||||
const auto& ath = db.create<account_transaction_history_object>( [&]( account_transaction_history_object& obj ){
|
const auto& ath = db.create<account_transaction_history_object>( [&]( account_transaction_history_object& obj ){
|
||||||
obj.operation_id = oho.id;
|
obj.operation_id = oho.id;
|
||||||
|
obj.account = account_id;
|
||||||
|
obj.sequence = stats_obj.total_ops+1;
|
||||||
obj.next = stats_obj.most_recent_op;
|
obj.next = stats_obj.most_recent_op;
|
||||||
});
|
});
|
||||||
db.modify( stats_obj, [&]( account_statistics_object& obj ){
|
db.modify( stats_obj, [&]( account_statistics_object& obj ){
|
||||||
obj.most_recent_op = ath.id;
|
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< simple_index< operation_history_object > > >();
|
||||||
database().add_index< primary_index< account_transaction_history_index > >();
|
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()
|
void account_history_plugin::plugin_startup()
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ struct operation_process_fill_order
|
||||||
|
|
||||||
hkey.sequence += 200;
|
hkey.sequence += 200;
|
||||||
itr = history_idx.lower_bound( hkey );
|
itr = history_idx.lower_bound( hkey );
|
||||||
|
/*
|
||||||
while( itr != history_idx.end() )
|
while( itr != history_idx.end() )
|
||||||
{
|
{
|
||||||
if( itr->key.base == hkey.base && itr->key.quote == hkey.quote )
|
if( itr->key.base == hkey.base && itr->key.quote == hkey.quote )
|
||||||
|
|
@ -120,6 +120,7 @@ struct operation_process_fill_order
|
||||||
}
|
}
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
auto max_history = _plugin.max_history();
|
auto max_history = _plugin.max_history();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue