Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

delegate_vesting_shares_operation perceiving as try to change interest rate #1367

Closed
maslenitsa93 opened this issue Jul 27, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@maslenitsa93
Copy link

Code:

void delegate_vesting_shares(..., uint16_t interest_rate) {
    ...
    if (delegation) {
        GOLOS_CHECK_LOGIC(delegation->interest_rate == interest_rate,
            logic_exception::cannot_change_delegator_interest_rate,
            "Cannot change interest rate of already created delegation");
    }
    ...
}

void delegate_vesting_shares_evaluator::do_apply(const delegate_vesting_shares_operation& op) {
    const auto& median_props = _db.get_witness_schedule_object().median_props;

    delegate_vesting_shares(..., 0);
}

Following case possible:

  1. delegate_vesting_shares_with_interest sets interest_rate to 25.
  2. delegate_vesting_shares calling to increase/decrease this delegation, not for change interest_rate.
  3. But this check 25 == 0 thinks that it is changing.

In older version, only delegate_vesting_shares_with_interest has such check.

@maslenitsa93 maslenitsa93 self-assigned this Jul 27, 2019
@maslenitsa93 maslenitsa93 added this to the 0.22.0 milestone Jul 27, 2019
afalaleev added a commit that referenced this issue Jul 27, 2019
…-interest-rate-bug

Fix delegate_vesting_shares interest_rate checking #1367
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant