mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Update to tomp2p beta7, UpdateFX 1.6, add Dev mode,...
This commit is contained in:
parent
b5e29d0cf7
commit
27381b0e98
30 changed files with 238 additions and 180 deletions
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>io.bitsquare</groupId>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<version>0.2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ public class BootstrapNode {
|
|||
@Override
|
||||
public void peerUpdated(PeerAddress peerAddress, PeerStatistic peerStatistics) {
|
||||
try {
|
||||
log.info("Peer updated: peerAddress=" + peerAddress + ", peerStatistics=" + peerStatistics);
|
||||
//log.info("Peer updated: peerAddress=" + peerAddress + ", peerStatistics=" + peerStatistics);
|
||||
} catch (Throwable t) {
|
||||
log.error("Exception at peerUpdated " + t.getMessage());
|
||||
}
|
||||
|
|
73
core/pom.xml
73
core/pom.xml
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>io.bitsquare</groupId>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<version>0.2.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>core</artifactId>
|
||||
|
@ -47,7 +47,7 @@
|
|||
<dependency>
|
||||
<groupId>net.tomp2p</groupId>
|
||||
<artifactId>tomp2p-all</artifactId>
|
||||
<version>5.0-Beta6</version>
|
||||
<version>5.0-Beta7</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -56,21 +56,20 @@
|
|||
<version>1.52</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice</artifactId>
|
||||
<version>3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>16.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.1.2</version>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.2.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -88,43 +87,33 @@
|
|||
<artifactId>jopt-simple</artifactId>
|
||||
<version>4.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice</artifactId>
|
||||
<version>3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.2.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.glxn</groupId>
|
||||
<artifactId>qrgen</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.jcip</groupId>
|
||||
<artifactId>jcip-annotations</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>2.0.1</version>
|
||||
</dependency>-->
|
||||
<!-- <dependency>
|
||||
<groupId>net.jcip</groupId>
|
||||
<artifactId>jcip-annotations</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>13.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.fxmisc.easybind</groupId>
|
||||
<artifactId>easybind</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.fxmisc.easybind</groupId>
|
||||
<artifactId>easybind</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.codahale.metrics</groupId>
|
||||
|
@ -132,5 +121,17 @@
|
|||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -56,8 +56,8 @@ public class FeePolicy {
|
|||
takeOfferFeeAddress = "1BVxNn3T12veSK6DgqwU4Hdn7QHcDDRag7";
|
||||
break;
|
||||
case REGTEST:
|
||||
createOfferFeeAddress = "mxmKZruv9x9JLcEj6rZx6Hnm4LLAcQHtcr";
|
||||
takeOfferFeeAddress = "mxmKZruv9x9JLcEj6rZx6Hnm4LLAcQHtcr";
|
||||
createOfferFeeAddress = "mkNW1omJFA7RD3AZ94mfKqubRff2gx21KE";
|
||||
takeOfferFeeAddress = "mkNW1omJFA7RD3AZ94mfKqubRff2gx21KE";
|
||||
break;
|
||||
default:
|
||||
throw new BitsquareException("Unknown bitcoin network: %s", bitcoinNetwork);
|
||||
|
|
|
@ -148,26 +148,38 @@ public class CryptoService<T> {
|
|||
Cipher cipherAsym = Cipher.getInstance(ASYM_CIPHER);
|
||||
cipherAsym.init(Cipher.DECRYPT_MODE, keyRing.getMsgEncryptionKeyPair().getPrivate());
|
||||
Object secretKeyObject = sealedSecretKey.getObject(cipherAsym);
|
||||
assert secretKeyObject instanceof SecretKey;
|
||||
SecretKey secretKey = (SecretKey) secretKeyObject;
|
||||
if (secretKeyObject instanceof SecretKey) {
|
||||
SecretKey secretKey = (SecretKey) secretKeyObject;
|
||||
|
||||
// Decrypt signedMessage with secretKey
|
||||
Cipher cipherSym = Cipher.getInstance(SYM_CIPHER);
|
||||
cipherSym.init(Cipher.DECRYPT_MODE, secretKey);
|
||||
Object signedMessageObject = sealedMessage.getObject(cipherSym);
|
||||
assert signedMessageObject instanceof SignedObject;
|
||||
SignedObject signedMessage = (SignedObject) signedMessageObject;
|
||||
// Decrypt signedMessage with secretKey
|
||||
Cipher cipherSym = Cipher.getInstance(SYM_CIPHER);
|
||||
cipherSym.init(Cipher.DECRYPT_MODE, secretKey);
|
||||
Object signedMessageObject = sealedMessage.getObject(cipherSym);
|
||||
if (signedMessageObject instanceof SignedObject) {
|
||||
SignedObject signedMessage = (SignedObject) signedMessageObject;
|
||||
|
||||
// Verify message with peers pubKey
|
||||
if (signedMessage.verify(signaturePubKey, Signature.getInstance(MSG_SIGN_ALGO))) {
|
||||
// Get message
|
||||
Object messageObject = signedMessage.getObject();
|
||||
assert messageObject instanceof Message;
|
||||
log.debug("Decryption needed {} ms", System.currentTimeMillis() - ts);
|
||||
return new MessageWithPubKey((Message) messageObject, signaturePubKey);
|
||||
// Verify message with peers pubKey
|
||||
if (signedMessage.verify(signaturePubKey, Signature.getInstance(MSG_SIGN_ALGO))) {
|
||||
// Get message
|
||||
Object messageObject = signedMessage.getObject();
|
||||
if (messageObject instanceof Message) {
|
||||
log.debug("Decryption needed {} ms", System.currentTimeMillis() - ts);
|
||||
return new MessageWithPubKey((Message) messageObject, signaturePubKey);
|
||||
}
|
||||
else {
|
||||
throw new CryptoException("messageObject is not instance of Message");
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new CryptoException("Signature is not valid");
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new CryptoException("signedMessageObject is not instance of SignedObject");
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new CryptoException("Signature is not valid");
|
||||
throw new CryptoException("secretKeyObject is not instance of SecretKey");
|
||||
}
|
||||
} catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | BadPaddingException |
|
||||
ClassNotFoundException | IllegalBlockSizeException | IOException | SignatureException e) {
|
||||
|
@ -175,7 +187,6 @@ public class CryptoService<T> {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public String signMessage(ECKey key, Sha256Hash hash) {
|
||||
ECKey.ECDSASignature sig = key.sign(hash, null);
|
||||
// Now we have to work backwards to figure out the recId needed to recover the signature.
|
||||
|
|
|
@ -171,8 +171,8 @@ public class BootstrappedPeerBuilder {
|
|||
try {
|
||||
// port is evaluated from btc network. 7366 for mainnet, 7367 for testnet and 7368 for regtest
|
||||
bootstrapNode = Node.at(bootstrapNode.getName(), bootstrapNode.getIp(), bootstrapNode.getPort() + networkId);
|
||||
log.debug("Bootstrap to {}", bootstrapNode.toString());
|
||||
|
||||
log.debug("Bootstrap to {} with networkId {}", bootstrapNode.toString(), networkId);
|
||||
|
||||
DefaultEventExecutorGroup eventExecutorGroup = new DefaultEventExecutorGroup(20);
|
||||
ChannelClientConfiguration clientConf = PeerBuilder.createDefaultChannelClientConfiguration();
|
||||
clientConf.pipelineFilter(new PeerBuilder.EventExecutorGroupFilter(eventExecutorGroup));
|
||||
|
|
|
@ -127,8 +127,8 @@ public class TomP2PNode implements ClientNode {
|
|||
@Override
|
||||
public void peerUpdated(PeerAddress peerAddress, PeerStatistic peerStatistic) {
|
||||
BaseP2PService.getUserThread().execute(() -> numPeers.set(peerDHT.peerBean().peerMap().all().size()));
|
||||
log.debug("peerUpdated " + peerAddress);
|
||||
log.debug("Number of peers = " + peerDHT.peerBean().peerMap().all().size());
|
||||
// log.debug("peerUpdated " + peerAddress);
|
||||
// log.debug("Number of peers = " + peerDHT.peerBean().peerMap().all().size());
|
||||
}
|
||||
});
|
||||
/* peerDHT.peerBean().addPeerStatusListener(new PeerStatusListener() {
|
||||
|
|
|
@ -256,7 +256,7 @@ abstract public class Trade implements Tradable, Model, Serializable {
|
|||
abstract public void setFailedState();
|
||||
|
||||
public boolean isCriticalFault() {
|
||||
return tradeState.getPhase().ordinal() >= TradeState.Phase.DEPOSIT_PAID.ordinal();
|
||||
return tradeState.getPhase() != null && tradeState.getPhase().ordinal() >= TradeState.Phase.DEPOSIT_PAID.ordinal();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public class TradeManager {
|
|||
private final CryptoService<MailboxMessage> cryptoService;
|
||||
private final OpenOfferManager openOfferManager;
|
||||
private final ClosedTradableManager closedTradableManager;
|
||||
private FailedTradesManager failedTradesManager;
|
||||
private final FailedTradesManager failedTradesManager;
|
||||
private final ArbitrationRepository arbitrationRepository;
|
||||
|
||||
private final Storage<TradableList<Trade>> pendingTradesStorage;
|
||||
|
|
12
gui/pom.xml
12
gui/pom.xml
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>io.bitsquare</groupId>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<version>0.2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -131,11 +131,11 @@
|
|||
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.vinumeris</groupId>
|
||||
<artifactId>crashfx-client</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.vinumeris</groupId>
|
||||
<artifactId>crashfx-client</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.controlsfx</groupId>
|
||||
|
|
|
@ -60,6 +60,8 @@ import static io.bitsquare.app.BitsquareEnvironment.APP_NAME_KEY;
|
|||
public class BitsquareApp extends Application {
|
||||
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
|
||||
|
||||
public static final boolean DEV_MODE = true;
|
||||
|
||||
private static Environment env;
|
||||
|
||||
private BitsquareAppModule bitsquareAppModule;
|
||||
|
@ -96,7 +98,7 @@ public class BitsquareApp extends Application {
|
|||
Threading.USER_THREAD = Platform::runLater;
|
||||
|
||||
// Use CrashFX for report crash logs
|
||||
/* CrashFX.setup("Bitsquare/" + Version.VERSION,
|
||||
/*CrashFX.setup("Bitsquare/" + Version.VERSION,
|
||||
Paths.get(env.getProperty(BitsquareEnvironment.APP_DATA_DIR_KEY), "crashes"),
|
||||
URI.create("http://188.226.179.109/crashfx/upload"));*/
|
||||
// Server not setup yet, so we use client side only support
|
||||
|
@ -136,7 +138,8 @@ public class BitsquareApp extends Application {
|
|||
new KeyCodeCombination(KeyCode.Q, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
|
||||
stop();
|
||||
else if (new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
|
||||
showDebugWindow();
|
||||
if (BitsquareApp.DEV_MODE)
|
||||
showDebugWindow();
|
||||
});
|
||||
|
||||
// configure the primary stage
|
||||
|
@ -160,7 +163,6 @@ public class BitsquareApp extends Application {
|
|||
// make the UI visible
|
||||
primaryStage.show();
|
||||
|
||||
//TODO just temp.
|
||||
//showDebugWindow();
|
||||
} catch (Throwable throwable) {
|
||||
showErrorPopup(throwable, true);
|
||||
|
|
|
@ -47,7 +47,7 @@ import rx.subjects.Subject;
|
|||
public class UpdateProcess {
|
||||
private static final Logger log = LoggerFactory.getLogger(UpdateProcess.class);
|
||||
|
||||
private static final List<ECPoint> UPDATE_SIGNING_KEYS = Crypto.decode("0296CFF54A8B1611499D4C1024E654140AFBB58C505FE4BB7C847B4F4A7C683DF6");
|
||||
private static final List<ECPoint> UPDATE_SIGNING_KEYS = Crypto.decode("038396415C265C59042AB05A5436356E8D0FA19F13E3DE4915AFF763CB4785345E");
|
||||
private static final String UPDATES_BASE_URL = "http://bitsquare.io/updateFX/";
|
||||
private static final int UPDATE_SIGNING_THRESHOLD = 1;
|
||||
private static final Path ROOT_CLASS_PATH = UpdateFX.findCodePath(BitsquareAppMain.class);
|
||||
|
|
|
@ -97,19 +97,19 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
|||
@Override
|
||||
protected void initialize() {
|
||||
ToggleButton homeButton = new NavButton(HomeView.class, "Overview") {{
|
||||
setDisable(true); // alpha
|
||||
setDisable(true); // TODO for alpha
|
||||
}};
|
||||
ToggleButton buyButton = new NavButton(BuyOfferView.class, "Buy BTC");
|
||||
ToggleButton sellButton = new NavButton(SellOfferView.class, "Sell BTC");
|
||||
ToggleButton portfolioButton = new NavButton(PortfolioView.class, "Portfolio");
|
||||
ToggleButton fundsButton = new NavButton(FundsView.class, "Funds");
|
||||
ToggleButton msgButton = new NavButton(MsgView.class, "Messages") {{
|
||||
setDisable(true); // alpha
|
||||
setDisable(true); // TODO for alpha
|
||||
}};
|
||||
ToggleButton settingsButton = new NavButton(SettingsView.class, "Settings");
|
||||
ToggleButton accountButton = new NavButton(AccountView.class, "Account"); /*{{
|
||||
setDisable(true); // alpha
|
||||
}};*/
|
||||
ToggleButton accountButton = new NavButton(AccountView.class, "Account") {{
|
||||
setDisable(true); // TODO for alpha
|
||||
}};
|
||||
Pane portfolioButtonHolder = new Pane(portfolioButton);
|
||||
Pane bankAccountComboBoxHolder = new Pane();
|
||||
|
||||
|
@ -208,7 +208,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
|||
blockchainSyncLabel.textProperty().bind(model.blockchainSyncInfo);
|
||||
walletServiceErrorMsgListener = (ov, oldValue, newValue) -> {
|
||||
blockchainSyncLabel.setId("splash-error-state-msg");
|
||||
openBTCConnectionErrorPopup(newValue);
|
||||
// error popup is called by error handler at createFooter
|
||||
};
|
||||
model.walletServiceErrorMsg.addListener(walletServiceErrorMsgListener);
|
||||
|
||||
|
@ -257,7 +257,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
|||
bootstrapErrorMsgListener = (ov, oldValue, newValue) -> {
|
||||
bootstrapStateLabel.setId("splash-error-state-msg");
|
||||
bootstrapIndicator.setVisible(false);
|
||||
openBTCConnectionErrorPopup(model.bootstrapErrorMsg.get());
|
||||
// error popup is handled by handler at createFooter
|
||||
};
|
||||
model.bootstrapErrorMsg.addListener(bootstrapErrorMsgListener);
|
||||
|
||||
|
@ -490,7 +490,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
|||
vBox.setAlignment(Pos.CENTER);
|
||||
vBox.getChildren().setAll(comboBox, titleLabel);
|
||||
|
||||
// For alpha
|
||||
// TODO for alpha
|
||||
vBox.setDisable(true);
|
||||
|
||||
return vBox;
|
||||
|
@ -559,7 +559,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
|||
}
|
||||
|
||||
private void openBTCConnectionErrorPopup(String errorMsg) {
|
||||
Popups.openErrorPopup("Error", "Connecting to the bitcoin network failed. \n" + errorMsg
|
||||
+ "\nPlease check your internet connection.");
|
||||
Popups.openErrorPopup("Error", "Connecting to the bitcoin network failed. \n" + errorMsg);
|
||||
// + "\nPlease check your internet connection."
|
||||
}
|
||||
}
|
|
@ -64,8 +64,9 @@ import rx.Observable;
|
|||
class MainViewModel implements ViewModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(MainViewModel.class);
|
||||
|
||||
private static final long BLOCKCHAIN_SYNC_TIMEOUT = 30000;
|
||||
private static final long LOST_CONNECTION_TIMEOUT = 10000;
|
||||
private static final long BLOCKCHAIN_SYNC_TIMEOUT = 60000;
|
||||
private static final long LOST_P2P_CONNECTION_TIMEOUT = 5000;
|
||||
private static final long LOST_BTC_CONNECTION_TIMEOUT = 2000;
|
||||
|
||||
private final User user;
|
||||
private final KeyRing keyRing;
|
||||
|
@ -112,7 +113,8 @@ class MainViewModel implements ViewModel {
|
|||
final String bitcoinNetworkAsString;
|
||||
|
||||
private Timer blockchainSyncTimeoutTimer;
|
||||
private Timer lostConnectionTimeoutTimer;
|
||||
private Timer lostP2PConnectionTimeoutTimer;
|
||||
private Timer lostBTCConnectionTimeoutTimer;
|
||||
|
||||
|
||||
@Inject
|
||||
|
@ -160,11 +162,23 @@ class MainViewModel implements ViewModel {
|
|||
setBitcoinNetworkSyncProgress(walletService.downloadPercentageProperty().get());
|
||||
|
||||
walletService.numPeersProperty().addListener((observable, oldValue, newValue) -> {
|
||||
|
||||
numBTCPeers.set(String.valueOf(newValue) + " peers");
|
||||
if ((int) newValue < 1)
|
||||
walletServiceErrorMsg.set("We lost connection to the last peer.");
|
||||
else
|
||||
if ((int) newValue < 1) {
|
||||
if (lostBTCConnectionTimeoutTimer != null)
|
||||
lostBTCConnectionTimeoutTimer.cancel();
|
||||
lostBTCConnectionTimeoutTimer = Utilities.setTimeout(LOST_BTC_CONNECTION_TIMEOUT, () -> {
|
||||
log.trace("Connection lost timeout reached");
|
||||
walletServiceErrorMsg.set("We lost connection to the last peer.");
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (lostBTCConnectionTimeoutTimer != null) {
|
||||
lostBTCConnectionTimeoutTimer.cancel();
|
||||
lostBTCConnectionTimeoutTimer = null;
|
||||
}
|
||||
walletServiceErrorMsg.set(null);
|
||||
}
|
||||
});
|
||||
|
||||
// Set executor for all P2PServices
|
||||
|
@ -173,17 +187,17 @@ class MainViewModel implements ViewModel {
|
|||
clientNode.numPeersProperty().addListener((observable, oldValue, newValue) -> {
|
||||
numDHTPeers.set(String.valueOf(newValue) + " peers");
|
||||
if ((int) newValue == 0) {
|
||||
if (lostConnectionTimeoutTimer != null)
|
||||
lostConnectionTimeoutTimer.cancel();
|
||||
lostConnectionTimeoutTimer = Utilities.setTimeout(LOST_CONNECTION_TIMEOUT, () -> {
|
||||
if (lostP2PConnectionTimeoutTimer != null)
|
||||
lostP2PConnectionTimeoutTimer.cancel();
|
||||
lostP2PConnectionTimeoutTimer = Utilities.setTimeout(LOST_P2P_CONNECTION_TIMEOUT, () -> {
|
||||
log.trace("Connection lost timeout reached");
|
||||
bootstrapErrorMsg.set("We lost connection to the last peer.");
|
||||
});
|
||||
}
|
||||
else if ((int) oldValue == 0 && (int) newValue > 0) {
|
||||
if (lostConnectionTimeoutTimer != null) {
|
||||
lostConnectionTimeoutTimer.cancel();
|
||||
lostConnectionTimeoutTimer = null;
|
||||
if (lostP2PConnectionTimeoutTimer != null) {
|
||||
lostP2PConnectionTimeoutTimer.cancel();
|
||||
lostP2PConnectionTimeoutTimer = null;
|
||||
}
|
||||
bootstrapErrorMsg.set(null);
|
||||
}
|
||||
|
@ -243,7 +257,7 @@ class MainViewModel implements ViewModel {
|
|||
updateNumPendingTrades();
|
||||
showAppScreen.set(true);
|
||||
|
||||
// For alpha version
|
||||
// TODO for alpha version
|
||||
if (!user.isRegistered()) {
|
||||
FiatAccount fiatAccount = new FiatAccount(FiatAccount.Type.IRC,
|
||||
"EUR",
|
||||
|
@ -400,7 +414,6 @@ class MainViewModel implements ViewModel {
|
|||
log.trace("startBlockchainSyncTimeout");
|
||||
stopBlockchainSyncTimeout();
|
||||
|
||||
|
||||
blockchainSyncTimeoutTimer = Utilities.setTimeout(BLOCKCHAIN_SYNC_TIMEOUT, () -> {
|
||||
log.trace("Timeout reached");
|
||||
setWalletServiceException(new TimeoutException());
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.offer.createoffer;
|
||||
|
||||
import io.bitsquare.app.BitsquareApp;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
|
@ -279,10 +280,11 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
|||
};
|
||||
|
||||
showTransactionPublishedScreen = (o, oldValue, newValue) -> {
|
||||
// TODO temp just for testing
|
||||
newValue = false;
|
||||
close();
|
||||
navigation.navigateTo(MainView.class, PortfolioView.class, OpenOffersView.class);
|
||||
if (BitsquareApp.DEV_MODE) {
|
||||
newValue = false;
|
||||
close();
|
||||
navigation.navigateTo(MainView.class, PortfolioView.class, OpenOffersView.class);
|
||||
}
|
||||
|
||||
if (newValue) {
|
||||
overlayManager.blurContent();
|
||||
|
@ -386,25 +388,26 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
|||
|
||||
@FXML
|
||||
void onShowPayFundsScreen() {
|
||||
// TODO deactivate for testing the moment
|
||||
/* if (model.getDisplaySecurityDepositInfo()) {
|
||||
overlayManager.blurContent();
|
||||
List<Action> actions = new ArrayList<>();
|
||||
actions.add(new AbstractAction(BSResources.get("shared.close")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
getProperties().put("type", "CLOSE");
|
||||
Dialog.Actions.CLOSE.handle(actionEvent);
|
||||
}
|
||||
});
|
||||
Popups.openInfoPopup("To ensure that both traders behave fair they need to pay a security deposit.",
|
||||
"The deposit will stay in your local trading wallet until the offer gets accepted by " +
|
||||
"another trader. " +
|
||||
"\nIt will be refunded to you after the trade has successfully completed.",
|
||||
actions);
|
||||
if (!BitsquareApp.DEV_MODE) {
|
||||
if (model.getDisplaySecurityDepositInfo()) {
|
||||
overlayManager.blurContent();
|
||||
List<Action> actions = new ArrayList<>();
|
||||
actions.add(new AbstractAction(BSResources.get("shared.close")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
getProperties().put("type", "CLOSE");
|
||||
Dialog.Actions.CLOSE.handle(actionEvent);
|
||||
}
|
||||
});
|
||||
Popups.openInfoPopup("To ensure that both traders behave fair they need to pay a security deposit.",
|
||||
"The deposit will stay in your local trading wallet until the offer gets accepted by " +
|
||||
"another trader. " +
|
||||
"\nIt will be refunded to you after the trade has successfully completed.",
|
||||
actions);
|
||||
|
||||
model.securityDepositInfoDisplayed();
|
||||
}*/
|
||||
model.onSecurityDepositInfoDisplayed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
priceAmountPane.setInactive();
|
||||
|
|
|
@ -58,8 +58,6 @@ import org.controlsfx.dialog.Dialog;
|
|||
|
||||
import static javafx.beans.binding.Bindings.createStringBinding;
|
||||
|
||||
// Note: countryColumn is deactivated in alpha version
|
||||
|
||||
@FxmlView
|
||||
public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookViewModel> {
|
||||
|
||||
|
@ -110,7 +108,8 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
|
|||
setAmountColumnCellFactory();
|
||||
setPriceColumnCellFactory();
|
||||
setVolumeColumnCellFactory();
|
||||
/* setCountryColumnCellFactory();*/
|
||||
// TODO: countryColumn is deactivated in alpha version
|
||||
// setCountryColumnCellFactory();
|
||||
setBankAccountTypeColumnCellFactory();
|
||||
setDirectionColumnCellFactory();
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.offer.offerbook;
|
||||
|
||||
import io.bitsquare.app.BitsquareApp;
|
||||
import io.bitsquare.common.handlers.ErrorMessageHandler;
|
||||
import io.bitsquare.common.handlers.ResultHandler;
|
||||
import io.bitsquare.gui.common.model.ActivatableWithDataModel;
|
||||
|
@ -143,10 +144,12 @@ class OfferBookViewModel extends ActivatableWithDataModel<OfferBookDataModel> im
|
|||
price.addListener(priceListener);
|
||||
volume.addListener(volumeListener);
|
||||
|
||||
amount.set("1");
|
||||
price.set("300");
|
||||
setAmountToModel();
|
||||
setPriceToModel();
|
||||
if (BitsquareApp.DEV_MODE) {
|
||||
amount.set("1");
|
||||
price.set("300");
|
||||
setAmountToModel();
|
||||
setPriceToModel();
|
||||
}
|
||||
}
|
||||
|
||||
private void removeListeners() {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package io.bitsquare.gui.main.offer.takeoffer;
|
||||
|
||||
|
||||
import io.bitsquare.app.BitsquareApp;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
|
||||
|
@ -203,11 +204,12 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
}
|
||||
};
|
||||
showTransactionPublishedScreenListener = (o, oldValue, newValue) -> {
|
||||
// TODO temp just for testing
|
||||
newValue = false;
|
||||
close();
|
||||
navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class);
|
||||
|
||||
if (BitsquareApp.DEV_MODE) {
|
||||
newValue = false;
|
||||
close();
|
||||
navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class);
|
||||
}
|
||||
|
||||
if (newValue) {
|
||||
overlayManager.blurContent();
|
||||
|
||||
|
@ -371,24 +373,25 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
}
|
||||
|
||||
private void setupPaymentScreen() {
|
||||
// TODO deactivate for testing the moment
|
||||
/* if (model.getDisplaySecurityDepositInfo()) {
|
||||
overlayManager.blurContent();
|
||||
List<Action> actions = new ArrayList<>();
|
||||
actions.add(new AbstractAction(BSResources.get("shared.close")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
getProperties().put("type", "CLOSE");
|
||||
Dialog.Actions.CLOSE.handle(actionEvent);
|
||||
}
|
||||
});
|
||||
Popups.openInfoPopup("To ensure that both traders behave fair they need to pay a security deposit.",
|
||||
"The deposit will stay in your local trading wallet until the offer gets accepted by another trader. " +
|
||||
"\nIt will be refunded to you after the trade has successfully completed.",
|
||||
actions);
|
||||
if (!BitsquareApp.DEV_MODE) {
|
||||
if (model.getDisplaySecurityDepositInfo()) {
|
||||
overlayManager.blurContent();
|
||||
List<Action> actions = new ArrayList<>();
|
||||
actions.add(new AbstractAction(BSResources.get("shared.close")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
getProperties().put("type", "CLOSE");
|
||||
Dialog.Actions.CLOSE.handle(actionEvent);
|
||||
}
|
||||
});
|
||||
Popups.openInfoPopup("To ensure that both traders behave fair they need to pay a security deposit.",
|
||||
"The deposit will stay in your local trading wallet until the offer gets accepted by another trader. " +
|
||||
"\nIt will be refunded to you after the trade has successfully completed.",
|
||||
actions);
|
||||
|
||||
model.securityDepositInfoDisplayed();
|
||||
}*/
|
||||
model.onSecurityDepositInfoDisplayed();
|
||||
}
|
||||
}
|
||||
|
||||
priceAmountPane.setInactive();
|
||||
takeOfferButton.setVisible(true);
|
||||
|
|
|
@ -455,7 +455,7 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
|
|||
return dataModel.getDirection() == Offer.Direction.BUY;
|
||||
}
|
||||
|
||||
void securityDepositInfoDisplayed() {
|
||||
void onSecurityDepositInfoDisplayed() {
|
||||
dataModel.onSecurityDepositInfoDisplayed();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,5 @@
|
|||
<Tab fx:id="openOffersTab" text="Open offers"/>
|
||||
<Tab fx:id="pendingTradesTab" text="Open trades"/>
|
||||
<Tab fx:id="closedTradesTab" text="History"/>
|
||||
<Tab fx:id="failedTradesTab" text="Failed"/>
|
||||
|
||||
</TabPane>
|
||||
|
|
|
@ -29,29 +29,34 @@ import io.bitsquare.gui.main.portfolio.closedtrades.ClosedTradesView;
|
|||
import io.bitsquare.gui.main.portfolio.failedtrades.FailedTradesView;
|
||||
import io.bitsquare.gui.main.portfolio.openoffer.OpenOffersView;
|
||||
import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesView;
|
||||
import io.bitsquare.trade.Trade;
|
||||
import io.bitsquare.trade.failed.FailedTradesManager;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
|
||||
@FxmlView
|
||||
public class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable> {
|
||||
|
||||
@FXML Tab openOffersTab, pendingTradesTab, closedTradesTab, failedTradesTab;
|
||||
|
||||
@FXML Tab openOffersTab, pendingTradesTab, closedTradesTab;
|
||||
private Tab failedTradesTab = new Tab("Failed");
|
||||
private Tab currentTab;
|
||||
private Navigation.Listener navigationListener;
|
||||
private ChangeListener<Tab> tabChangeListener;
|
||||
|
||||
private final ViewLoader viewLoader;
|
||||
private final Navigation navigation;
|
||||
private FailedTradesManager failedTradesManager;
|
||||
|
||||
@Inject
|
||||
public PortfolioView(CachingViewLoader viewLoader, Navigation navigation) {
|
||||
public PortfolioView(CachingViewLoader viewLoader, Navigation navigation, FailedTradesManager failedTradesManager) {
|
||||
this.viewLoader = viewLoader;
|
||||
this.navigation = navigation;
|
||||
this.failedTradesManager = failedTradesManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,6 +82,16 @@ public class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable>
|
|||
|
||||
@Override
|
||||
public void doActivate() {
|
||||
failedTradesManager.getFailedTrades().addListener((ListChangeListener<Trade>) c -> {
|
||||
if (failedTradesManager.getFailedTrades().size() > 0 && root.getTabs().size() == 3)
|
||||
root.getTabs().add(failedTradesTab);
|
||||
else
|
||||
root.getTabs().remove(failedTradesTab);
|
||||
});
|
||||
if (failedTradesManager.getFailedTrades().size() > 0 && root.getTabs().size() == 3)
|
||||
root.getTabs().add(failedTradesTab);
|
||||
else
|
||||
root.getTabs().remove(failedTradesTab);
|
||||
root.getSelectionModel().selectedItemProperty().addListener(tabChangeListener);
|
||||
navigation.addListener(navigationListener);
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.pendingtrades.steps;
|
||||
|
||||
import io.bitsquare.app.BitsquareApp;
|
||||
import io.bitsquare.gui.components.InfoDisplay;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesViewModel;
|
||||
|
@ -131,8 +132,8 @@ public class CompletedView extends TradeStepDetailsView {
|
|||
withdrawAddressTextField = getAndAddLabelInputTextFieldPair(gridPane, gridRow++, "Withdraw to address:").inputTextField;
|
||||
withdrawButton = getAndAddButton(gridPane, gridRow++, "Withdraw to external wallet", this::onWithdrawRequest);
|
||||
|
||||
//TODO just temp for testing
|
||||
withdrawAddressTextField.setText("mxmKZruv9x9JLcEj6rZx6Hnm4LLAcQHtcr");
|
||||
if (BitsquareApp.DEV_MODE)
|
||||
withdrawAddressTextField.setText("mkNW1omJFA7RD3AZ94mfKqubRff2gx21KE");
|
||||
}
|
||||
|
||||
public void setBtcTradeAmountLabelText(String text) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
|
|||
btcDenominationComboBox.setItems(model.getBtcDenominationItems());
|
||||
btcDenominationComboBox.getSelectionModel().select(model.btcDenomination().get());
|
||||
|
||||
// For alpha
|
||||
// TODO for alpha
|
||||
btcDenominationComboBox.setDisable(true);
|
||||
|
||||
useAnimationsCheckBox.selectedProperty().bindBidirectional(model.useAnimations());
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<key>CFBundleIconFile</key>
|
||||
<string>package/mac/Bitsquare.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.bitsquare</string>
|
||||
<string>io.bitsquare.Bitsquare</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
@ -21,17 +21,23 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>19</string>
|
||||
<string>1</string>
|
||||
|
||||
<!-- CFBundleSignature exists only for compatibility with Classic Mac OS apps and documents. Modern Mac OS X apps don't need to worry about assigning a Bundle
|
||||
Signature.-->
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<!-- See http://developer.apple.com/library/mac/#releasenotes/General/SubmittingToMacAppStore/_index.html
|
||||
for list of AppStore categories -->
|
||||
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>Unknown</string>
|
||||
<string>public.app-category.finance</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>100</string>
|
||||
<string>1</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright (C) 2015</string>
|
||||
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>true</string>
|
||||
|
||||
<key>JVMRuntime</key>
|
||||
<string>..</string>
|
||||
<key>JVMMainClassName</key>
|
||||
|
@ -44,13 +50,10 @@
|
|||
<string>bitsquare</string>
|
||||
<key>JVMOptions</key>
|
||||
<array>
|
||||
|
||||
</array>
|
||||
<key>JVMUserOptions</key>
|
||||
<dict>
|
||||
|
||||
</dict>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>true</string>
|
||||
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<key>CFBundleIconFile</key>
|
||||
<string>package/mac/Bitsquare.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.bitsquare</string>
|
||||
<string>io.bitsquare.Bitsquare</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
@ -21,17 +21,23 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>19</string>
|
||||
<string>1</string>
|
||||
|
||||
<!-- CFBundleSignature exists only for compatibility with Classic Mac OS apps and documents. Modern Mac OS X apps don't need to worry about assigning a Bundle
|
||||
Signature.-->
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<!-- See http://developer.apple.com/library/mac/#releasenotes/General/SubmittingToMacAppStore/_index.html
|
||||
for list of AppStore categories -->
|
||||
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>Unknown</string>
|
||||
<string>public.app-category.finance</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>100</string>
|
||||
<string>1</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright (C) 2015</string>
|
||||
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>true</string>
|
||||
|
||||
<key>JVMRuntime</key>
|
||||
<string>..</string>
|
||||
<key>JVMMainClassName</key>
|
||||
|
@ -44,13 +50,10 @@
|
|||
<string>bitsquare</string>
|
||||
<key>JVMOptions</key>
|
||||
<array>
|
||||
|
||||
</array>
|
||||
<key>JVMUserOptions</key>
|
||||
<dict>
|
||||
|
||||
</dict>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>true</string>
|
||||
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -31,7 +31,9 @@ sed "s|JAR_NAME_STRING_GOES_HERE|$patchVersion.jar|" package/mac/Info.template.p
|
|||
mvn clean package -DskipTests -Dmaven.javadoc.skip=true
|
||||
cp gui/target/shaded.jar gui/updatefx/builds/$patchVersion.jar
|
||||
|
||||
java -jar ./updatefx/updatefx-app-1.2.jar --url=http://bitsquare.io/updateFX/ gui/updatefx
|
||||
java -jar ./updatefx/updatefx-app-1.6.jar --url=http://bitsquare.io/updateFX/ gui/updatefx
|
||||
# using trezor
|
||||
#java -jar ./updatefx/updatefx-app-1.6.jar --url=http://bitsquare.io/updateFX/ gui/updatefx --trezor
|
||||
|
||||
$JAVA_HOME/bin/javapackager \
|
||||
-deploy \
|
||||
|
|
|
@ -9,7 +9,7 @@ mkdir gui/updatefx/site
|
|||
mkdir gui/deploy
|
||||
|
||||
# create key/wallet. Copy wallet key to UpdateProcess and use wallet for other OS builds
|
||||
java -jar ./updatefx/updatefx-app-1.2.jar --url=http://bitsquare.io/updateFX/ gui/updatefx
|
||||
java -jar ./updatefx/updatefx-app-1.6.jar --url=http://bitsquare.io/updateFX/ gui/updatefx
|
||||
|
||||
cd package/mac
|
||||
|
||||
|
|
|
@ -13,6 +13,6 @@ echo patchVersion = $patchVersion
|
|||
|
||||
mvn clean package -DskipTests -Dmaven.javadoc.skip=true
|
||||
cp gui/target/shaded.jar gui/updatefx/builds/$patchVersion.jar
|
||||
java -jar ./updatefx/updatefx-app-1.2.jar --url=http://bitsquare.io/updateFX/ gui/updatefx
|
||||
java -jar ./updatefx/updatefx-app-1.6.jar --url=http://bitsquare.io/updateFX/ gui/updatefx
|
||||
|
||||
cd package/mac
|
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
|||
<groupId>io.bitsquare</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<version>0.2.1</version>
|
||||
<description>The decentralized bitcoin exchange</description>
|
||||
<url>https://bitsquare.io</url>
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue