contracts/arisen.system/src/com.cpp
/**
    * @brief Adds a specified COM amount to savings bucket
    *
    * @param bitr - iterator pointing to com_balance object
    * @param com - amount of COM to be added
    */
@brief Adds a specified COM amount to savings bucket
@param bitr - iterator pointing to com_balance object
@param com - amount of COM to be added
@brief Adds a specified COM amount to savings bucket @param bitr - iterator pointing to com_balance object @param com - amount of COM to be added
void system_contract::put_com_savings( const com_balance_table::const_iterator& bitr, int64_t com )
   {
      if ( com == 0 ) return;
      static const time_point_sec end_of_days = time_point_sec::maximum();
      _combalance.modify( bitr, same_payer, [&]( auto& rb ) {
         if ( !rb.com_maturities.empty() && rb.com_maturities.back().first == end_of_days ) {
            rb.com_maturities.back().second += com;
         } else {
            rb.com_maturities.emplace_back( end_of_days, com );
         }
      });
   }
void system_contract :: put_com_savings ( const com_balance_table :: const_iterator & bitr , int64_t com ) { if ( com == 0 ) return ; static const time_point_sec end_of_days = time_point_sec :: maximum ( ) ; _combalance . modify ( bitr , same_payer , [ & ] ( auto & rb ) { if ( ! rb . com_maturities . empty ( ) && rb . com_maturities . back ( ) . first == end_of_days ) { rb . com_maturities . back ( ) . second += com ; } else { rb . com_maturities . emplace_back ( end_of_days , com ) ; } } ) ; }
@brief Adds a specified COM amount to savings bucket
 @param bitr - iterator pointing to com_balance object
 @param com - amount of COM to be added
@brief Adds a specified COM amount to savings bucket @param bitr - iterator pointing to com_balance object @param com - amount of COM to be added