Skip to content

Commit 1168426

Browse files
Merge pull request #6201 from yanghang8612/fix/internal_tx_switch_covered
fix(cfg): internal tx switches are covered by setParam
2 parents f1a01e1 + 964daeb commit 1168426

File tree

1 file changed

+16
-9
lines changed
  • framework/src/main/java/org/tron/core/config/args

1 file changed

+16
-9
lines changed

framework/src/main/java/org/tron/core/config/args/Args.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -915,17 +915,24 @@ public static void setParam(final Config config) {
915915
PARAMETER.vmTrace =
916916
config.hasPath(Constant.VM_TRACE) && config.getBoolean(Constant.VM_TRACE);
917917

918-
PARAMETER.saveInternalTx =
919-
config.hasPath(Constant.VM_SAVE_INTERNAL_TX)
920-
&& config.getBoolean(Constant.VM_SAVE_INTERNAL_TX);
918+
if (config.hasPath(Constant.VM_SAVE_INTERNAL_TX)) {
919+
PARAMETER.saveInternalTx = config.getBoolean(Constant.VM_SAVE_INTERNAL_TX);
920+
}
921921

922-
PARAMETER.saveFeaturedInternalTx =
923-
config.hasPath(Constant.VM_SAVE_FEATURED_INTERNAL_TX)
924-
&& config.getBoolean(Constant.VM_SAVE_FEATURED_INTERNAL_TX);
922+
if (config.hasPath(Constant.VM_SAVE_FEATURED_INTERNAL_TX)) {
923+
PARAMETER.saveFeaturedInternalTx = config.getBoolean(Constant.VM_SAVE_FEATURED_INTERNAL_TX);
924+
}
925925

926-
PARAMETER.saveCancelAllUnfreezeV2Details =
927-
config.hasPath(Constant.VM_SAVE_CANCEL_ALL_UNFREEZE_V2_DETAILS)
928-
&& config.getBoolean(Constant.VM_SAVE_CANCEL_ALL_UNFREEZE_V2_DETAILS);
926+
if (config.hasPath(Constant.VM_SAVE_CANCEL_ALL_UNFREEZE_V2_DETAILS)) {
927+
PARAMETER.saveCancelAllUnfreezeV2Details =
928+
config.getBoolean(Constant.VM_SAVE_CANCEL_ALL_UNFREEZE_V2_DETAILS);
929+
}
930+
931+
if (PARAMETER.saveCancelAllUnfreezeV2Details
932+
&& (!PARAMETER.saveInternalTx || !PARAMETER.saveFeaturedInternalTx)) {
933+
logger.warn("Configuring [vm.saveCancelAllUnfreezeV2Details] won't work as "
934+
+ "vm.saveInternalTx or vm.saveFeaturedInternalTx is off.");
935+
}
929936

930937
// PARAMETER.allowShieldedTransaction =
931938
// config.hasPath(Constant.COMMITTEE_ALLOW_SHIELDED_TRANSACTION) ? config

0 commit comments

Comments
 (0)