asset fee_schedule::set_fee( operation& op, const price& core_exchange_rate )const { auto f = calculate_fee( op, core_exchange_rate ); auto f_max = f; for( int i=0; i<MAX_FEE_STABILIZATION_ITERATION; i++ ) { op.visit( set_fee_visitor( f_max ) ); auto f2 = calculate_fee( op, core_exchange_rate ); if( f == f2 ) break; f_max = std::max( f_max, f2 ); f = f2; if( i == 0 ) { // no need for warnings on later iterations wlog( "set_fee requires multiple iterations to stabilize with core_exchange_rate ${p} on operation ${op}", ("p", core_exchange_rate) ("op", op) ); } } return f_max; }
asset fee_schedule::set_fee( operation& op, const price& core_exchange_rate )const { auto f = calculate_fee( op, core_exchange_rate ); op.visit( set_fee_visitor( f ) ); return f; }