@@ -392,18 +392,17 @@ private void create()
392392 // }
393393
394394 long thisTxCPULimitInUs ;
395- long tolerance = max (0 , min (100 , Args .getInstance ().getTolerance ()));
396395 if (ET_NORMAL_TYPE == executorType ) {
397396 if (contract .getReceipt ().getResult () == ResourceReceipt .code .OUT_OF_TIME ) {
398- thisTxCPULimitInUs =
399- Constant .MAX_CPU_TIME_OF_ONE_TX * (100 - tolerance ) / 100 ;
397+ thisTxCPULimitInUs = max (0 , Args .getInstance ().getLowTolerance ());
400398 } else {
401- thisTxCPULimitInUs = Constant . MAX_CPU_TIME_OF_ONE_TX_WHEN_VERIFY_BLOCK ;
399+ thisTxCPULimitInUs = max ( 0 , Args . getInstance (). getHighTolerance ()) ;
402400 }
403401 } else {
404402 thisTxCPULimitInUs =
405- Constant .MAX_CPU_TIME_OF_ONE_TX * ( 100 + tolerance ) / 100 ;
403+ Constant .MAX_CPU_TIME_OF_ONE_TX ;
406404 }
405+
407406 long vmStartInUs = System .nanoTime () / 1000 ;
408407 long vmShouldEndInUs = vmStartInUs + thisTxCPULimitInUs ;
409408
@@ -471,17 +470,15 @@ private void call()
471470 .getOriginAddress ().toByteArray ());
472471
473472 long thisTxCPULimitInUs ;
474- long tolerance = max (0 , min (100 , Args .getInstance ().getTolerance ()));
475473 if (ET_NORMAL_TYPE == executorType ) {
476474 if (contract .getReceipt ().getResult () == ResourceReceipt .code .OUT_OF_TIME ) {
477- thisTxCPULimitInUs =
478- Constant .MAX_CPU_TIME_OF_ONE_TX * (100 - tolerance ) / 100 ;
475+ thisTxCPULimitInUs = max (0 , Args .getInstance ().getLowTolerance ());
479476 } else {
480- thisTxCPULimitInUs = Constant . MAX_CPU_TIME_OF_ONE_TX_WHEN_VERIFY_BLOCK ;
477+ thisTxCPULimitInUs = max ( 0 , Args . getInstance (). getHighTolerance ()) ;
481478 }
482479 } else {
483480 thisTxCPULimitInUs =
484- Constant .MAX_CPU_TIME_OF_ONE_TX * ( 100 + tolerance ) / 100 ;
481+ Constant .MAX_CPU_TIME_OF_ONE_TX ;
485482 }
486483
487484 long vmStartInUs = System .nanoTime () / 1000 ;
0 commit comments