BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | Public Attributes | List of all members
graphene::chain::account_statistics_object Class Reference

#include <account_object.hpp>

Inheritance diagram for graphene::chain::account_statistics_object:
graphene::db::abstract_object< account_statistics_object, implementation_ids, impl_account_statistics_object_type > graphene::db::base_abstract_object< account_statistics_object > graphene::db::object

Public Member Functions

bool has_some_core_voting () const
 Whether this account owns some CORE asset and is voting. More...
 
bool has_pending_fees () const
 Whether this account has pending fees, no matter vested or not. More...
 
bool need_maintenance () const
 Whether need to process this account during the maintenance interval. More...
 
void process_fees (const account_object &a, database &d) const
 Split up and pay out pending_fees and pending_vested_fees. More...
 
void pay_fee (share_type core_fee, share_type cashback_vesting_threshold)
 
- Public Member Functions inherited from graphene::db::abstract_object< account_statistics_object, implementation_ids, impl_account_statistics_object_type >
 abstract_object ()
 
object_id< SpaceID, TypeID > get_id () const
 
- Public Member Functions inherited from graphene::db::base_abstract_object< account_statistics_object >
std::unique_ptr< objectclone () const override
 
void move_from (object &obj) override
 
fc::variant to_variant () const override
 
std::vector< char > pack () const override
 
 object ()=default
 
 object (uint8_t space_id, uint8_t type_id)
 
- Public Member Functions inherited from graphene::db::object
 object ()=default
 
 object (uint8_t space_id, uint8_t type_id)
 
virtual ~object ()=default
 
virtual std::unique_ptr< objectclone () const =0
 
virtual fc::variant to_variant () const =0
 
virtual std::vector< char > pack () const =0
 

Public Attributes

account_id_type owner
 
string name
 redundantly store account name here for better maintenance performance More...
 
account_history_id_type most_recent_op
 
uint64_t total_ops = 0
 
uint64_t removed_ops = 0
 
share_type total_core_in_orders
 
share_type total_core_inactive
 Total amount of core token in inactive lock_forever tickets. More...
 
share_type total_core_pob
 Total amount of core token in active lock_forever tickets. More...
 
share_type total_core_pol
 Total amount of core token in other tickets. More...
 
share_type total_pob_value
 Total value of tickets whose current type is lock_forever. More...
 
share_type total_pol_value
 Total value of tickets whose current type is not lock_forever. More...
 
share_type core_in_balance
 
bool has_cashback_vb = false
 redundantly store this for better maintenance performance More...
 
bool is_voting = false
 redundately store "if this account is voting" for better maintenance performance More...
 
time_point_sec last_vote_time
 last time voted More...
 
share_type lifetime_fees_paid
 
share_type pending_fees
 
share_type pending_vested_fees
 
uint64_t vp_all = 0
 all voting power. More...
 
uint64_t vp_active = 0
 active voting power, if there is no attenuation, it is equal to vp_all. More...
 
uint64_t vp_committee = 0
 the final voting power for the committees. More...
 
uint64_t vp_witness = 0
 the final voting power for the witnesses. More...
 
uint64_t vp_worker = 0
 
time_point_sec vote_tally_time
 
- Public Attributes inherited from graphene::db::object
object_id_type id
 

Additional Inherited Members

- Static Public Attributes inherited from graphene::db::abstract_object< account_statistics_object, implementation_ids, impl_account_statistics_object_type >
static constexpr uint8_t space_id
 
static constexpr uint8_t type_id
 

Detailed Description

This object contains regularly updated statistical data about an account. It is provided for the purpose of separating the account data that changes frequently from the account data that is mostly static, which will minimize the amount of data that must be backed up as part of the undo history everytime a transfer is made.

Definition at line 46 of file account_object.hpp.

Member Function Documentation

◆ has_pending_fees()

bool graphene::chain::account_statistics_object::has_pending_fees ( ) const
inline

Whether this account has pending fees, no matter vested or not.

Definition at line 136 of file account_object.hpp.

◆ has_some_core_voting()

bool graphene::chain::account_statistics_object::has_some_core_voting ( ) const
inline

Whether this account owns some CORE asset and is voting.

Definition at line 109 of file account_object.hpp.

◆ need_maintenance()

bool graphene::chain::account_statistics_object::need_maintenance ( ) const
inline

Whether need to process this account during the maintenance interval.

Definition at line 139 of file account_object.hpp.

◆ pay_fee()

void graphene::chain::account_statistics_object::pay_fee ( share_type  core_fee,
share_type  cashback_vesting_threshold 
)

Core fees are paid into the account_statistics_object by this method

Definition at line 100 of file account_object.cpp.

◆ process_fees()

void graphene::chain::account_statistics_object::process_fees ( const account_object a,
database d 
) const

Split up and pay out pending_fees and pending_vested_fees.

Definition at line 53 of file account_object.cpp.

Member Data Documentation

◆ core_in_balance

share_type graphene::chain::account_statistics_object::core_in_balance

