Skip to content

Commit

Permalink
feat(event): skip log warning when solidity block number is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
tomatoishealthy committed Feb 13, 2023
1 parent 8493819 commit 057f3f0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions framework/src/main/java/org/tron/core/db/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2082,7 +2082,8 @@ private void processTransactionTrigger(BlockCapsule newBlock) {
List<TransactionCapsule> transactionCapsuleList = newBlock.getTransactions();

// need to set eth compatible data from transactionInfoList
if (EventPluginLoader.getInstance().isTransactionLogTriggerEthCompatible()) {
if (EventPluginLoader.getInstance().isTransactionLogTriggerEthCompatible()
&& newBlock.getNum() != 0) {
TransactionInfoList transactionInfoList = TransactionInfoList.newBuilder().build();
TransactionInfoList.Builder transactionInfoListBuilder = TransactionInfoList.newBuilder();

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

0 comments on commit 057f3f0

Please sign in to comment.