Skip to content

Commit d3262a2

Browse files
Merge pull request #4974 from guoquanwu/feature/event-log-optimize
feat(event): skip log warning for certain scenario
2 parents 50ad05a + 057f3f0 commit d3262a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

framework/src/main/java/org/tron/core/db/Manager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,8 @@ private void processTransactionTrigger(BlockCapsule newBlock) {
20822082
List<TransactionCapsule> transactionCapsuleList = newBlock.getTransactions();
20832083

20842084
// need to set eth compatible data from transactionInfoList
2085-
if (EventPluginLoader.getInstance().isTransactionLogTriggerEthCompatible()) {
2085+
if (EventPluginLoader.getInstance().isTransactionLogTriggerEthCompatible()
2086+
&& newBlock.getNum() != 0) {
20862087
TransactionInfoList transactionInfoList = TransactionInfoList.newBuilder().build();
20872088
TransactionInfoList.Builder transactionInfoListBuilder = TransactionInfoList.newBuilder();
20882089

@@ -2119,7 +2120,8 @@ private void processTransactionTrigger(BlockCapsule newBlock) {
21192120
cumulativeLogCount += transactionInfo.getLogCount();
21202121
}
21212122
} else {
2122-
logger.error("PostBlockTrigger blockNum = {} has no transactions or {}.", newBlock.getNum(),
2123+
logger.error("PostBlockTrigger blockNum = {} has no transactions or {}.",
2124+
newBlock.getNum(),
21232125
"the sizes of transactionInfoList and transactionCapsuleList are not equal");
21242126
for (TransactionCapsule e : newBlock.getTransactions()) {
21252127
postTransactionTrigger(e, newBlock);

0 commit comments

Comments
 (0)