File tree Expand file tree Collapse file tree
contract/AElf.Contracts.MultiToken Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,7 +151,6 @@ private void SetOrRefreshMethodFeeFreeAllowances(Address address)
151151 var config = State . MethodFeeFreeAllowancesConfig . Value ;
152152 if ( config == null || State . Balances [ address ] [ Context . Variables . NativeSymbol ] < config . Threshold )
153153 {
154- // Won't refresh method fee free allowance if inputted address hasn't reach the threshold.
155154 return ;
156155 }
157156
@@ -919,11 +918,14 @@ private MethodFeeFreeAllowances CalculateMethodFeeFreeAllowances(Address input)
919918
920919 var config = freeAllowancesConfig . Clone ( ) ;
921920
921+ var balance = State . Balances [ input ] [ Context . Variables . NativeSymbol ] ;
922+ if ( balance < config . Threshold ) return new MethodFeeFreeAllowances ( ) ;
923+
922924 var lastRefreshTime = State . MethodFeeFreeAllowancesLastRefreshTimeMap [ input ] ;
923925
924926 if ( freeAllowances == null )
925927 {
926- if ( State . Balances [ input ] [ Context . Variables . NativeSymbol ] >= config . Threshold )
928+ if ( balance >= config . Threshold )
927929 {
928930 return new MethodFeeFreeAllowances { Value = { config . FreeAllowances . Value } } ;
929931 }
You can’t perform that action at this time.
0 commit comments