Skip to content

Commit f5f22fd

Browse files
author
ABW
committed
add comments to remaining nested modify() calls that are safe, because they use independent indexes
1 parent e395ce7 commit f5f22fd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libraries/chain/database.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3234,6 +3234,7 @@ void database::adjust_balance( const account_object& a, temp_HBD_balance& hbd_ba
32343234
{
32353235
HBD_asset interest_to_pay( fc::uint128_to_uint64( interest ) );
32363236
temp_HBD_balance interest_balance;
3237+
// nested modify is safe here, because two separate multiindexes are modified
32373238
modify( dgpo, [&]( dynamic_global_property_object& props )
32383239
{
32393240
interest_balance = props.issue_HBD( interest_to_pay, get_hbd_price() );
@@ -3308,6 +3309,7 @@ void database::adjust_savings_balance( const account_object& a, temp_HBD_balance
33083309
{
33093310
HBD_asset interest_to_pay( fc::uint128_to_uint64( interest ) );
33103311
temp_HBD_balance interest_balance;
3312+
// nested modify is safe here, because two separate multiindexes are modified
33113313
modify( dgpo, [&]( dynamic_global_property_object& props )
33123314
{
33133315
interest_balance = props.issue_HBD( interest_to_pay, get_hbd_price() );

0 commit comments

Comments
 (0)