Skip to content

Commit e3ca49f

Browse files
committed
add exception statement
1 parent 342cacd commit e3ca49f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/org/tron/core/services/WitnessService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.tron.core.exception.ContractValidateException;
2020
import org.tron.core.exception.TronException;
2121
import org.tron.core.exception.UnLinkedBlockException;
22+
import org.tron.core.exception.ValidateBandwidthException;
2223
import org.tron.core.exception.ValidateScheduleException;
2324
import org.tron.core.exception.ValidateSignatureException;
2425
import org.tron.core.net.message.BlockMessage;
@@ -246,7 +247,7 @@ private void broadcastBlock(BlockCapsule block) {
246247
}
247248

248249
private BlockCapsule generateBlock(long when, ByteString witnessAddress)
249-
throws ValidateSignatureException, ContractValidateException, ContractExeException, UnLinkedBlockException, ValidateScheduleException {
250+
throws ValidateSignatureException, ContractValidateException, ContractExeException, UnLinkedBlockException, ValidateScheduleException, ValidateBandwidthException {
250251
return tronApp.getDbManager().generateBlock(this.localWitnessStateMap.get(witnessAddress), when,
251252
this.privateKeyMap.get(witnessAddress));
252253
}

src/main/java/org/tron/program/SolidityNode.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import org.tron.common.overlay.discover.NodeManager;
1111
import org.tron.common.overlay.discover.UDPListener;
1212
import org.tron.common.overlay.server.ChannelManager;
13-
import org.tron.common.overlay.server.PeerServer;
1413
import org.tron.core.Constant;
1514
import org.tron.core.capsule.BlockCapsule;
1615
import org.tron.core.config.DefaultConfig;
@@ -20,6 +19,7 @@
2019
import org.tron.core.exception.ContractExeException;
2120
import org.tron.core.exception.ContractValidateException;
2221
import org.tron.core.exception.UnLinkedBlockException;
22+
import org.tron.core.exception.ValidateBandwidthException;
2323
import org.tron.core.exception.ValidateScheduleException;
2424
import org.tron.core.exception.ValidateSignatureException;
2525
import org.tron.core.services.RpcApiService;
@@ -74,6 +74,8 @@ private void syncSolidityBlock() throws BadBlockException {
7474
dbManager.pushBlock(blockCapsule);
7575
dbManager.getDynamicPropertiesStore()
7676
.saveLatestSolidifiedBlockNum(lastSolidityBlockNum + 1);
77+
} catch (ValidateBandwidthException e) {
78+
throw new BadBlockException("validate Bandwidth exception");
7779
} catch (ValidateScheduleException e) {
7880
throw new BadBlockException("validate schedule exception");
7981
} catch (ValidateSignatureException e) {

0 commit comments

Comments
 (0)