13 namespace database_ns {
21 = ctx.
services().withdraw_scorumpower_route_service();
33 if (wvo.to_withdraw - wvo.withdrawn < wvo.vesting_withdraw_rate)
35 to_withdraw = std::min(scorumpower, wvo.to_withdraw % wvo.vesting_withdraw_rate);
39 to_withdraw = std::min(scorumpower, wvo.vesting_withdraw_rate);
42 if (to_withdraw.
amount <= 0)
44 withdraw_scorumpower_service.
remove(wvo);
58 deposited_scorumpower += to_deposit;
77 asset to_convert = to_withdraw - deposited_scorumpower;
78 FC_ASSERT(to_convert.
amount >= 0,
"Deposited more scorum power than were supposed to be withdrawn");
85 scorumpower -= to_withdraw;
92 if (wvo.withdrawn >= wvo.to_withdraw || scorumpower.
amount == 0)
95 withdraw_scorumpower_service.
remove(wvo);
data_service_factory_i & services() const
block_info & get_block_info() const
void update_statistic(const withdrawable_id_type &from, const withdrawable_id_type &to, const asset &amount)
asset get_available_scorumpower(const withdrawable_id_type &from)
void decrease_sp(const withdrawable_id_type &id, const asset &amount)
void increase_sp(const withdrawable_id_type &id, const asset &amount)
void increase_scr(const withdrawable_id_type &id, const asset &amount)
time_point_sec next_vesting_withdrawal
after every withdrawal this is incremented by 1 week
#define SCORUM_100_PERCENT
#define SCORUM_VESTING_WITHDRAW_INTERVAL_SECONDS
#define debug_log(CTX, FORMAT,...)
virtual void update(const modifier_type &modifier)=0
virtual void on_apply(block_task_context &)
virtual fc::time_point_sec head_block_time() const =0
virtual withdraw_scorumpower_route_refs_type get_all(const withdrawable_id_type &from) const =0
virtual withdraw_scorumpower_refs_type get_until(const time_point_sec &until) const =0