contracts/arisen.system/src/com.cpp
/**
    * @brief Processes owner filled sellcom order and updates vote weight
    *
    * Checks if user has a scheduled sellcom order that has been filled, completes its processing,
    * and deletes it. Processing entails transfering proceeds to user COM fund and updating user
    * vote weight. Additional proceeds and stake change can be passed as arguments. This function
    * is called only by actions pushed by owner.
    *
    * @param owner - owner account name
    * @param proceeds - additional proceeds to be transfered to owner COM fund
    * @param delta_stake - additional stake to be added to owner vote weight
    * @param force_vote_update - if true, vote weight is updated even if vote stake didn't change
    *
    * @return asset - COM amount of owner unfilled sell order if one exists
    */
@brief Processes owner filled sellcom order and updates vote weight
Checks if user has a scheduled sellcom order that has been filled, completes its processing,
and deletes it. Processing entails transfering proceeds to user COM fund and updating user
vote weight. Additional proceeds and stake change can be passed as arguments. This function
is called only by actions pushed by owner.

@param owner - owner account name
@param proceeds - additional proceeds to be transfered to owner COM fund
@param delta_stake - additional stake to be added to owner vote weight
@param force_vote_update - if true, vote weight is updated even if vote stake didn't change

@return asset - COM amount of owner unfilled sell order if one exists
@brief Processes owner filled sellcom order and updates vote weight Checks if user has a scheduled sellcom order that has been filled completes its processing and deletes it . Processing entails transfering proceeds to user COM fund and updating user vote weight . Additional proceeds and stake change can be passed as arguments . This function is called only by actions pushed by owner . @param owner - owner account name @param proceeds - additional proceeds to be transfered to owner COM fund @param delta_stake - additional stake to be added to owner vote weight @param force_vote_update - if true vote weight is updated even if vote stake didn ' t change @return asset - COM amount of owner unfilled sell order if one exists
asset system_contract::update_com_account( const name& owner, const asset& proceeds, const asset& delta_stake, bool force_vote_update )
   {
      asset to_fund( proceeds );
      asset to_stake( delta_stake );
      asset com_in_sell_order( 0, com_symbol );
      auto itr = _comorders.find( owner.value );
      if ( itr != _comorders.end() ) {
         if ( itr->is_open ) {
            com_in_sell_order.amount = itr->com_requested.amount;
         } else {
            to_fund.amount  += itr->proceeds.amount;
            to_stake.amount += itr->stake_change.amount;
            _comorders.erase( itr );
         }
      }
      if ( to_fund.amount > 0 )
         transfer_to_fund( owner, to_fund );
      if ( force_vote_update || to_stake.amount != 0 )
         update_voting_power( owner, to_stake );
      return com_in_sell_order;
   }
asset system_contract :: update_com_account ( const name & owner , const asset & proceeds , const asset & delta_stake , bool force_vote_update ) { asset to_fund ( proceeds ) ; asset to_stake ( delta_stake ) ; asset com_in_sell_order ( 0 , com_symbol ) ; auto itr = _comorders . find ( owner . value ) ; if ( itr != _comorders . end ( ) ) { if ( itr -> is_open ) { com_in_sell_order . amount = itr -> com_requested . amount ; } else { to_fund . amount += itr -> proceeds . amount ; to_stake . amount += itr -> stake_change . amount ; _comorders . erase ( itr ) ; } } if ( to_fund . amount > 0 ) transfer_to_fund ( owner , to_fund ) ; if ( force_vote_update || to_stake . amount != 0 ) update_voting_power ( owner , to_stake ) ; return com_in_sell_order ; }
@brief Processes owner filled sellcom order and updates vote weight
 Checks if user has a scheduled sellcom order that has been filled, completes its processing,
 and deletes it.
@brief Processes owner filled sellcom order and updates vote weight Checks if user has a scheduled sellcom order that has been filled completes its processing and deletes it .