From a96fd62d0363af38ae6574eeaf1846b818669d8c Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Thu, 5 Nov 2015 14:56:59 -0500 Subject: [PATCH] fee_schedule.cpp: Use relaxation to set fee #435 --- libraries/chain/protocol/fee_schedule.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/libraries/chain/protocol/fee_schedule.cpp b/libraries/chain/protocol/fee_schedule.cpp index 6950aac0..6a8fc11f 100644 --- a/libraries/chain/protocol/fee_schedule.cpp +++ b/libraries/chain/protocol/fee_schedule.cpp @@ -31,6 +31,8 @@ namespace fc //template const graphene::chain::fee_schedule& smart_ref::operator*() const; } +#define MAX_FEE_STABILIZATION_ITERATION 4 + namespace graphene { namespace chain { typedef fc::smart_ref smart_fee_schedule; @@ -138,8 +140,23 @@ namespace graphene { namespace chain { 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; + auto f_max = f; + for( int i=0; i