Skip to content

Commit

Permalink
fix: fixes partial withdrawals
Browse files Browse the repository at this point in the history
  • Loading branch information
ex3ndr committed Apr 14, 2022
1 parent 14e0510 commit 3a9959c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiled/nominators.fc
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ int owned_balance() {

;; Check stake
throw_unless(error::invalid_stake_value(), stake >= 0);
throw_unless(error::invalid_stake_value(), ctx_member_balance + ctx_member_pending_deposit >= stake);
throw_unless(error::invalid_stake_value(), ctx_member_balance + ctx_member_withdraw + ctx_member_pending_deposit >= stake);

;; Try to withdraw immediatelly
var (withdrawed, all) = member_stake_withdraw(stake);
Expand Down
2 changes: 1 addition & 1 deletion sources/modules/op-common.fc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

;; Check stake
throw_unless(error::invalid_stake_value(), stake >= 0);
throw_unless(error::invalid_stake_value(), ctx_member_balance + ctx_member_pending_deposit >= stake);
throw_unless(error::invalid_stake_value(), ctx_member_balance + ctx_member_withdraw + ctx_member_pending_deposit >= stake);

;; Try to withdraw immediatelly
var (withdrawed, all) = member_stake_withdraw(stake);
Expand Down

0 comments on commit 3a9959c

Please sign in to comment.