BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
30 #include <boost/multi_index/composite_key.hpp>
32 namespace graphene {
namespace chain {
35 class vesting_balance_object;
47 implementation_ids, impl_account_statistics_object_type>
158 implementation_ids, impl_account_balance_object_type>
296 template<
typename DB>
370 const account_id_type& acct )
const;
372 const asset_id_type&
asset )
const;
375 static const uint8_t bits;
376 static const uint64_t mask;
379 vector< vector< map< asset_id_type, const account_balance_object* > > > balances;
380 std::stack< object_id_type > ids_being_modified;
383 struct by_asset_balance;
384 struct by_maintenance_flag;
388 typedef multi_index_container<
391 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
392 ordered_non_unique< tag<by_maintenance_flag>,
393 member< account_balance_object, bool, &account_balance_object::maintenance_flag > >,
394 ordered_unique< tag<by_asset_balance>,
397 member<account_balance_object, asset_id_type, &account_balance_object::asset_type>,
398 member<account_balance_object, share_type, &account_balance_object::balance>,
399 member<account_balance_object, account_id_type, &account_balance_object::owner>
401 composite_key_compare<
402 std::less< asset_id_type >,
403 std::greater< share_type >,
404 std::less< account_id_type >
420 typedef multi_index_container<
423 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
424 ordered_unique< tag<by_name>, member<account_object, string, &account_object::name> >
433 struct by_maintenance_seq;
434 struct by_voting_power_active;
439 typedef multi_index_container<
442 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
443 ordered_unique< tag<by_maintenance_seq>,
446 const_mem_fun<account_statistics_object, bool, &account_statistics_object::need_maintenance>,
447 member<account_statistics_object, string, &account_statistics_object::name>
450 ordered_non_unique< tag<by_voting_power_active>,
453 member<account_statistics_object, time_point_sec, &account_statistics_object::vote_tally_time>,
454 member<account_statistics_object, uint64_t, &account_statistics_object::vp_active>
456 composite_key_compare<
457 std::greater< time_point_sec >,
458 std::greater< uint64_t >
bool is_annual_member(time_point_sec now) const
tracks the blockchain state in an extensible manner
uint64_t vp_all
all voting power.
account_history_id_type most_recent_op
void process_fees(const account_object &a, database &d) const
Split up and pay out pending_fees and pending_vested_fees.
const account_balance_object * get_account_balance(const account_id_type &acct, const asset_id_type &asset) const
set< account_id_type > get_account_members(const account_object &a) const
account_id_type lifetime_referrer
The lifetime member at the top of the referral tree. Receives a percentage of referral rewards.
share_type total_pol_value
Total value of tickets whose current type is not lock_forever.
flat_set< account_id_type > blacklisting_accounts
bool has_special_authority() const
bool has_cashback_vb
redundantly store this for better maintenance performance
FC_REFLECT_TYPENAME(fc::log_message)
virtual void object_inserted(const object &obj) override
set< account_id_type > blacklisted_accounts
void adjust_balance(const asset &delta)
set< address > get_address_members(const account_object &a) const
uint8_t top_n_control_flags
const map< asset_id_type, const account_balance_object * > & get_account_balances(const account_id_type &acct) const
uint64_t vp_active
active voting power, if there is no attenuation, it is equal to vp_all.
virtual void object_inserted(const object &obj) override
virtual void object_modified(const object &after) override
multi_index_container< account_statistics_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_maintenance_seq >, composite_key< account_statistics_object, const_mem_fun< account_statistics_object, bool, &account_statistics_object::need_maintenance >, member< account_statistics_object, string, &account_statistics_object::name > > >, ordered_non_unique< tag< by_voting_power_active >, composite_key< account_statistics_object, member< account_statistics_object, time_point_sec, &account_statistics_object::vote_tally_time >, member< account_statistics_object, uint64_t, &account_statistics_object::vp_active > >, composite_key_compare< std::greater< time_point_sec >, std::greater< uint64_t > > > > > account_stats_multi_index_type
account_id_type registrar
The account that paid the fee to register this account. Receives a percentage of referral rewards.
uint16_t num_committee_voted
Pre-calculated for better performance on chain maintenance.
#define MAP_OBJECT_ID_TO_TYPE(OBJECT)
bool has_pending_fees() const
Whether this account has pending fees, no matter vested or not.
multi_index_container< account_balance_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_non_unique< tag< by_maintenance_flag >, member< account_balance_object, bool, &account_balance_object::maintenance_flag > >, ordered_unique< tag< by_asset_balance >, composite_key< account_balance_object, member< account_balance_object, asset_id_type, &account_balance_object::asset_type >, member< account_balance_object, share_type, &account_balance_object::balance >, member< account_balance_object, account_id_type, &account_balance_object::owner > >, composite_key_compare< std::less< asset_id_type >, std::greater< share_type >, std::less< account_id_type > > > > > account_balance_object_multi_index_type
These are the fields which can be updated by the active authority.
generic_index< account_balance_object, account_balance_object_multi_index_type > account_balance_index
Tracks the balance of a single account/asset pair.
static time_point_sec maximum()
This secondary index will allow fast access to the balance objects that belonging to an account.
uint16_t network_fee_percentage
Percentage of fee which should go to network.
share_type lifetime_fees_paid
bool is_lifetime_member() const
time_point_sec last_vote_time
last time voted
bool is_member(time_point_sec now) const
This secondary index will allow a reverse lookup of all accounts that a particular key or account is ...
bool need_maintenance() const
Whether need to process this account during the maintenance interval.
generic_index< account_object, account_multi_index_type > account_index
uint64_t vp_witness
the final voting power for the witnesses.
uint32_t creation_block_num
The block number when the account was created.
share_type core_in_balance
asset get_balance() const
share_type total_core_inactive
Total amount of core token in inactive lock_forever tickets.
This class represents an account on the object graph.
uint64_t vp_committee
the final voting power for the committees.
virtual void object_modified(const object &after) override
special_authority active_special_authority
optional< vesting_balance_id_type > cashback_vb
map< address, set< account_id_type > > account_to_address_memberships
virtual void about_to_modify(const object &before) override
static const uint8_t top_n_control_owner
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
time_point_sec creation_time
The time when the account was created.
set< account_id_type > whitelisted_accounts
share_type total_core_pob
Total amount of core token in active lock_forever tickets.
virtual void object_removed(const object &obj) override
uint16_t lifetime_referrer_fee_percentage
Percentage of fee which should go to lifetime referrer.
set< public_key_type, pubkey_comparator > before_key_members
uint16_t referrer_rewards_percentage
time_point_sec membership_expiration_date
generic_index< account_statistics_object, account_stats_multi_index_type > account_stats_index
bool has_some_core_voting() const
Whether this account owns some CORE asset and is voting.
bool is_voting
redundately store "if this account is voting" for better maintenance performance
flat_set< account_id_type > whitelisting_accounts
string name
redundantly store account name here for better maintenance performance
set< public_key_type, pubkey_comparator > get_key_members(const account_object &a) const
special_authority owner_special_authority
share_type total_pob_value
Total value of tickets whose current type is lock_forever.
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
string name
The account's name. This name must be unique among all account names on the graph....
multi_index_container< account_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_name >, member< account_object, string, &account_object::name > > > > account_multi_index_type
bool maintenance_flag
Whether need to process this balance object in maintenance interval.
share_type total_core_in_orders
account_statistics_id_type statistics
time_point_sec vote_tally_time
#define GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE
map< public_key_type, set< account_id_type >, pubkey_comparator > account_to_key_memberships
map< account_id_type, set< account_id_type > > account_to_account_memberships
Identifies a weighted set of keys and accounts that must approve operations.
provides stack-based nullable value similar to boost::optional
share_type pending_vested_fees
virtual void object_removed(const object &obj) override
account_id_type referrer
The account credited as referring this account. Receives a percentage of referral rewards.
virtual void about_to_modify(const object &before) override
optional< flat_set< asset_id_type > > allowed_assets
static const uint8_t top_n_control_active
set< account_id_type > before_account_members
bool is_basic_account(time_point_sec now) const
set< address > before_address_members
void pay_fee(share_type core_fee, share_type cashback_vesting_threshold)
const vesting_balance_object & cashback_balance(const DB &db) const
share_type total_core_pol
Total amount of core token in other tickets.