Skip to content

Commit

Permalink
update voter info in undelegate process
Browse files Browse the repository at this point in the history
  • Loading branch information
owenSai committed Jul 5, 2019
1 parent e509bb2 commit efec8a6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions contracts/actx.system/delegate_bandwidth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ namespace eosiosystem {
v.staked = total_update.amount;
});
} else {
if( total_update < asset(0)){
auto stake_available = from_voter->staked - from_voter->current_stake;
eosio_assert( stake_available + total_update.amount >= 0, "attempt to undelegate more stake, please check your vote info" );
}
_voters.modify( from_voter, 0, [&]( auto& v ) {
v.staked += total_update.amount;
});
Expand All @@ -373,12 +377,6 @@ namespace eosiosystem {
if( from == N(b1) ) {
validate_b1_vesting( from_voter->staked );
}
#if 0
/*no need to update votes*/
if( from_voter->producers.size()) {
update_votes( from, from_voter->producers, false );
}
#endif
}
}

Expand Down

0 comments on commit efec8a6

Please sign in to comment.