Skip to content

Commit

Permalink
Merge pull request #64 from catbref/master
Browse files Browse the repository at this point in the history
Qora blockchain synchronization improvements
  • Loading branch information
catbref committed Nov 6, 2017
2 parents a3ef127 + 34d2aaf commit 3d83c4e
Show file tree
Hide file tree
Showing 25 changed files with 593 additions and 378 deletions.
142 changes: 69 additions & 73 deletions Qora/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,113 +2,109 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="srcunittest"/>
<classpathentry kind="lib" path="libs/json-simple-1.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/json-simple-1.1.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Qora/libs/native"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="libs/commons-net-3.3.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/jaxb-api-2.2.7.jar"/>
<classpathentry kind="lib" path="libs/jsoup-1.8.2.jar">
<classpathentry exported="true" kind="lib" path="libs/commons-net-3.3.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/jaxb-api-2.2.7.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jsoup-1.8.2.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/jsoup-1.8.2-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/commons-io-2.4.jar" sourcepath="libs/sourceandjavadoc/commons-io-2.4-sources.jar">
<classpathentry exported="true" kind="lib" path="libs/commons-io-2.4.jar" sourcepath="libs/sourceandjavadoc/commons-io-2.4-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/commons-io-2.4-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/commons-lang3-3.4.jar" sourcepath="libs/sourceandjavadoc/commons-lang3-3.4-sources.jar">
<classpathentry exported="true" kind="lib" path="libs/commons-lang3-3.4.jar" sourcepath="libs/sourceandjavadoc/commons-lang3-3.4-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/commons-lang3-3.4-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/coverity-escapers-1.1.1.jar"/>
<classpathentry kind="lib" path="libs/slf4j-api-1.7.12.jar"/>
<classpathentry kind="lib" path="libs/slf4j-nop-1.7.12.jar"/>
<classpathentry kind="lib" path="libs/jetty/servlet-api-3.1.jar"/>
<classpathentry kind="lib" path="libs/diffutils-1.3.0.jar" sourcepath="libs/sourceandjavadoc/diffutils-1.3.0-sources.jar">
<classpathentry exported="true" kind="lib" path="libs/coverity-escapers-1.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/slf4j-api-1.7.12.jar"/>
<classpathentry exported="true" kind="lib" path="libs/slf4j-nop-1.7.12.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/servlet-api-3.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/diffutils-1.3.0.jar" sourcepath="libs/sourceandjavadoc/diffutils-1.3.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/diffutils-1.3.0-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/pebble-1.6.0.jar" sourcepath="libs/sourceandjavadoc/pebble-1.6.0-sources.jar">
<classpathentry exported="true" kind="lib" path="libs/pebble-1.6.0.jar" sourcepath="libs/sourceandjavadoc/pebble-1.6.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/pebble-1.6.0-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/bcprov-jdk15on-154.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-schemas-3.1.jar"/>
<classpathentry kind="lib" path="libs/guava-19.0.jar" sourcepath="libs/sourceandjavadoc/guava-19.0-sources.jar">
<classpathentry exported="true" kind="lib" path="libs/bcprov-jdk15on-154.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-schemas-3.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/guava-19.0.jar" sourcepath="libs/sourceandjavadoc/guava-19.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/guava-19.0-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/jersey/api/javax.ws.rs-api-2.0.1.jar"/>
<classpathentry kind="lib" path="libs/jersey/lib/jersey-server.jar"/>
<classpathentry kind="lib" path="libs/jersey/lib/jersey-client.jar"/>
<classpathentry kind="lib" path="libs/jersey/lib/jersey-common.jar"/>
<classpathentry kind="lib" path="libs/jersey/lib/jersey-container-servlet-core.jar"/>
<classpathentry kind="lib" path="libs/jersey/lib/jersey-container-servlet.jar"/>
<classpathentry kind="lib" path="libs/jersey/lib/jersey-media-jaxb.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/aopalliance-repackaged-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/asm-debug-all-5.0.4.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/hk2-api-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/hk2-locator-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/hk2-utils-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/javassist-3.18.1-GA.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/javax.annotation-api-1.2.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/javax.inject-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/javax.servlet-api-3.0.1.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/jersey-guava-2.22.2.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/org.osgi.core-4.2.0.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/osgi-resource-locator-1.0.1.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/persistence-api-1.0.jar"/>
<classpathentry kind="lib" path="libs/jersey/ext/validation-api-1.1.0.Final.jar"/>
<classpathentry kind="lib" path="libs/jersey/lib/jersey-media-multipart-2.22.2.jar"/>
<classpathentry kind="lib" path="libs/mimepull-1.9.6.jar"/>
<classpathentry kind="lib" path="libs/jetty/cdi-core-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/cdi-servlet-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/cdi-websocket-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-alpn-server-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-annotations-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-client-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-continuation-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-deploy-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-gcloud-session-manager-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-http-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-infinispan-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-io-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-jaas-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-jaspi-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-jmx-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-jndi-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-nosql-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-plus-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-proxy-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-quickstart-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-rewrite-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-security-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-server-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-servlet-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-servlets-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-util-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-webapp-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/jetty/jetty-xml-9.3.7.v20160115.jar"/>
<classpathentry kind="lib" path="libs/log4j-1.2.17.jar" sourcepath="libs/sourceandjavadoc/log4j-1.2.17-sources.jar">
<classpathentry exported="true" kind="lib" path="libs/jersey/api/javax.ws.rs-api-2.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/lib/jersey-server.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/lib/jersey-client.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/lib/jersey-common.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/lib/jersey-container-servlet-core.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/lib/jersey-container-servlet.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/lib/jersey-media-jaxb.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/aopalliance-repackaged-2.4.0-b34.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/asm-debug-all-5.0.4.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/hk2-api-2.4.0-b34.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/hk2-locator-2.4.0-b34.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/hk2-utils-2.4.0-b34.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/javassist-3.18.1-GA.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/javax.annotation-api-1.2.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/javax.inject-2.4.0-b34.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/javax.servlet-api-3.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/jersey-guava-2.22.2.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/org.osgi.core-4.2.0.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/osgi-resource-locator-1.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/persistence-api-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/ext/validation-api-1.1.0.Final.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jersey/lib/jersey-media-multipart-2.22.2.jar"/>
<classpathentry exported="true" kind="lib" path="libs/mimepull-1.9.6.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/cdi-core-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/cdi-servlet-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/cdi-websocket-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-alpn-server-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-annotations-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-client-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-continuation-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-deploy-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-gcloud-session-manager-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-http-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-infinispan-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-io-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-jaas-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-jaspi-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-jmx-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-jndi-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-nosql-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-plus-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-proxy-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-quickstart-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-rewrite-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-security-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-server-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-servlet-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-servlets-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-util-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-webapp-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jetty/jetty-xml-9.3.7.v20160115.jar"/>
<classpathentry exported="true" kind="lib" path="libs/log4j-1.2.17.jar" sourcepath="libs/sourceandjavadoc/log4j-1.2.17-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/log4j-1.2.17-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/mapdb-1.0.7.jar" sourcepath="libs/sourceandjavadoc/mapdb-1.0.7-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/mapdb-1.0.7-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/json-io-4.8.0.jar" sourcepath="libs/sourceandjavadoc/json-io-4.8.0-sources.jar">
<classpathentry exported="true" kind="lib" path="libs/mapdb-1.0.9.jar"/>
<classpathentry exported="true" kind="lib" path="libs/json-io-4.8.0.jar" sourcepath="libs/sourceandjavadoc/json-io-4.8.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/Qora/libs/sourceandjavadoc/json-io-4.8.0-javadoc.jar!/"/>
</attributes>
Expand Down
Binary file removed Qora/libs/mapdb-1.0.7.jar
Binary file not shown.
Binary file removed Qora/libs/mapdb-1.0.8.jar
Binary file not shown.
Binary file removed Qora/libs/sourceandjavadoc/mapdb-1.0.7-javadoc.jar
Binary file not shown.
Binary file removed Qora/libs/sourceandjavadoc/mapdb-1.0.7-sources.jar
Binary file not shown.
6 changes: 5 additions & 1 deletion Qora/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ log4j.logger.network.ConnectionCreator=info
log4j.logger.network.Network=info
log4j.logger.network.Peer=info
log4j.logger.settings.Settings=info
log4j.logger.qora.block.Block=info
log4j.logger.qora.transaction.Transaction=info
log4j.logger.qora.BlockChain=info
log4j.logger.qora.Synchronizer=info
log4j.logger.at.AT_Controller=info
log4j.logger.ntp.NTP=info
log4j.logger.wallet.Wallet=info
log4j.logger.Start=info
Expand Down Expand Up @@ -44,4 +48,4 @@ log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
13 changes: 11 additions & 2 deletions Qora/src/api/PeersResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@ public String addPeer(String address) {
throw ApiErrorFactory.getInstance().createError(
ApiErrorFactory.ERROR_INVALID_NETWORK_ADDRESS);
}
peer.addPingCounter();
/*
* XXX what is the purpose of this call?
* PeerMap.addPeer() tests for peer.pingCounter > 1 but after this call
* peer.pingCounter will only be 1 so there's no difference code-path-wise
* between pingCounter being 0 or 1.
* Also creating a new Peer starts a Pinger thread which will increment pingCounter
* and call PeerMap.addPeer()
*/
// was: peer.addPingCounter();
// now: peer.onPingSuccess(); which also performs next line:
DBSet.getInstance().getPeerMap().addPeer(peer);

