diff --git a/src/main/java/org/tron/core/db/Manager.java b/src/main/java/org/tron/core/db/Manager.java index 6cadc56d9b0..3e801d39e47 100644 --- a/src/main/java/org/tron/core/db/Manager.java +++ b/src/main/java/org/tron/core/db/Manager.java @@ -333,14 +333,14 @@ public void init() { logger.error( "Please delete database directory({}) and restart", Args.getInstance().getOutputDirectory()); - System.exit(1); + System.exit(0); } catch (BadItemException e) { e.printStackTrace(); logger.error("DB data broken!"); logger.error( "Please delete database directory({}) and restart", Args.getInstance().getOutputDirectory()); - System.exit(1); + System.exit(0); } forkController.init(this); revokingStore.enable(); @@ -370,7 +370,7 @@ public void initGenesis() { logger.error( "genesis block modify, please delete database directory({}) and restart", Args.getInstance().getOutputDirectory()); - System.exit(1); + System.exit(0); } else { logger.info("create genesis block"); Args.getInstance().setChainId(this.genesisBlock.getBlockId().toString()); diff --git a/src/test/java/org/tron/core/net/node/BaseNetTest.java b/src/test/java/org/tron/core/net/node/BaseNetTest.java index 63fa44abb4d..d4ce1ecfb15 100644 --- a/src/test/java/org/tron/core/net/node/BaseNetTest.java +++ b/src/test/java/org/tron/core/net/node/BaseNetTest.java @@ -20,11 +20,10 @@ import java.util.concurrent.TimeUnit; import lombok.extern.slf4j.Slf4j; import org.junit.After; -import org.junit.AfterClass; import org.junit.Before; -import org.tron.common.application.TronApplicationContext; import org.tron.common.application.Application; import org.tron.common.application.ApplicationFactory; +import org.tron.common.application.TronApplicationContext; import org.tron.common.overlay.client.PeerClient; import org.tron.common.overlay.server.ChannelManager; import org.tron.common.overlay.server.SyncPool; @@ -40,8 +39,8 @@ @Slf4j public abstract class BaseNetTest { - protected static TronApplicationContext context; - protected static NodeImpl node; + protected TronApplicationContext context; + protected NodeImpl node; protected RpcApiService rpcApiService; protected PeerClient peerClient; protected ChannelManager channelManager; @@ -49,13 +48,13 @@ public abstract class BaseNetTest { protected Manager manager; private Application appT; - private static String dbPath; + private String dbPath; private String dbDirectory; private String indexDirectory; private int port; - private static ExecutorService executorService = Executors.newFixedThreadPool(1); + private ExecutorService executorService = Executors.newFixedThreadPool(1); public BaseNetTest(String dbPath, String dbDirectory, String indexDirectory, int port) { this.dbPath = dbPath; @@ -108,7 +107,7 @@ public void run() { NodeDelegate nodeDelegate = new NodeDelegateImpl(manager); node.setNodeDelegate(nodeDelegate); pool.init(node); - + appT.startup(); rpcApiService.blockUntilShutdown(); }