Merge branch 'DAO' into RefactorUTXOHandling

This commit is contained in:
Manfred Karrer 2017-04-10 13:46:06 -05:00
commit c9917998d8
3 changed files with 14 additions and 6 deletions

View file

@ -65,6 +65,7 @@ public class BsqBlockchainManager {
// new snapshot is block 90. We only persist at the new snapshot, so we always re-parse from latest snapshot after
// a restart.
private static final int SNAPSHOT_TRIGGER = 300000;
private final boolean connectToBtcCore;
public static int getSnapshotTrigger() {
return SNAPSHOT_TRIGGER;
@ -98,6 +99,7 @@ public class BsqBlockchainManager {
BisqEnvironment bisqEnvironment,
@Named(Storage.DIR_KEY) File storageDir,
Storage<PlainTextWrapper> jsonStorage,
@Named(RpcOptionKeys.RPC_USER) String rpcUser,
@Named(RpcOptionKeys.DUMP_BLOCKCHAIN_DATA) boolean dumpBlockchainData) {
this.blockchainService = blockchainService;
this.storageDir = storageDir;
@ -105,6 +107,7 @@ public class BsqBlockchainManager {
this.dumpBlockchainData = dumpBlockchainData;
this.bitcoinNetwork = bisqEnvironment.getBitcoinNetwork();
connectToBtcCore = rpcUser != null && !rpcUser.isEmpty();
bsqUTXOMap = new BsqUTXOMap(storageDir);
bsqTXOMap = new BsqTXOMap(storageDir);
@ -214,7 +217,8 @@ public class BsqBlockchainManager {
///////////////////////////////////////////////////////////////////////////////////////////
public void onAllServicesInitialized(ErrorMessageHandler errorMessageHandler) {
blockchainService.setup(this::blockchainServiceSetupCompleted, errorMessageHandler);
if (connectToBtcCore)
blockchainService.setup(this::blockchainServiceSetupCompleted, errorMessageHandler);
}
public Set<String> getUtxoTxIdSet() {

View file

@ -119,7 +119,7 @@ public class BsqBlockchainRpcService extends BsqBlockchainService {
} catch (Throwable e) {
log.error(e.toString());
e.printStackTrace();
throw new BsqBlockchainException(e.getMessage(), e);
throw new BsqBlockchainException(e.toString(), e);
}
});
@ -134,7 +134,7 @@ public class BsqBlockchainRpcService extends BsqBlockchainService {
public void onFailure(@NotNull Throwable throwable) {
UserThread.execute(() -> {
log.error(throwable.toString());
errorMessageHandler.handleErrorMessage(throwable.getMessage());
errorMessageHandler.handleErrorMessage(throwable.toString());
});
}
});

View file

@ -704,7 +704,8 @@ public abstract class Overlay<T extends Overlay> {
gridPane.getChildren().add(gitHubButton);
gitHubButton.setOnAction(event -> {
Utilities.copyToClipboard(message);
if (message != null)
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("https://github.com/bisq/bisq/issues");
});
@ -715,7 +716,8 @@ public abstract class Overlay<T extends Overlay> {
gridPane.getChildren().add(forumButton);
forumButton.setOnAction(event -> {
Utilities.copyToClipboard(message);
if (message != null)
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("http://forum.bisq.io");
});
}
@ -789,8 +791,10 @@ public abstract class Overlay<T extends Overlay> {
protected void setTruncatedMessage() {
if (message != null && message.length() > 1800)
truncatedMessage = StringUtils.abbreviate(message, 1800);
else
else if (message != null)
truncatedMessage = message;
else
truncatedMessage = "";
}
protected double getDuration(double duration) {