Redundantly store core balance in this object for better maintenance performance. Only updates on maintenance.

Definition at line 87 of file account_object.hpp.

◆ has_cashback_vb

bool graphene::chain::account_statistics_object::has_cashback_vb = false

redundantly store this for better maintenance performance

Definition at line 89 of file account_object.hpp.

◆ is_voting

bool graphene::chain::account_statistics_object::is_voting = false

redundately store "if this account is voting" for better maintenance performance

Definition at line 91 of file account_object.hpp.

◆ last_vote_time

time_point_sec graphene::chain::account_statistics_object::last_vote_time

last time voted

Definition at line 93 of file account_object.hpp.

◆ lifetime_fees_paid

share_type graphene::chain::account_statistics_object::lifetime_fees_paid

Tracks the total fees paid by this account for the purpose of calculating bulk discounts.

Definition at line 118 of file account_object.hpp.

◆ most_recent_op

account_history_id_type graphene::chain::account_statistics_object::most_recent_op

Keep the most recent operation as a root pointer to a linked list of the transaction history.

Definition at line 57 of file account_object.hpp.

◆ name

string graphene::chain::account_statistics_object::name

redundantly store account name here for better maintenance performance

Definition at line 52 of file account_object.hpp.

◆ owner

account_id_type graphene::chain::account_statistics_object::owner

Definition at line 50 of file account_object.hpp.

◆ pending_fees

share_type graphene::chain::account_statistics_object::pending_fees

Tracks the fees paid by this account which have not been disseminated to the various parties that receive them yet (registrar, referrer, lifetime referrer, network, etc). This is used as an optimization to avoid doing massive amounts of uint128 arithmetic on each and every operation.

These fees will be paid out as vesting cash-back, and this counter will reset during the maintenance interval.

Definition at line 128 of file account_object.hpp.

◆ pending_vested_fees

share_type graphene::chain::account_statistics_object::pending_vested_fees

Same as pending_fees, except these fees will be paid out as pre-vested cash-back (immediately available for withdrawal) rather than requiring the normal vesting period.

Definition at line 133 of file account_object.hpp.

◆ removed_ops

uint64_t graphene::chain::account_statistics_object::removed_ops = 0

Total operations related to this account that has been removed from the database.

Definition at line 61 of file account_object.hpp.

◆ total_core_in_orders

share_type graphene::chain::account_statistics_object::total_core_in_orders

When calculating votes it is necessary to know how much is stored in orders (and thus unavailable for transfers). Rather than maintaining an index of [asset,owner,order_id] we will simply maintain the running total here and update it every time an order is created or modified.

Definition at line 68 of file account_object.hpp.

◆ total_core_inactive

share_type graphene::chain::account_statistics_object::total_core_inactive

Total amount of core token in inactive lock_forever tickets.

Definition at line 71 of file account_object.hpp.

◆ total_core_pob

share_type graphene::chain::account_statistics_object::total_core_pob

Total amount of core token in active lock_forever tickets.

Definition at line 74 of file account_object.hpp.

◆ total_core_pol

share_type graphene::chain::account_statistics_object::total_core_pol

Total amount of core token in other tickets.

Definition at line 77 of file account_object.hpp.

◆ total_ops

uint64_t graphene::chain::account_statistics_object::total_ops = 0

Total operations related to this account.

Definition at line 59 of file account_object.hpp.

◆ total_pob_value

share_type graphene::chain::account_statistics_object::total_pob_value

Total value of tickets whose current type is lock_forever.

Definition at line 80 of file account_object.hpp.

◆ total_pol_value

share_type graphene::chain::account_statistics_object::total_pol_value

Total value of tickets whose current type is not lock_forever.

Definition at line 83 of file account_object.hpp.

◆ vote_tally_time

time_point_sec graphene::chain::account_statistics_object::vote_tally_time

Timestamp of the last count of votes. If there is no statistics, the date is less than _db.get_dynamic_global_properties().last_vote_tally_time.

Definition at line 105 of file account_object.hpp.

◆ vp_active

uint64_t graphene::chain::account_statistics_object::vp_active = 0

active voting power, if there is no attenuation, it is equal to vp_all.

Definition at line 98 of file account_object.hpp.

◆ vp_all

uint64_t graphene::chain::account_statistics_object::vp_all = 0

all voting power.

Voting Power Stats

Definition at line 97 of file account_object.hpp.

◆ vp_committee

uint64_t graphene::chain::account_statistics_object::vp_committee = 0

the final voting power for the committees.

Definition at line 99 of file account_object.hpp.

◆ vp_witness

uint64_t graphene::chain::account_statistics_object::vp_witness = 0

the final voting power for the witnesses.

Definition at line 100 of file account_object.hpp.

◆ vp_worker

uint64_t graphene::chain::account_statistics_object::vp_worker = 0

the final voting power for the workers.

Definition at line 101 of file account_object.hpp.


The documentation for this class was generated from the following files: