6767import org .tron .common .utils .Utils ;
6868import org .tron .core .capsule .AccountCapsule ;
6969import org .tron .core .capsule .BlockCapsule ;
70+ import org .tron .core .config .args .Args ;
7071import org .tron .core .exception .ContractExeException ;
7172import org .tron .protos .Protocol ;
7273
@@ -469,7 +470,10 @@ public void createContract(DataWord value, DataWord memStart, DataWord memSize)
469470 newBalance = deposit .addBalance (newAddress , endowment );
470471 }
471472
472- checkCPULimit ("BEFORE CREATE" );
473+ if (!Args .getInstance ().isDebug ()) {
474+ checkCPULimit ("BEFORE CREATE" );
475+ }
476+
473477
474478 // [5] COOK THE INVOKE AND EXECUTE
475479 InternalTransaction internalTx = addInternalTx (getDroplimit (), senderAddress , null , endowment ,
@@ -495,7 +499,10 @@ this, new DataWord(newAddress), getOwnerAddress(), value,
495499 getResult ().merge (result );
496500 }
497501
498- checkCPULimit ("AFTER CREATE" );
502+ if (!Args .getInstance ().isDebug ()) {
503+ checkCPULimit ("AFTER CREATE" );
504+ }
505+
499506 // 4. CREATE THE CONTRACT OUT OF RETURN
500507 byte [] code = result .getHReturn ();
501508
@@ -614,7 +621,9 @@ public void callToAddress(MessageCall msg)
614621 InternalTransaction internalTx = addInternalTx (getDroplimit (), senderAddress , contextAddress ,
615622 endowment , data , "call" );
616623
617- //checkCPULimit("BEFORE CALL");
624+ if (!Args .getInstance ().isDebug ()) {
625+ checkCPULimit ("BEFORE CALL" );
626+ }
618627
619628 ProgramResult result = null ;
620629 if (isNotEmpty (programCode )) {
@@ -664,7 +673,10 @@ this, new DataWord(contextAddress),
664673 deposit .commit ();
665674 stackPushOne ();
666675 }
667- //checkCPULimit("AFTER CALL");
676+
677+ if (!Args .getInstance ().isDebug ()) {
678+ checkCPULimit ("BEFORE CALL" );
679+ }
668680
669681 // 3. APPLY RESULTS: result.getHReturn() into out_memory allocated
670682 if (result != null ) {
0 commit comments