Rake calculation fix as outlined by Dan Notestein

This commit is contained in:
Peter Conrad 2018-04-05 15:58:55 +02:00 committed by Fabian Schuh
parent 03bc592114
commit 1ab596952e
No known key found for this signature in database
GPG key ID: F2538A4B282D6238

View file

@ -311,10 +311,8 @@ namespace graphene { namespace chain {
const account_id_type& winner = *event.match.match_winners.begin(); const account_id_type& winner = *event.match.match_winners.begin();
uint16_t rake_fee_percentage = event.db.get_global_properties().parameters.rake_fee_percentage; uint16_t rake_fee_percentage = event.db.get_global_properties().parameters.rake_fee_percentage;
// check whether the core asset pays dividends. If so, we transfer the rake fee const asset_object & asset_obj = asset_id_type(0)(event.db);
// to the core asset's dividend account optional<asset_dividend_data_id_type> dividend_id = asset_obj.dividend_data_id;
const asset_object& core_asset_obj = asset_id_type()(event.db);
optional<asset_dividend_data_id_type> dividend_id = core_asset_obj.dividend_data_id;
share_type rake_amount = 0; share_type rake_amount = 0;
if (dividend_id) if (dividend_id)