return "OK";
Expand Down Expand Up @@ -173,7 +182,7 @@ else if(DBSet.getInstance().getPeerMap().contains(peer.getAddress().getAddress()
o.put("version", Controller.getInstance().getVersionOfPeer(peer).getA());
o.put("buildTime", DateTimeFormat.timestamptoString(Controller.getInstance().getVersionOfPeer(peer).getB(), "yyyy-MM-dd HH:mm:ss z", "UTC"));
}
if(peer.isPinger()) {
if(peer.hasPinger()) {
o.put("ping", peer.getPing());
}
if(peer.getConnectionTime()>0) {
Expand Down
3 changes: 2 additions & 1 deletion Qora/src/at/AT_Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import qora.account.Account;
import qora.crypto.Base58;
import qora.crypto.Crypto;
import utils.Converter;

import com.google.common.primitives.Bytes;
import com.google.common.primitives.Longs;
Expand Down Expand Up @@ -426,7 +427,7 @@ public static AT_Block validateATs( byte[] blockATs , int blockHeight , DBSet db
md5 = digest.digest( at.getBytes() );
if ( !Arrays.equals( md5 , ats.get( atIdBuffer ) ) )
{
throw new AT_Exception( "Calculated md5 and recieved md5 are not matching" );
throw new AT_Exception( "Calculated MD5 " + Converter.toHex(md5) + " and received MD5 " + Converter.toHex(ats.get(atIdBuffer)) + " do not match" );
}
tempAtStates.put( new String(at.getId() , "UTF-8") , state );
}
Expand Down
26 changes: 18 additions & 8 deletions Qora/src/controller/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ public class Controller extends Observable {


private static final Logger LOGGER = Logger.getLogger(Controller.class);
private String version = "0.26.0";
private String buildTime = "2016-05-24 00:00:00 UTC";
private String version = "0.26.2.1";
private String buildTime = "2017-11-06 11:33:00 UTC";
private long buildTimestamp;

public static final String releaseVersion = "0.26.0";
public static final String releaseVersion = "0.26.2.1";

// TODO ENUM would be better here
public static final int STATUS_NO_CONNECTIONS = 0;
Expand Down Expand Up @@ -403,6 +403,10 @@ public void start() throws Exception {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
Thread.currentThread().setName("Controller Shutdown");

LOGGER.info("Controller shutdown hook");

stopAll();
}
});
Expand Down Expand Up @@ -604,6 +608,9 @@ public void stopAll() {
if (!this.isStopping) {
this.isStopping = true;

// STOP SENDING OUR HEIGHT TO PEERS
this.timerPeerHeightUpdate.cancel();

// STOP MESSAGE PROCESSOR
LOGGER.info(Lang.getInstance().translate("Stopping message processor"));
this.network.stop();
Expand All @@ -612,7 +619,11 @@ public void stopAll() {
LOGGER.info(Lang.getInstance().translate("Stopping block processor"));
this.synchronizer.stop();

// CLOSE DATABABASE
// STOP BLOCK GENERATOR
LOGGER.info(Lang.getInstance().translate("Stopping block generator"));
this.blockGenerator.shutdown();

// CLOSE DATABASE
LOGGER.info(Lang.getInstance().translate("Closing database"));
DBSet.getInstance().close();

Expand All @@ -623,8 +634,6 @@ public void stopAll() {
createDataCheckpoint();

LOGGER.info(Lang.getInstance().translate("Closed."));
// FORCE CLOSE
System.exit(0);
}
}

Expand Down Expand Up @@ -1015,8 +1024,9 @@ public void update() {

Peer peer = null;
try {
// WHILE NOT UPTODATE
while (!this.isUpToDate()) {
// Synchronize while we're not up-to-date
// (but bail out if we're shutdown while updating blockchain)
while (!this.isStopping && !this.isUpToDate()) {
// START UPDATE FROM HIGHEST HEIGHT PEER
peer = this.getMaxHeightPeer();

Expand Down
Loading

0 comments on commit 3d83c4e

Please sign in to comment.