Skip to content

Commit

Permalink
steemit#1629: Improve assertion message in adjust_balance to reveal c…
Browse files Browse the repository at this point in the history
…urrent balance and attempted adjustment
  • Loading branch information
sgerbino committed Jul 23, 2019
1 parent 0368a5f commit 56e9902
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4528,8 +4528,10 @@ void database::adjust_balance( const account_object& a, const asset& delta )
{
if ( delta.amount < 0 )
{
FC_ASSERT( get_balance( a, delta.symbol ) >= -delta,
"Account ${acc} does not have sufficient funds for balance adjustment of ${ba}", ("acc", a.name)("ba", delta) );
asset available = get_balance( a, delta.symbol );
FC_ASSERT( available >= -delta,
"Account ${acc} does not have sufficient funds for balance adjustment. Required: ${r}, Available: ${a}",
("acc", a.name)("r", delta)("a", available) );
}

bool check_balance = has_hardfork( STEEM_HARDFORK_0_20__1811 );
Expand Down

0 comments on commit 56e9902

Please sign in to comment.