Deleted idump in subscribe_to_item; added deleting zero-balance object in adjust_balance
This commit is contained in:
parent
4a20369013
commit
f616e4c755
2 changed files with 7 additions and 4 deletions
|
|
@ -175,7 +175,6 @@ class database_api_impl : public std::enable_shared_from_this<database_api_impl>
|
|||
|
||||
if( !is_subscribed_to_item(i) )
|
||||
{
|
||||
idump((i));
|
||||
_subscribe_filter.insert( vec.data(), vec.size() );//(vecconst char*)&i, sizeof(i) );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,9 +71,13 @@ void database::adjust_balance(account_id_type account, asset delta )
|
|||
} else {
|
||||
if( delta.amount < 0 )
|
||||
FC_ASSERT( itr->get_balance() >= -delta, "Insufficient Balance: ${a}'s balance of ${b} is less than required ${r}", ("a",account(*this).name)("b",to_pretty_string(itr->get_balance()))("r",to_pretty_string(-delta)));
|
||||
modify(*itr, [delta](account_balance_object& b) {
|
||||
b.adjust_balance(delta);
|
||||
});
|
||||
if( delta.amount < 0 && itr->get_balance() == -delta ) {
|
||||
remove(*itr);
|
||||
} else {
|
||||
modify(*itr, [delta](account_balance_object& b) {
|
||||
b.adjust_balance(delta);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
} FC_CAPTURE_AND_RETHROW( (account)(delta) ) }
|
||||
|
|
|
|||
Loading…
Reference in a new issue