Skip to content

Commit 6323ea8

Browse files
committed
add missing EventBloomException for switchFork; throw exception before addAll matchedLog instead after
1 parent 5ab9eb1 commit 6323ea8

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,8 @@ private void switchFork(BlockCapsule newHead)
11551155
| ValidateScheduleException
11561156
| VMIllegalException
11571157
| ZksnarkException
1158-
| BadBlockException e) {
1158+
| BadBlockException
1159+
| EventBloomException e) {
11591160
logger.warn(e.getMessage(), e);
11601161
exception = e;
11611162
throw e;

framework/src/main/java/org/tron/core/services/jsonrpc/filters/LogMatch.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ public LogFilterElement[] matchBlockOneByOne()
9393
String blockHash = manager.getChainBaseManager().getBlockIdByNum(blockNum).toString();
9494
List<LogFilterElement> matchedLog = matchBlock(logFilterWrapper.getLogFilter(), blockNum,
9595
blockHash, transactionInfoList, false);
96+
9697
if (!matchedLog.isEmpty()) {
98+
if (logFilterElementList.size() + matchedLog.size() > LogBlockQuery.MAX_RESULT) {
99+
throw new JsonRpcTooManyResultException(
100+
"query returned more than " + LogBlockQuery.MAX_RESULT + " results");
101+
}
97102
logFilterElementList.addAll(matchedLog);
98103
}
99-
100-
if (logFilterElementList.size() > LogBlockQuery.MAX_RESULT) {
101-
throw new JsonRpcTooManyResultException(
102-
"query returned more than " + LogBlockQuery.MAX_RESULT + " results");
103-
}
104104
}
105105

106106
return logFilterElementList.toArray(new LogFilterElement[0]);

0 commit comments

Comments
 (0)