use bitcoin as currency in lowercase

This commit is contained in:
Manfred Karrer 2016-01-18 13:04:15 +01:00
parent 49b5ac5403
commit be4a25abb0
40 changed files with 109 additions and 114 deletions

View File

@ -38,7 +38,15 @@ public class Version {
public static final long PROTOCOL_VERSION = 1;
// The version for the bitcoin network (Mainnet = 0, TestNet = 1, Regtest = 2)
public static int NETWORK_ID;
private static int NETWORK_ID;
public static int getNetworkId() {
return NETWORK_ID;
}
public static void setNetworkId(int networkId) {
NETWORK_ID = networkId;
}
public static void printVersion() {
log.info("Version{" +
@ -50,4 +58,5 @@ public class Version {
'}');
}
}

View File

@ -21,7 +21,7 @@ import io.bitsquare.app.Version;
import io.bitsquare.p2p.messaging.MailboxMessage;
public abstract class DisputeMessage implements MailboxMessage {
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
@Override
public int networkId() {

View File

@ -27,7 +27,7 @@ public abstract class OfferMessage implements MailMessage {
// That object is sent over the wire, so we need to take care of version compatibility.
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public final String offerId;
protected OfferMessage(String offerId) {

View File

@ -27,7 +27,7 @@ public abstract class TradeMessage implements MailMessage {
// That object is sent over the wire, so we need to take care of version compatibility.
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public final String tradeId;
@Override

View File

@ -128,7 +128,7 @@ public class BitsquareApp extends Application {
injector = Guice.createInjector(bitsquareAppModule);
injector.getInstance(InjectorViewFactory.class).setInjector(injector);
Version.NETWORK_ID = injector.getInstance(BitsquareEnvironment.class).getBitcoinNetwork().ordinal();
Version.setNetworkId(injector.getInstance(BitsquareEnvironment.class).getBitcoinNetwork().ordinal());
// load the main view and create the main scene
CachingViewLoader viewLoader = injector.getInstance(CachingViewLoader.class);

View File

@ -62,13 +62,13 @@ public class AddressTextField extends AnchorPane {
textField.setId("address-text-field");
textField.setEditable(false);
textField.textProperty().bind(address);
Tooltip.install(textField, new Tooltip("Open your default Bitcoin wallet with that address."));
Tooltip.install(textField, new Tooltip("Open your default bitcoin wallet with that address."));
textField.setOnMouseClicked(mouseEvent -> {
try {
Utilities.openURI(URI.create(getBitcoinURI()));
} catch (Exception e) {
log.warn(e.getMessage());
new Popup().warning("Opening a system Bitcoin wallet application has failed. " +
new Popup().warning("Opening a default bitcoin wallet application has failed. " +
"Perhaps you don't have one installed?").show();
}
});

View File

@ -60,7 +60,7 @@
</HBox>
<InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="4"
text="Protect your wallet with a strong password. You need to enter the password any time you withdraw Bitcoin from your trading wallets. You can change the password later in the settings. Open the help menu for more information."/>
text="Protect your wallet with a strong password. You need to enter the password any time you withdraw bitcoin from your trading wallets. You can change the password later in the settings. Open the help menu for more information."/>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>

View File

@ -142,7 +142,7 @@ public class PasswordView extends ActivatableView<GridPane, Void> {
addTitledGroupBg(root, ++gridRow, 1, "Information", Layout.GROUP_DISTANCE);
addMultilineLabel(root, gridRow,
"With password protection you need to enter your password when" +
" withdrawing Bitcoin out of your wallet or " +
" withdrawing bitcoin out of your wallet or " +
"if you want to view or restore a wallet from seed words.\n" +
"For the transactions used in the trade process we don't support password protection as that would make automatic offer " +
"execution impossible.",

View File

@ -178,8 +178,8 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
.headLine("Wallet is not empty")
.warning("You must empty this wallet out before attempting to restore an older one, as mixing wallets " +
"together can lead to invalidated backups.\n\n" +
"Please finalize your trades, close all your open offers and go to the Funds section to withdraw your Bitcoin.\n" +
"In case you cannot access your Bitcoin you can use the emergency tool to empty the wallet.\n" +
"Please finalize your trades, close all your open offers and go to the Funds section to withdraw your bitcoin.\n" +
"In case you cannot access your bitcoin you can use the emergency tool to empty the wallet.\n" +
"To open that emergency tool press cmd + e.")
.show();
} else if (wallet.isEncrypted()) {

View File

@ -116,7 +116,7 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
if (viewClass == OfferBookView.class && offerBookView == null) {
view = viewLoader.load(viewClass);
// Offerbook must not be cached by ViewLoader as we use 2 instances for sell and buy screens.
final Tab tab = new Tab(direction == Offer.Direction.BUY ? "Buy Bitcoin" : "Sell Bitcoin");
final Tab tab = new Tab(direction == Offer.Direction.BUY ? "Buy bitcoin" : "Sell bitcoin");
tab.setClosable(false);
tab.setContent(view.getRoot());
tabPane.getTabs().add(tab);

View File

@ -225,9 +225,9 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
new Popup().information("To ensure that both traders follow the trade protocol they need to pay a security deposit.\n\n" +
"The deposit will stay in your local trading wallet until the offer gets accepted by another trader.\n" +
"It will be refunded to you after the trade has successfully completed.\n\n" +
"You need to pay in the exact amount displayed to you from your external Bitcoin wallet into the " +
"You need to pay in the exact amount displayed to you from your external bitcoin wallet into the " +
"Bitsquare trade wallet. The amount is the sum of the security deposit, the trading fee and " +
"the Bitcoin mining fee.\n" +
"the bitcoin mining fee.\n" +
"You can see the details when you move the mouse over the question mark.").show();
model.onSecurityDepositInfoDisplayed();

View File

@ -359,10 +359,10 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
});
new Popup().information("To ensure that both traders follow the trade protocol they need to pay a security deposit.\n\n" +
"The security deposit will be refunded to you after the trade has successfully completed.\n\n" +
"You need to pay in the exact amount displayed to you from your external Bitcoin wallet into the " +
"You need to pay in the exact amount displayed to you from your external bitcoin wallet into the " +
"Bitsquare trade wallet. In case you over pay, you will get it refunded after the trade.\n\n" +
"The amount needed for funding is the sum of the trade amount, the security deposit, " +
"the trading fee and the Bitcoin mining fee.\n" +
"the trading fee and the bitcoin mining fee.\n" +
"You can see the details when you move the mouse over the question mark.").show();
model.onSecurityDepositInfoDisplayed();

View File

@ -100,46 +100,6 @@ public class OpenOffersView extends ActivatableViewAndModel<VBox, OpenOffersView
});
}
/* private void openOfferDetails(OpenOfferListItem item) {
Offer offer = item.getOffer();
int rowIndex = 0;
GridPane gridPane = new GridPane();
gridPane.setPrefWidth(700);
gridPane.setPadding(new Insets(30, 30, 30, 30));
gridPane.setHgap(Layout.GRID_GAP);
gridPane.setVgap(Layout.GRID_GAP);
gridPane.setStyle("-fx-background-color: -bs-content-bg-grey");
ColumnConstraints columnConstraints1 = new ColumnConstraints();
columnConstraints1.setHalignment(HPos.RIGHT);
columnConstraints1.setHgrow(Priority.SOMETIMES);
ColumnConstraints columnConstraints2 = new ColumnConstraints();
columnConstraints2.setHgrow(Priority.ALWAYS);
gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2);
int rows = offer.getPaymentMethodCountry() == null ? 10 : 11;
addTitledGroupBg(gridPane, rowIndex, rows, "Offer details");
addLabelTextField(gridPane, rowIndex, "Offer ID:", offer.getId(), Layout.FIRST_ROW_DISTANCE);
addLabelTextField(gridPane, ++rowIndex, "Creation date:", formatter.formatDateTime(offer.getDate()));
addLabelTextField(gridPane, ++rowIndex, "Offer direction:", formatter.formatDirection(offer.getDirection()));
addLabelTextField(gridPane, ++rowIndex, "Currency code:", offer.getCurrencyCode());
addLabelTextField(gridPane, ++rowIndex, "Price:", formatter.formatFiat(offer.getPrice()));
addLabelTextField(gridPane, ++rowIndex, "Bitcoin amount:", formatter.formatCoin(offer.getAmount()));
addLabelTextField(gridPane, ++rowIndex, "Min. amount:", formatter.formatCoin(offer.getMinAmount()));
addLabelTextField(gridPane, ++rowIndex, "Payment method:", BSResources.get(offer.getPaymentMethod().getName()));
if (offer.getPaymentMethodCountry() != null)
addLabelTextField(gridPane, ++rowIndex, "Country of bank:", offer.getPaymentMethodCountry().code);
addLabelTextField(gridPane, ++rowIndex, "Accepted arbitrators:", formatter.arbitratorNamesToString(offer.getArbitratorNames()));
addLabelTxIdTextField(gridPane, ++rowIndex, "Create offer fee transaction ID:", offer.getOfferFeePaymentTxID());
Button closeButton = addButton(gridPane, ++rowIndex, "Close");
GridPane.setMargin(closeButton, new Insets(15, 0, 0, 0));
PopOver popover = PopOvers.getPopOver(gridPane);
PopOvers.showInCenter(popover);
closeButton.setOnAction(e -> popover.hide());
}*/
private void setOfferIdColumnCellFactory() {
offerIdColumn.setCellValueFactory((openOfferListItem) -> new ReadOnlyObjectWrapper<>(openOfferListItem.getValue()));
offerIdColumn.setCellFactory(

View File

@ -104,7 +104,7 @@ public class BuyerSubView extends TradeSubView {
startPayment.setCompleted();
showItem(waitPaymentReceived);
((WaitPaymentReceivedView) tradeStepDetailsView).setInfoLabelText(BSResources.get("Waiting for the Bitcoin sellers confirmation " +
((WaitPaymentReceivedView) tradeStepDetailsView).setInfoLabelText(BSResources.get("Waiting for the bitcoin sellers confirmation " +
"that the {0} payment has arrived.",
model.getCurrencyCode()));
break;
@ -116,7 +116,7 @@ public class BuyerSubView extends TradeSubView {
showItem(waitPayoutUnlock);
((WaitPayoutLockTimeView) tradeStepDetailsView).setInfoLabelText("The payout transaction is signed and finalized by both parties." +
"\nFor reducing bank charge back risks you need to wait until the payout gets unlocked to transfer your Bitcoin.");
"\nFor reducing bank charge back risks you need to wait until the payout gets unlocked to transfer your bitcoin.");
}
break;
case REQUEST_WITHDRAWAL:

View File

@ -93,7 +93,7 @@ public class SellerSubView extends TradeSubView {
showItem(waitTxInBlockchain);
((WaitTxInBlockchainView) tradeStepDetailsView).setInfoLabelText("Deposit transaction has been published. " +
"The Bitcoin buyer need to wait for at least one blockchain confirmation.");
"The bitcoin buyer need to wait for at least one blockchain confirmation.");
break;
case WAIT_FOR_FIAT_PAYMENT_STARTED:
waitTxInBlockchain.setCompleted();
@ -110,11 +110,11 @@ public class SellerSubView extends TradeSubView {
showItem(confirmPaymentReceived);
if (model.isBlockChainMethod()) {
((ConfirmPaymentReceivedView) tradeStepDetailsView).setInfoLabelText(BSResources.get("The Bitcoin buyer has started the {0} payment. " +
((ConfirmPaymentReceivedView) tradeStepDetailsView).setInfoLabelText(BSResources.get("The bitcoin buyer has started the {0} payment. " +
"Check your Altcoin wallet or Block explorer and confirm when you have received the payment.",
model.getCurrencyCode()));
} else {
((ConfirmPaymentReceivedView) tradeStepDetailsView).setInfoLabelText(BSResources.get("The Bitcoin buyer has started the {0} payment. " +
((ConfirmPaymentReceivedView) tradeStepDetailsView).setInfoLabelText(BSResources.get("The bitcoin buyer has started the {0} payment. " +
"Check your payment account and confirm when you have received the payment.",
model.getCurrencyCode()));
}
@ -141,7 +141,7 @@ public class SellerSubView extends TradeSubView {
showItem(waitPayoutUnlock);
((WaitPayoutLockTimeView) tradeStepDetailsView).setInfoLabelText("The payout transaction is signed and finalized by both parties." +
"\nFor reducing bank charge back risks you need to wait until the payout gets unlocked to transfer your Bitcoin.");
"\nFor reducing bank charge back risks you need to wait until the payout gets unlocked to transfer your bitcoin.");
break;
case REQUEST_WITHDRAWAL:
waitTxInBlockchain.setCompleted();

View File

@ -113,8 +113,8 @@ public class ConfirmPaymentReceivedView extends TradeStepDetailsView {
if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) {
new Popup().headLine("Confirmation")
.message("Do you have received the payment from your trading partner?\n\n" +
"Please note that as soon you have confirmed the locked Bitcoin will be released.\n" +
"There is no way to reverse a Bitcoin payment.")
"Please note that as soon you have confirmed the locked bitcoin will be released.\n" +
"There is no way to reverse a bitcoin payment.")
.dontShowAgainId(key, preferences)
.actionButtonText("Yes I have received the payment")
.closeButtonText("No")

View File

@ -84,7 +84,7 @@ public class NetworkSettingsView extends ActivatableViewAndModel<GridPane, Activ
BitcoinNetwork bitcoinNetwork = preferences.getBitcoinNetwork();
boolean useLocalhost = p2PService.getNetworkNode() instanceof LocalhostNetworkNode;
this.seedNodeAddresses = seedNodesRepository.geSeedNodeAddresses(useLocalhost, bitcoinNetwork.ordinal());
this.seedNodeAddresses = seedNodesRepository.getSeedNodeAddresses(useLocalhost, bitcoinNetwork.ordinal());
}
public void initialize() {

View File

@ -370,6 +370,6 @@ public class BSFormatter {
}
public String getDirectionDescription(Offer.Direction direction) {
return direction == Offer.Direction.BUY ? "Offerer as Bitcoin buyer / Taker as Bitcoin seller" : "Offerer as Bitcoin seller / Taker as Bitcoin buyer";
return direction == Offer.Direction.BUY ? "Offerer as bitcoin buyer / Taker as bitcoin seller" : "Offerer as bitcoin seller / Taker as bitcoin buyer";
}
}

View File

@ -47,7 +47,7 @@ public final class BtcAddressValidator extends InputValidator {
new Address(preferences.getBitcoinNetwork().getParameters(), input);
return new ValidationResult(true);
} catch (AddressFormatException e) {
return new ValidationResult(false, "Bitcoin address is a valid format");
return new ValidationResult(false, "Invalid format of the bitcoin address.");
}
}
}

View File

@ -10,8 +10,8 @@ shared.yes=Yes
shared.no=No
shared.openSettings=Open settings for editing
shared.buyBitcoin=Buy Bitcoin
shared.sellBitcoin=Sell Bitcoin
shared.buyBitcoin=Buy bitcoin
shared.sellBitcoin=Sell bitcoin
shared.buy=buy
shared.sell=sell
shared.spend=spend
@ -23,7 +23,7 @@ validation.zero=Input of 0 is not allowed.
validation.negative=A negative value is not allowed.
validation.fiat.toSmall=Input smaller as minimum possible amount is not allowed.
validation.fiat.toLarge=Input larger as maximum possible amount is not allowed.
validation.btc.toSmall=Input results in a Bitcoin value with a fraction of the smallest unit (Satoshi).
validation.btc.toSmall=Input results in a bitcoin value with a fraction of the smallest unit (Satoshi).
validation.btc.toLarge=Input larger as maximum trading amount of {0} is not allowed.
validation.passwordTooShort=The password you entered is too short. It needs to have min. 8 characters.
@ -34,27 +34,27 @@ createOffer.volume.prompt=Enter amount in {0}
createOffer.minAmount.prompt=Enter min. amount
createOffer.amountPriceBox.title=Create your offer
createOffer.amountPriceBox.amountDescription=Amount of Bitcoin to {0}
createOffer.amountPriceBox.priceDescription=Price per Bitcoin in {0}
createOffer.amountPriceBox.amountDescription=Amount of bitcoin to {0}
createOffer.amountPriceBox.priceDescription=Price per bitcoin in {0}
createOffer.amountPriceBox.buy.volumeDescription=Amount in {0} to spend
createOffer.amountPriceBox.sell.volumeDescription=Amount in {0} to receive
createOffer.amountPriceBox.minAmountDescription=Minimum amount of Bitcoin
createOffer.amountPriceBox.buy.info=Define a price for which you want to buy Bitcoin and either enter the amount or the trade volume. With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the offerbook once a trader has taken your offer.
createOffer.amountPriceBox.sell.info=Define a price for which you want to sell Bitcoin and either enter the amount or the trade volume. With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the offerbook once a trader has taken your offer.
createOffer.amountPriceBox.minAmountDescription=Minimum amount of bitcoin
createOffer.amountPriceBox.buy.info=Define a price for which you want to buy bitcoin and either enter the amount or the trade volume. With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the offerbook once a trader has taken your offer.
createOffer.amountPriceBox.sell.info=Define a price for which you want to sell bitcoin and either enter the amount or the trade volume. With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the offerbook once a trader has taken your offer.
createOffer.amountPriceBox.next=Next step
createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places.\nThe amount has been adjusted to 4 decimal places.
createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places. The amount has been adjusted to 2 decimal places.
createOffer.amountPriceBox.warning.adjustedVolume=The total volume you have entered leads to invalid fractional Bitcoin amounts. The amount has been adjusted and a new total volume be calculated from it.
createOffer.amountPriceBox.warning.adjustedVolume=The total volume you have entered leads to invalid fractional bitcoin amounts. The amount has been adjusted and a new total volume be calculated from it.
createOffer.amountPriceBox.error.message=An error occurred when placing the offer:\n\n{0}
createOffer.validation.amountSmallerThanMinAmount=Amount cannot be smaller than minimum amount.
createOffer.validation.minAmountLargerThanAmount=Minimum amount cannot be larger than amount.
createOffer.fundsBox.title=Fund your trade wallet
createOffer.fundsBox.totalsNeeded=Funds needed for that trade:
createOffer.fundsBox.totalsNeeded.prompt=Will be calculated from the Bitcoin amount entered above
createOffer.fundsBox.totalsNeeded.prompt=Will be calculated from the bitcoin amount entered above
createOffer.fundsBox.address=Trade wallet address:
createOffer.fundsBox.balance=Trade wallet balance:
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
createOffer.fundsBox.tradeAmount=Trade amount:
createOffer.fundsBox.securityDeposit=Security deposit:
createOffer.fundsBox.offerFee=Offer fee:
@ -88,15 +88,15 @@ takeOffer.volume.prompt=Enter amount in {0}
takeOffer.minAmount.prompt=Enter min. amount
takeOffer.amountPriceBox.title=Take offer
takeOffer.amountPriceBox.subTitle=Buy Bitcoin
takeOffer.amountPriceBox.buy.amountDescription=Amount of Bitcoin to sell
takeOffer.amountPriceBox.sell.amountDescription=Amount of Bitcoin to buy
takeOffer.amountPriceBox.priceDescription=Price per Bitcoin in {0}
takeOffer.amountPriceBox.subTitle=Buy bitcoin
takeOffer.amountPriceBox.buy.amountDescription=Amount of bitcoin to sell
takeOffer.amountPriceBox.sell.amountDescription=Amount of bitcoin to buy
takeOffer.amountPriceBox.priceDescription=Price per bitcoin in {0}
takeOffer.amountPriceBox.buy.volumeDescription=Receiving amount in {0}
takeOffer.amountPriceBox.sell.volumeDescription=Amount in {0} to spend
takeOffer.amountPriceBox.amountRangeDescription=Possible amount range
takeOffer.amountPriceBox.buy.info=Enter the amount of Bitcoin you want to sell. You can choose an amount between the minimum amount and the amount.
takeOffer.amountPriceBox.sell.info=Enter the amount of Bitcoin you want to buy. You can choose an amount between the minimum amount and the amount.
takeOffer.amountPriceBox.buy.info=Enter the amount of bitcoin you want to sell. You can choose an amount between the minimum amount and the amount.
takeOffer.amountPriceBox.sell.info=Enter the amount of bitcoin you want to buy. You can choose an amount between the minimum amount and the amount.
takeOffer.amountPriceBox.next=Next step
takeOffer.amountPriceBox.warning.invalidBtcDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places.\nThe amount has been adjusted to 4 decimal places.
takeOffer.validation.amountSmallerThanMinAmount=Amount cannot be smaller than minimum amount defined in the offer.
@ -105,13 +105,13 @@ takeOffer.validation.amountLargerThanOfferAmount=Input amount cannot be higher t
takeOffer.fundsBox.title=Fund your trade wallet
takeOffer.fundsBox.isOfferAvailable=Check if offer is available...
takeOffer.fundsBox.totalsNeeded=Funds needed for that trade:
takeOffer.fundsBox.totalsNeeded.prompt=Will be calculated from the Bitcoin amount entered above
takeOffer.fundsBox.totalsNeeded.prompt=Will be calculated from the bitcoin amount entered above
takeOffer.fundsBox.address=Trade wallet address:
takeOffer.fundsBox.balance=Trade wallet balance:
takeOffer.fundsBox.buy.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those \
funds will be paid in to a locked deposit address. At the end of a successful trade you will get back your security deposit and the Bitcoin amount you sold will be transferred to the \
takeOffer.fundsBox.buy.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary bitcoin amount. Those \
funds will be paid in to a locked deposit address. At the end of a successful trade you will get back your security deposit and the bitcoin amount you sold will be transferred to the \
buyer.
takeOffer.fundsBox.sell.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those \
takeOffer.fundsBox.sell.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary bitcoin amount. Those \
funds will be paid in to a locked deposit address. At the end of a successful trade you will get back your security deposit.
takeOffer.fundsBox.tradeAmount=Amount to sell:
takeOffer.fundsBox.securityDeposit=Security deposit:
@ -135,7 +135,7 @@ takeOffer.advancedBox.info=These are the offer restrictions your trading partner
settings are matching those constraints and you are able to trade with him.
takeOffer.success.headline=Your have successfully published the deposit.
takeOffer.success.info=You need to wait now for the Bitcoin buyer to transfer the money to you. \nYou will get a \
takeOffer.success.info=You need to wait now for the bitcoin buyer to transfer the money to you. \nYou will get a \
notification when he has started the EUR payment. You can see the status of your trade in the \"Portfolio\" screen \
under \"Open trades\".
takeOffer.error.message=An error occurred when taking the offer.\n\n{0}

View File

@ -11,7 +11,7 @@ public final class SealedAndSignedMessage implements MailboxMessage {
// That object is sent over the wire, so we need to take care of version compatibility.
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public final SealedAndSigned sealedAndSigned;
public final byte[] addressPrefixHash;

View File

@ -116,7 +116,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
if (persistedOnionAddress != null)
this.myOnionAddress = persistedOnionAddress;
seedNodeAddresses = seedNodesRepository.geSeedNodeAddresses(useLocalhost, networkId);
seedNodeAddresses = seedNodesRepository.getSeedNodeAddresses(useLocalhost, networkId);
// network node
networkNode = useLocalhost ? new LocalhostNetworkNode(port) : new TorNetworkNode(port, torDir);

View File

@ -30,7 +30,7 @@ public class SeedNodeP2PService extends P2PService {
@Override
protected PeerManager getNewPeerManager() {
return new SeedNodePeerManager(networkNode, storageDir);
return new SeedNodePeerManager(networkNode);
}
@Override

View File

@ -26,7 +26,7 @@ public final class DecryptedMsgWithPubKey implements MailMessage {
// That object is sent over the wire, so we need to take care of version compatibility.
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public final Message message;
public final PublicKey signaturePubKey;

View File

@ -552,7 +552,7 @@ public class Connection implements MessageListener {
}
Message message = (Message) serializable;
if (message.networkId() != Version.NETWORK_ID) {
if (message.networkId() != Version.getNetworkId()) {
sharedSpace.reportIllegalRequest(IllegalRequest.WrongNetworkId);
return;
}

View File

@ -5,7 +5,7 @@ public enum IllegalRequest {
MaxSizeExceeded(1),
NotAuthenticated(1),
InvalidDataType(1),
WrongNetworkId(1);
WrongNetworkId(0);
public final int maxTolerance;

View File

@ -8,7 +8,7 @@ public final class CloseConnectionMessage implements Message {
// That object is sent over the wire, so we need to take care of version compatibility.
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public Address peerAddress;
public CloseConnectionMessage() {

View File

@ -60,7 +60,8 @@ public class PeerManager implements MessageListener, ConnectionListener {
private final NetworkNode networkNode;
private final PeerExchangeManager peerExchangeManager;
protected final ScheduledThreadPoolExecutor checkSeedNodeConnectionExecutor;
private final Storage<HashSet<ReportedPeer>> dbStorage;
@Nullable
private Storage<HashSet<ReportedPeer>> dbStorage;
private final CopyOnWriteArraySet<AuthenticationListener> authenticationListeners = new CopyOnWriteArraySet<>();
protected final Map<Address, Peer> authenticatedPeers = new HashMap<>();
@ -80,7 +81,7 @@ public class PeerManager implements MessageListener, ConnectionListener {
Log.traceCall();
this.networkNode = networkNode;
dbStorage = new Storage<>(storageDir);
createDbStorage(storageDir);
peerExchangeManager = new PeerExchangeManager(networkNode,
() -> getAuthenticatedAndReportedPeers(),
@ -92,10 +93,18 @@ public class PeerManager implements MessageListener, ConnectionListener {
init();
}
protected void createDbStorage(File storageDir) {
dbStorage = new Storage<>(storageDir);
}
private void init() {
networkNode.addMessageListener(this);
networkNode.addConnectionListener(this);
initPersistedPeers();
}
protected void initPersistedPeers() {
HashSet<ReportedPeer> persistedPeers = dbStorage.initAndGetPersisted("persistedPeers");
if (persistedPeers != null) {
log.info("We have persisted reported peers. " +
@ -712,7 +721,9 @@ public class PeerManager implements MessageListener, ConnectionListener {
ReportedPeer reportedPeer = new ReportedPeer(peerAddress);
if (persistedPeers.contains(reportedPeer)) {
persistedPeers.remove(reportedPeer);
dbStorage.queueUpForSave(persistedPeers, 5000);
if (dbStorage != null)
dbStorage.queueUpForSave(persistedPeers, 5000);
}
}
@ -885,7 +896,9 @@ public class PeerManager implements MessageListener, ConnectionListener {
persistedPeers.remove(list.get(i));
}
}
dbStorage.queueUpForSave(persistedPeers);
if (dbStorage != null)
dbStorage.queueUpForSave(persistedPeers);
}
printReportedPeers();

View File

@ -15,8 +15,9 @@ import static com.google.common.base.Preconditions.checkArgument;
public class SeedNodePeerManager extends PeerManager {
private static final Logger log = LoggerFactory.getLogger(SeedNodePeerManager.class);
public SeedNodePeerManager(NetworkNode networkNode, File storageDir) {
super(networkNode, storageDir);
public SeedNodePeerManager(NetworkNode networkNode) {
super(networkNode, null);
}
public void authenticateToSeedNode() {
@ -32,6 +33,17 @@ public class SeedNodePeerManager extends PeerManager {
startCheckSeedNodeConnectionTask();
}
@Override
protected void createDbStorage(File storageDir) {
// Do nothing.
// The seed node does not store persisted peers in the local db
}
@Override
protected void initPersistedPeers() {
// Do nothing.
// The seed node does not store persisted peers in the local db
}
@Override
protected void onFirstSeedNodeAuthenticated() {
@ -70,5 +82,5 @@ public class SeedNodePeerManager extends PeerManager {
}
}
}

View File

@ -5,7 +5,7 @@ import io.bitsquare.p2p.Address;
import io.bitsquare.p2p.Message;
public abstract class AuthenticationMessage implements Message {
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public final Address senderAddress;

View File

@ -7,7 +7,7 @@ public final class DataRequest implements Message {
// That object is sent over the wire, so we need to take care of version compatibility.
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public DataRequest() {
}

View File

@ -9,7 +9,7 @@ import java.util.HashSet;
public final class DataResponse implements Message {
// That object is sent over the wire, so we need to take care of version compatibility.
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public final HashSet<ProtectedData> set;

View File

@ -4,7 +4,7 @@ import io.bitsquare.app.Version;
import io.bitsquare.p2p.Message;
public abstract class PeerExchangeMessage implements Message {
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
@Override
public int networkId() {

View File

@ -60,7 +60,7 @@ public class SeedNode {
int networkId = Integer.parseInt(arg1);
checkArgument(networkId > -1 && networkId < 3,
"networkId out of scope (Mainnet = 0, TestNet = 1, Regtest = 2)");
Version.NETWORK_ID = networkId;
Version.setNetworkId(networkId);
if (args.length > 2) {
String arg2 = args[2];
int maxConnections = Integer.parseInt(arg2);
@ -100,7 +100,7 @@ public class SeedNode {
}
public void createAndStartP2PService(boolean useDetailedLogging) {
createAndStartP2PService(mySeedNodeAddress, useLocalhost, Version.NETWORK_ID, useDetailedLogging, progArgSeedNodes, null);
createAndStartP2PService(mySeedNodeAddress, useLocalhost, Version.getNetworkId(), useDetailedLogging, progArgSeedNodes, null);
}
@VisibleForTesting

View File

@ -49,7 +49,7 @@ public class SeedNodesRepository {
new Address("localhost:4002")
);
public Set<Address> geSeedNodeAddresses(boolean useLocalhost, int networkId) {
public Set<Address> getSeedNodeAddresses(boolean useLocalhost, int networkId) {
String networkIdAsString = String.valueOf(networkId);
Set<Address> addresses = useLocalhost ? localhostSeedNodeAddresses : torSeedNodeAddresses;
Set<Address> filtered = addresses.stream()

View File

@ -4,7 +4,7 @@ import io.bitsquare.app.Version;
import io.bitsquare.p2p.Message;
public abstract class DataBroadcastMessage implements Message {
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
@Override
public int networkId() {

View File

@ -81,7 +81,7 @@ public class EncryptionServiceTests {
final class TestMessage implements MailboxMessage {
public String data = "test";
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public TestMessage(String data) {
this.data = data;

View File

@ -6,7 +6,7 @@ import io.bitsquare.p2p.messaging.MailboxMessage;
import io.bitsquare.p2p.storage.data.ExpirablePayload;
public final class MockMailboxMessage implements MailboxMessage, ExpirablePayload {
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public String msg;
public Address senderAddress;
public long ttl;

View File

@ -7,7 +7,7 @@ import io.bitsquare.p2p.storage.data.ExpirablePayload;
public final class MockMessage implements Message, ExpirablePayload {
public String msg;
public long ttl;
private final int networkId = Version.NETWORK_ID;
private final int networkId = Version.getNetworkId();
public MockMessage(String msg) {
this.msg = msg;

View File

@ -12,6 +12,7 @@ mvn clean package -DskipTests -Dmaven.javadoc.skip=true
cp gui/target/shaded.jar "gui/deploy/Bitsquare-$fullVersion.jar"
cp gui/target/shaded.jar "/Users/mk/vm_shared_ubuntu/Bitsquare-$fullVersion.jar"
cp gui/target/shaded.jar "/Users/mk/vm_shared_windows/Bitsquare-$fullVersion.jar"
cp seednode/target/SeedNode.jar "gui/deploy/SeedNode.jar"
$JAVA_HOME/bin/javapackager \
-deploy \