From 587b55d37bb04a943b55642eba0b19f1e3b05d46 Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Wed, 20 Nov 2019 15:28:52 +0200 Subject: [PATCH] Fix typos and cleanup --- .../account/sign/SignedWitnessService.java | 2 +- .../account/witness/AccountAgeWitness.java | 2 +- .../witness/AccountAgeWitnessService.java | 4 +-- .../java/bisq/core/app/BisqExecutable.java | 2 +- .../main/java/bisq/core/app/BisqSetup.java | 6 ++-- .../main/java/bisq/core/app/SetupUtils.java | 2 +- .../java/bisq/core/btc/BitcoinModule.java | 2 +- .../bisq/core/btc/model/AddressEntry.java | 4 +-- .../bisq/core/btc/model/AddressEntryList.java | 2 +- .../core/btc/wallet/BisqRiskAnalysis.java | 2 +- .../bisq/core/btc/wallet/BsqCoinSelector.java | 2 +- .../core/btc/wallet/BsqWalletService.java | 2 +- .../bisq/core/btc/wallet/BtcCoinSelector.java | 2 +- .../core/btc/wallet/BtcWalletService.java | 12 ++++---- .../core/btc/wallet/NonBsqCoinSelector.java | 2 +- .../core/btc/wallet/TradeWalletService.java | 14 ++++----- .../bisq/core/btc/wallet/TxBroadcaster.java | 4 +-- .../bisq/core/btc/wallet/WalletService.java | 6 ++-- .../bisq/core/btc/wallet/WalletsManager.java | 2 +- .../main/java/bisq/core/dao/DaoFacade.java | 6 ++-- .../blindvote/VoteWithProposalTxIdList.java | 4 +-- .../MyBondedReputationRepository.java | 4 +-- .../bond/role/BondedRolesRepository.java | 2 +- .../dao/governance/merit/MeritConsensus.java | 6 ++-- .../bisq/core/dao/governance/param/Param.java | 4 +-- .../proposal/BaseProposalFactory.java | 2 +- .../proposal/ProposalListPresentation.java | 2 +- .../governance/proposal/ProposalService.java | 4 +-- .../removeAsset/RemoveAssetValidator.java | 2 +- .../voteresult/VoteResultConsensus.java | 2 +- .../voteresult/VoteResultService.java | 4 +-- .../votereveal/VoteRevealService.java | 6 ++-- .../BlindVoteStateMonitoringService.java | 2 +- .../monitoring/DaoStateMonitoringService.java | 4 +-- .../ProposalStateMonitoringService.java | 2 +- .../main/java/bisq/core/dao/node/BsqNode.java | 8 ++--- .../bisq/core/dao/node/full/FullNode.java | 4 +-- .../bisq/core/dao/node/full/RpcService.java | 2 +- .../full/network/GetBlocksRequestHandler.java | 2 +- .../lite/network/RequestBlocksHandler.java | 6 ++-- .../core/dao/node/parser/BlockParser.java | 4 +-- .../bisq/core/dao/node/parser/TempTx.java | 2 +- .../core/dao/node/parser/TxOutputParser.java | 18 +++++------ .../bisq/core/dao/node/parser/TxParser.java | 4 +-- .../bisq/core/dao/state/DaoStateService.java | 6 ++-- .../dao/state/DaoStateStorageService.java | 2 +- .../bisq/core/dao/state/model/DaoState.java | 2 +- .../state/model/blockchain/BaseTxOutput.java | 2 +- .../dao/state/model/blockchain/TxType.java | 2 +- .../model/governance/BondedRoleType.java | 4 +-- .../dao/state/model/governance/DaoPhase.java | 2 +- .../core/dao/state/model/governance/Role.java | 2 +- ...UnconfirmedBsqChangeOutputListService.java | 6 ++-- .../unconfirmed/UnconfirmedTxOutput.java | 4 +-- .../main/java/bisq/core/filter/Filter.java | 4 +-- .../java/bisq/core/filter/FilterManager.java | 4 +-- .../main/java/bisq/core/locale/BankUtil.java | 30 +++++++++---------- .../java/bisq/core/locale/CurrencyTuple.java | 2 +- .../java/bisq/core/locale/CurrencyUtil.java | 4 +-- .../java/bisq/core/locale/GlobalSettings.java | 2 +- core/src/main/java/bisq/core/locale/Res.java | 4 +-- .../core/monetary/AltcoinExchangeRate.java | 2 +- .../bisq/core/notifications/MobileModel.java | 2 +- .../alerts/price/PriceAlert.java | 2 +- .../bisq/core/offer/OfferBookService.java | 2 +- .../java/bisq/core/offer/OfferPayload.java | 4 +-- .../main/java/bisq/core/offer/OfferUtil.java | 8 ++--- .../bisq/core/offer/OpenOfferManager.java | 12 ++++---- .../messages/OfferAvailabilityRequest.java | 2 +- .../core/offer/messages/OfferMessage.java | 2 +- .../offer/placeoffer/tasks/ValidateOffer.java | 6 ++-- .../bisq/core/payment/PaymentAccountUtil.java | 2 +- .../java/bisq/core/payment/TradeLimits.java | 4 +-- .../java/bisq/core/support/SupportType.java | 2 +- .../core/support/dispute/DisputeManager.java | 2 +- .../dispute/agent/DisputeAgentService.java | 2 +- .../arbitration/ArbitrationManager.java | 4 +-- .../support/traderchat/TraderChatManager.java | 2 +- core/src/main/java/bisq/core/trade/Trade.java | 6 ++-- .../trade/protocol/SellerAsMakerProtocol.java | 4 +-- .../trade/protocol/SellerAsTakerProtocol.java | 4 +-- .../tasks/PublishTradeStatistics.java | 2 +- .../buyer/BuyerVerifiesDelayedPayoutTx.java | 2 +- .../main/java/bisq/core/user/Preferences.java | 4 +-- .../java/bisq/core/util/ParsingUtils.java | 2 +- .../bisq/core/util/coin/BsqFormatter.java | 6 ++-- .../java/bisq/core/offer/OfferUtilTest.java | 2 +- 87 files changed, 177 insertions(+), 177 deletions(-) diff --git a/core/src/main/java/bisq/core/account/sign/SignedWitnessService.java b/core/src/main/java/bisq/core/account/sign/SignedWitnessService.java index e32061766df..61050581760 100644 --- a/core/src/main/java/bisq/core/account/sign/SignedWitnessService.java +++ b/core/src/main/java/bisq/core/account/sign/SignedWitnessService.java @@ -100,7 +100,7 @@ public void onAllServicesInitialized() { addToMap((SignedWitness) payload); }); - // At startup the P2PDataStorage initializes earlier, otherwise we ge the listener called. + // At startup the P2PDataStorage initializes earlier, otherwise we get the listener called. p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap().values().forEach(e -> { if (e instanceof SignedWitness) addToMap((SignedWitness) e); diff --git a/core/src/main/java/bisq/core/account/witness/AccountAgeWitness.java b/core/src/main/java/bisq/core/account/witness/AccountAgeWitness.java index 76afa35807a..9578df22973 100644 --- a/core/src/main/java/bisq/core/account/witness/AccountAgeWitness.java +++ b/core/src/main/java/bisq/core/account/witness/AccountAgeWitness.java @@ -87,7 +87,7 @@ public static AccountAgeWitness fromProto(protobuf.AccountAgeWitness proto) { @Override public boolean isDateInTolerance(Clock clock) { - // We don't allow older or newer then 1 day. + // We don't allow older or newer than 1 day. // Preventing forward dating is also important to protect against a sophisticated attack return Math.abs(new Date().getTime() - date) <= TOLERANCE; } diff --git a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java index 9bc2d7b38db..e4beb2d7583 100644 --- a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java +++ b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java @@ -154,7 +154,7 @@ public void onAllServicesInitialized() { addToMap((AccountAgeWitness) payload); }); - // At startup the P2PDataStorage initializes earlier, otherwise we ge the listener called. + // At startup the P2PDataStorage initializes earlier, otherwise we get the listener called. p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap().values().forEach(e -> { if (e instanceof AccountAgeWitness) addToMap((AccountAgeWitness) e); @@ -522,7 +522,7 @@ boolean isDateAfterReleaseDate(long witnessDateAsLong, private boolean verifyPeersCurrentDate(Date peersCurrentDate, ErrorMessageHandler errorMessageHandler) { final boolean result = Math.abs(peersCurrentDate.getTime() - new Date().getTime()) <= TimeUnit.DAYS.toMillis(1); if (!result) { - final String msg = "Peers current date is further then 1 day off to our current date. " + + final String msg = "Peers current date is further than 1 day off to our current date. " + "PeersCurrentDate=" + peersCurrentDate + "; myCurrentDate=" + new Date(); log.warn(msg); errorMessageHandler.handleErrorMessage(msg); diff --git a/core/src/main/java/bisq/core/app/BisqExecutable.java b/core/src/main/java/bisq/core/app/BisqExecutable.java index 337dc8a885d..6a8be7955e4 100644 --- a/core/src/main/java/bisq/core/app/BisqExecutable.java +++ b/core/src/main/java/bisq/core/app/BisqExecutable.java @@ -168,7 +168,7 @@ protected void setupEnvironment(OptionSet options) { * The parsing is done when the actual value is going to be retrieved, i.e. options.valueOf(attributename). * * In order to keep usability high, we work around the aforementioned characteristics by catching the exception below - * (valueOf is called somewhere in getBisqEnvironment), thus, neatly inform the user of a ill-formed parameter and stop execution. + * (valueOf is called somewhere in getBisqEnvironment), thus, neatly inform the user of an ill-formed parameter and stop execution. * * Might be changed when the project features more user parameters meant for the user. */ diff --git a/core/src/main/java/bisq/core/app/BisqSetup.java b/core/src/main/java/bisq/core/app/BisqSetup.java index 0bdc9960bd5..4520b74d05a 100644 --- a/core/src/main/java/bisq/core/app/BisqSetup.java +++ b/core/src/main/java/bisq/core/app/BisqSetup.java @@ -501,7 +501,7 @@ private void checkCryptoSetup() { // We want to test if the client is compiled with the correct crypto provider (BountyCastle) // and if the unlimited Strength for cryptographic keys is set. // If users compile themselves they might miss that step and then would get an exception in the trade. - // To avoid that we add here at startup a sample encryption and signing to see if it don't causes an exception. + // To avoid that we add a sample encryption and signing here at startup to see if it doesn't cause an exception. // See: https://github.com/bisq-network/exchange/blob/master/doc/build.md#7-enable-unlimited-strength-for-cryptographic-keys new Thread(() -> { try { @@ -780,13 +780,13 @@ private void initDomainServices() { if (filter != null && filterWarningHandler != null) { if (filter.getSeedNodes() != null && !filter.getSeedNodes().isEmpty()) { log.warn(Res.get("popup.warning.nodeBanned", Res.get("popup.warning.seed"))); - // Lets keep that more silent. Might be used in case a node is unstable and we don't want to confuse users. + // Let's keep that more silent. Might be used in case a node is unstable and we don't want to confuse users. // filterWarningHandler.accept(Res.get("popup.warning.nodeBanned", Res.get("popup.warning.seed"))); } if (filter.getPriceRelayNodes() != null && !filter.getPriceRelayNodes().isEmpty()) { log.warn(Res.get("popup.warning.nodeBanned", Res.get("popup.warning.priceRelay"))); - // Lets keep that more silent. Might be used in case a node is unstable and we don't want to confuse users. + // Let's keep that more silent. Might be used in case a node is unstable and we don't want to confuse users. // filterWarningHandler.accept(Res.get("popup.warning.nodeBanned", Res.get("popup.warning.priceRelay"))); } diff --git a/core/src/main/java/bisq/core/app/SetupUtils.java b/core/src/main/java/bisq/core/app/SetupUtils.java index 0edf297d2c7..3d2c7edd937 100644 --- a/core/src/main/java/bisq/core/app/SetupUtils.java +++ b/core/src/main/java/bisq/core/app/SetupUtils.java @@ -47,7 +47,7 @@ public static void checkCryptoSetup(KeyRing keyRing, EncryptionService encryptio // We want to test if the client is compiled with the correct crypto provider (BountyCastle) // and if the unlimited Strength for cryptographic keys is set. // If users compile themselves they might miss that step and then would get an exception in the trade. - // To avoid that we add here at startup a sample encryption and signing to see if it don't causes an exception. + // To avoid that we add a sample encryption and signing here at startup to see if it doesn't cause an exception. // See: https://github.com/bisq-network/exchange/blob/master/doc/build.md#7-enable-unlimited-strength-for-cryptographic-keys Thread checkCryptoThread = new Thread(() -> { try { diff --git a/core/src/main/java/bisq/core/btc/BitcoinModule.java b/core/src/main/java/bisq/core/btc/BitcoinModule.java index 8361e0a4304..2c1f8ce2dfe 100644 --- a/core/src/main/java/bisq/core/btc/BitcoinModule.java +++ b/core/src/main/java/bisq/core/btc/BitcoinModule.java @@ -54,7 +54,7 @@ public BitcoinModule(Environment environment) { @Override protected void configure() { - // If we we have selected BTC_DAO_REGTEST or BTC_DAO_TESTNET we use our master regtest node, + // If we have selected BTC_DAO_REGTEST or BTC_DAO_TESTNET we use our master regtest node, // otherwise the specified host or default (localhost) String regTestHost = environment.getProperty(BtcOptionKeys.REG_TEST_HOST, String.class, ""); if (regTestHost.isEmpty()) { diff --git a/core/src/main/java/bisq/core/btc/model/AddressEntry.java b/core/src/main/java/bisq/core/btc/model/AddressEntry.java index eb8512a9b6d..3d0acb12569 100644 --- a/core/src/main/java/bisq/core/btc/model/AddressEntry.java +++ b/core/src/main/java/bisq/core/btc/model/AddressEntry.java @@ -42,7 +42,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** - * Every trade use a addressEntry with a dedicated address for all transactions related to the trade. + * Every trade uses a addressEntry with a dedicated address for all transactions related to the trade. * That way we have a kind of separated trade wallet, isolated from other transactions and avoiding coin merge. * If we would not avoid coin merge the user would lose privacy between trades. */ @@ -60,7 +60,7 @@ public enum Context { // keyPair can be null in case the object is created from deserialization as it is transient. // It will be restored when the wallet is ready at setDeterministicKey - // So after startup it never must be null + // So after startup it must never be null @Nullable @Getter diff --git a/core/src/main/java/bisq/core/btc/model/AddressEntryList.java b/core/src/main/java/bisq/core/btc/model/AddressEntryList.java index 52926ab6aef..867474132e7 100644 --- a/core/src/main/java/bisq/core/btc/model/AddressEntryList.java +++ b/core/src/main/java/bisq/core/btc/model/AddressEntryList.java @@ -111,7 +111,7 @@ public void onWalletReady(Wallet wallet) { add(new AddressEntry(wallet.freshReceiveKey(), AddressEntry.Context.ARBITRATOR)); // In case we restore from seed words and have balance we need to add the relevant addresses to our list. - // IssuedReceiveAddresses does not contain all addressed where we expect balance so we need to listen to + // IssuedReceiveAddresses does not contain all addresses where we expect balance so we need to listen to // incoming txs at blockchain sync to add the rest. if (wallet.getBalance().isPositive()) { wallet.getIssuedReceiveAddresses().forEach(address -> { diff --git a/core/src/main/java/bisq/core/btc/wallet/BisqRiskAnalysis.java b/core/src/main/java/bisq/core/btc/wallet/BisqRiskAnalysis.java index dfd81746c92..e419a6a23db 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BisqRiskAnalysis.java +++ b/core/src/main/java/bisq/core/btc/wallet/BisqRiskAnalysis.java @@ -60,7 +60,7 @@ // override it. // The changes to DefaultRiskAnalysis are: removal of the RBF check and accept as standard an OP_RETURN outputs // with 0 value. -// For Bisq's use cases RBF is not considered risky. Requiring a confirmation for RBF payments from a users +// For Bisq's use cases RBF is not considered risky. Requiring a confirmation for RBF payments from a user's // external wallet to Bisq would hurt usability. The trade transaction requires anyway a confirmation and we don't see // a use case where a Bisq user accepts unconfirmed payment from untrusted peers and would not wait anyway for at least // one confirmation. diff --git a/core/src/main/java/bisq/core/btc/wallet/BsqCoinSelector.java b/core/src/main/java/bisq/core/btc/wallet/BsqCoinSelector.java index 72e3b1af347..838a388a3fc 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BsqCoinSelector.java +++ b/core/src/main/java/bisq/core/btc/wallet/BsqCoinSelector.java @@ -61,7 +61,7 @@ protected boolean isTxOutputSpendable(TransactionOutput output) { if (daoStateService.getTxOutput(new TxOutputKey(parentTransaction.getHashAsString(), output.getIndex())).isPresent()) return false; - // Only if its not existing yet in the dao state (unconfirmed) we use our unconfirmedBsqChangeOutputList to + // Only if it's not existing yet in the dao state (unconfirmed) we use our unconfirmedBsqChangeOutputList to // check if it is an own change output. return unconfirmedBsqChangeOutputListService.hasTransactionOutput(output); } diff --git a/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java index a6eff3e1de6..22cdb9ce6b5 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java @@ -613,7 +613,7 @@ public Transaction getPreparedBurnFeeTxForAssetListing(Coin fee) throws Insuffic // We need to require one BSQ change output as we could otherwise not be able to distinguish between 2 // structurally same transactions where only the BSQ fee is different. In case of asset listing fee and proof of - // burn it is a user input, so it is not know to the parser, instead we derive the burned fee from the parser. + // burn it is a user input, so it is not known to the parser, instead we derive the burned fee from the parser. // In case of proposal fee we could derive it from the params. diff --git a/core/src/main/java/bisq/core/btc/wallet/BtcCoinSelector.java b/core/src/main/java/bisq/core/btc/wallet/BtcCoinSelector.java index 5eaf88d86fa..f0df0adb35d 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BtcCoinSelector.java +++ b/core/src/main/java/bisq/core/btc/wallet/BtcCoinSelector.java @@ -69,7 +69,7 @@ protected boolean isTxOutputSpendable(TransactionOutput output) { } } - // We ignore utxos which are considered dust attacks for spying on users wallets. + // We ignore utxos which are considered dust attacks for spying on users' wallets. // The ignoreDustThreshold value is set in the preferences. If not set we use default non dust // value of 546 sat. @Override diff --git a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java index 50d93c27160..ce5d2433ab4 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java @@ -408,13 +408,13 @@ public Transaction completePreparedSendBsqTx(Transaction preparedBsqTx, boolean TransactionVerificationException, WalletException, InsufficientMoneyException { // preparedBsqTx has following structure: // inputs [1-n] BSQ inputs - // outputs [1] BSQ receivers output + // outputs [1] BSQ receiver's output // outputs [0-1] BSQ change output // We add BTC mining fee. Result tx looks like: // inputs [1-n] BSQ inputs // inputs [1-n] BTC inputs - // outputs [1] BSQ receivers output + // outputs [1] BSQ receiver's output // outputs [0-1] BSQ change output // outputs [0-1] BTC change output // mining fee: BTC mining fee @@ -426,14 +426,14 @@ public Transaction completePreparedBsqTx(Transaction preparedBsqTx, boolean useC // preparedBsqTx has following structure: // inputs [1-n] BSQ inputs - // outputs [1] BSQ receivers output + // outputs [1] BSQ receiver's output // outputs [0-1] BSQ change output // mining fee: optional burned BSQ fee (only if opReturnData != null) // We add BTC mining fee. Result tx looks like: // inputs [1-n] BSQ inputs // inputs [1-n] BTC inputs - // outputs [0-1] BSQ receivers output + // outputs [0-1] BSQ receiver's output // outputs [0-1] BSQ change output // outputs [0-1] BTC change output // outputs [0-1] OP_RETURN with opReturnData (only if opReturnData != null) @@ -672,7 +672,7 @@ public void resetAddressEntriesForOpenOffer(String offerId) { public void resetAddressEntriesForPendingTrade(String offerId) { swapTradeEntryToAvailableEntry(offerId, AddressEntry.Context.MULTI_SIG); - // We swap also TRADE_PAYOUT to be sure all is cleaned up. There might be cases where a user cannot send the funds + // We swap also TRADE_PAYOUT to be sure all is cleaned up. There might be cases where a user cannot send the funds // to an external wallet directly in the last step of the trade, but the funds are in the Bisq wallet anyway and // the dealing with the external wallet is pure UI thing. The user can move the funds to the wallet and then // send out the funds to the external wallet. As this cleanup is a rare situation and most users do not use @@ -1110,7 +1110,7 @@ private SendRequest getSendRequestForMultipleAddresses(Set fromAddresses return sendRequest; } - // We ignore utxos which are considered dust attacks for spying on users wallets. + // We ignore utxos which are considered dust attacks for spying on users' wallets. // The ignoreDustThreshold value is set in the preferences. If not set we use default non dust // value of 546 sat. @Override diff --git a/core/src/main/java/bisq/core/btc/wallet/NonBsqCoinSelector.java b/core/src/main/java/bisq/core/btc/wallet/NonBsqCoinSelector.java index ae9bdb6eca5..09c0c9376c4 100644 --- a/core/src/main/java/bisq/core/btc/wallet/NonBsqCoinSelector.java +++ b/core/src/main/java/bisq/core/btc/wallet/NonBsqCoinSelector.java @@ -49,7 +49,7 @@ protected boolean isTxOutputSpendable(TransactionOutput output) { if (parentTransaction == null) return false; - // It is important to not allow pending txs as otherwise unconfirmed BSQ txs would considered nonBSQ as + // It is important to not allow pending txs as otherwise unconfirmed BSQ txs would be considered nonBSQ as // below outputIsNotInBsqState would be true. if (parentTransaction.getConfidence().getConfidenceType() != TransactionConfidence.ConfidenceType.BUILDING) return false; diff --git a/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java b/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java index e0c57058548..0c05bb77a3c 100644 --- a/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java @@ -206,7 +206,7 @@ public Transaction completeBsqTradingFeeTx(Transaction preparedBsqTx, // outputs [0-1] BTC change output // mining fee: BTC mining fee + burned BSQ fee - // In case of txs for burned BSQ fees we have no receiver output and it might be that there is no change outputs + // In case of txs for burned BSQ fees we have no receiver output and it might be that there are no change outputs // We need to guarantee that min. 1 valid output is added (OP_RETURN does not count). So we use a higher input // for BTC to force an additional change output. @@ -273,7 +273,7 @@ public Transaction completeBsqTradingFeeTx(Transaction preparedBsqTx, // We construct the deposit transaction in the way that the buyer is always the first entry (inputs, outputs, MS keys) and then the seller. // In the creation of the deposit tx the taker/maker roles are the determining roles instead of buyer/seller. - // In the payout tx is is the buyer/seller role. We keep the buyer/seller ordering over all transactions to not get confusion with ordering, + // In the payout tx it is the buyer/seller role. We keep the buyer/seller ordering over all transactions to not get confusion with ordering, // which is important to follow correctly specially for the order of the MS keys. @@ -437,7 +437,7 @@ private PreparedDepositTxAndMakerInputs makerCreatesDepositTx(boolean makerIsBuy List makerInputs = dummyTx.getInputs(); TransactionOutput makerOutput = null; - // We don't support more then 1 optional change output + // We don't support more than 1 optional change output checkArgument(dummyTx.getOutputs().size() < 3, "dummyTx.getOutputs().size() >= 3"); // Only save change outputs, the dummy output is ignored (that's why we start with index 1) @@ -457,14 +457,14 @@ private PreparedDepositTxAndMakerInputs makerCreatesDepositTx(boolean makerIsBuy } // Add seller inputs - // the sellers input is not signed so we attach empty script bytes + // the seller's input is not signed so we attach empty script bytes for (RawTransactionInput rawTransactionInput : takerRawTransactionInputs) preparedDepositTx.addInput(getTransactionInput(preparedDepositTx, new byte[]{}, rawTransactionInput)); } else { // taker is buyer role // Add buyer inputs - // the sellers input is not signed so we attach empty script bytes + // the seller's input is not signed so we attach empty script bytes for (RawTransactionInput rawTransactionInput : takerRawTransactionInputs) preparedDepositTx.addInput(getTransactionInput(preparedDepositTx, new byte[]{}, rawTransactionInput)); @@ -1012,7 +1012,7 @@ public Transaction traderSignAndFinalizeDisputedPayoutTx(byte[] depositTxSeriali /////////////////////////////////////////////////////////////////////////////////////////// - // Emergency payout tool. Used only in cased when the payput from the arbitrator does not work because some data + // Emergency payout tool. Used only in cased when the payout from the arbitrator does not work because some data // in the trade/dispute are messed up. // We keep here arbitratorPayoutAmount just in case (requires cooperation from peer anyway) public Transaction emergencySignAndPublishPayoutTxFrom2of3MultiSig(String depositTxHex, @@ -1297,7 +1297,7 @@ private void addAvailableInputsAndChangeOutputs(Transaction transaction, Address changeAddress) throws WalletException { SendRequest sendRequest = null; try { - // Lets let the framework do the work to find the right inputs + // Let the framework do the work to find the right inputs sendRequest = SendRequest.forTx(transaction); sendRequest.shuffleOutputs = false; sendRequest.aesKey = aesKey; diff --git a/core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java b/core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java index 23d38dd13c1..37eb40a14b8 100644 --- a/core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java +++ b/core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java @@ -96,8 +96,8 @@ public static void broadcastTx(Wallet wallet, PeerGroup peerGroup, Transaction t broadcastTimerMap.put(txId, timeoutTimer); } else { - // Would be due a wrong way how to use the API (calling 2 times a broadcast with same tx). - // An arbitrator reported to got the error after a manual payout, need to investigate why... + // Would be the wrong way how to use the API (calling 2 times a broadcast with same tx). + // An arbitrator reported that got the error after a manual payout, need to investigate why... stopAndRemoveTimer(txId); UserThread.execute(() -> callback.onFailure(new TxBroadcastException("We got broadcastTx called with a tx " + "which has an open timeoutTimer. txId=" + txId, txId))); diff --git a/core/src/main/java/bisq/core/btc/wallet/WalletService.java b/core/src/main/java/bisq/core/btc/wallet/WalletService.java index d04567d5f16..3d90c82abfa 100644 --- a/core/src/main/java/bisq/core/btc/wallet/WalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/WalletService.java @@ -258,7 +258,7 @@ public static void signTransactionInput(Wallet wallet, KeyBag maybeDecryptingKeyBag = new DecryptingKeyBag(wallet, aesKey); if (txIn.getConnectedOutput() != null) { try { - // We assume if its already signed, its hopefully got a SIGHASH type that will not invalidate when + // We assume if it's already signed, it's hopefully got a SIGHASH type that will not invalidate when // we sign missing pieces (to check this would require either assuming any signatures are signing // standard output types or a way to get processed signatures out of script execution) txIn.getScriptSig().correctlySpends(tx, index, txIn.getConnectedOutput().getScriptPubKey(), Script.ALL_VERIFY_FLAGS); @@ -277,11 +277,11 @@ public static void signTransactionInput(Wallet wallet, Transaction partialTx = propTx.partialTx; txIn = partialTx.getInput(index); if (txIn.getConnectedOutput() != null) { - // If we dont have a sig we don't do the check to avoid error reports of failed sig checks + // If we don't have a sig we don't do the check to avoid error reports of failed sig checks final List chunks = txIn.getConnectedOutput().getScriptPubKey().getChunks(); if (!chunks.isEmpty() && chunks.get(0).data != null && chunks.get(0).data.length > 0) { try { - // We assume if its already signed, its hopefully got a SIGHASH type that will not invalidate when + // We assume if it's already signed, it's hopefully got a SIGHASH type that will not invalidate when // we sign missing pieces (to check this would require either assuming any signatures are signing // standard output types or a way to get processed signatures out of script execution) txIn.getScriptSig().correctlySpends(tx, index, txIn.getConnectedOutput().getScriptPubKey(), Script.ALL_VERIFY_FLAGS); diff --git a/core/src/main/java/bisq/core/btc/wallet/WalletsManager.java b/core/src/main/java/bisq/core/btc/wallet/WalletsManager.java index 7ad96b256ed..af0d3aae9d2 100644 --- a/core/src/main/java/bisq/core/btc/wallet/WalletsManager.java +++ b/core/src/main/java/bisq/core/btc/wallet/WalletsManager.java @@ -149,7 +149,7 @@ public DeterministicSeed getDecryptedSeed(KeyParameter aesKey, DeterministicSeed } } - // A bsq tx has miner fees in btc included. Thus we need to handle it at both wallets. + // A bsq tx has miner fees in btc included. Thus we need to handle it on both wallets. public void publishAndCommitBsqTx(Transaction tx, TxType txType, TxBroadcaster.Callback callback) { // We need to create another instance, otherwise the tx would trigger an invalid state exception // if it gets committed 2 times diff --git a/core/src/main/java/bisq/core/dao/DaoFacade.java b/core/src/main/java/bisq/core/dao/DaoFacade.java index 565a3737b5a..0f9d1fa113d 100644 --- a/core/src/main/java/bisq/core/dao/DaoFacade.java +++ b/core/src/main/java/bisq/core/dao/DaoFacade.java @@ -299,7 +299,7 @@ public Coin getProposalFee(int chainHeight) { return ProposalConsensus.getFee(daoStateService, chainHeight); } - // Publish proposal tx, proposal payload and and persist it to myProposalList + // Publish proposal tx, proposal payload and persist it to myProposalList public void publishMyProposal(Proposal proposal, Transaction transaction, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) { myProposalListService.publishTxAndPayload(proposal, transaction, resultHandler, errorMessageHandler); @@ -393,7 +393,7 @@ public void publishBlindVote(Coin stake, ResultHandler resultHandler, ExceptionH // Use case: Presentation of phases /////////////////////////////////////////////////////////////////////////////////////////// - // Because last block in request and voting phases must not be used fo making a tx as it will get confirmed in the + // Because last block in request and voting phases must not be used for making a tx as it will get confirmed in the // next block which would be already the next phase we hide that last block to the user and add it to the break. public int getFirstBlockOfPhaseForDisplay(int height, DaoPhase.Phase phase) { int firstBlock = periodService.getFirstBlockOfPhase(height, phase); @@ -422,7 +422,7 @@ public int getFirstBlockOfPhaseForDisplay(int height, DaoPhase.Phase phase) { return firstBlock; } - // Because last block in request and voting phases must not be used fo making a tx as it will get confirmed in the + // Because last block in request and voting phases must not be used for making a tx as it will get confirmed in the // next block which would be already the next phase we hide that last block to the user and add it to the break. public int getLastBlockOfPhaseForDisplay(int height, DaoPhase.Phase phase) { int lastBlock = periodService.getLastBlockOfPhase(height, phase); diff --git a/core/src/main/java/bisq/core/dao/governance/blindvote/VoteWithProposalTxIdList.java b/core/src/main/java/bisq/core/dao/governance/blindvote/VoteWithProposalTxIdList.java index 247235faab0..8759f1574ff 100644 --- a/core/src/main/java/bisq/core/dao/governance/blindvote/VoteWithProposalTxIdList.java +++ b/core/src/main/java/bisq/core/dao/governance/blindvote/VoteWithProposalTxIdList.java @@ -32,8 +32,8 @@ /** * We don't persist that list but use it only for encoding the VoteWithProposalTxId list - * to PB bytes in the blindVote. The bytes gets encrypted and later decrypted. To use a ByteOutputStream - * and add all list elements would work for encryption but for decrypting we don't know the length of an list entry + * to PB bytes in the blindVote. The bytes get encrypted and later decrypted. To use a ByteOutputStream + * and add all list elements would work for encryption but for decrypting we don't know the length of a list entry * and it would make the process complicate (e.g. require a custom serialisation format). */ @Slf4j diff --git a/core/src/main/java/bisq/core/dao/governance/bond/reputation/MyBondedReputationRepository.java b/core/src/main/java/bisq/core/dao/governance/bond/reputation/MyBondedReputationRepository.java index 0de193ba97d..b3935408cb9 100644 --- a/core/src/main/java/bisq/core/dao/governance/bond/reputation/MyBondedReputationRepository.java +++ b/core/src/main/java/bisq/core/dao/governance/bond/reputation/MyBondedReputationRepository.java @@ -117,8 +117,8 @@ private void update() { if (BondRepository.isConfiscated(myBondedReputation, daoStateService)) { myBondedReputation.setBondState(BondState.CONFISCATED); } else { - // We don't have a UI use case for showing LOCKUP_TX_PENDING yet, but lets keep the code so if needed - // its there. + // We don't have a UI use case for showing LOCKUP_TX_PENDING yet, but let's keep the code so if needed + // it's there. if (BondRepository.isLockupTxUnconfirmed(bsqWalletService, myBondedReputation.getBondedAsset()) && myBondedReputation.getBondState() == BondState.READY_FOR_LOCKUP) { myBondedReputation.setBondState(BondState.LOCKUP_TX_PENDING); diff --git a/core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java b/core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java index 8176565d0ed..a262712cf55 100644 --- a/core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java +++ b/core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java @@ -94,7 +94,7 @@ protected void updateBond(BondedRole bond, Role bondedAsset, TxOutput lockupTxOu String lockupTxId = lockupTxOutput.getTxId(); daoStateService.getTx(lockupTxId).ifPresent(lockupTx -> { byte[] opReturnData = lockupTx.getLastTxOutput().getOpReturnData(); - // We used the hash of th bonded bondedAsset object as our hash in OpReturn of the lock up tx to have a + // We used the hash of the bonded bondedAsset object as our hash in OpReturn of the lock up tx to have a // unique binding of the tx to the data object. byte[] hash = BondConsensus.getHashFromOpReturnData(opReturnData); Optional candidate = findBondedAssetByHash(hash); diff --git a/core/src/main/java/bisq/core/dao/governance/merit/MeritConsensus.java b/core/src/main/java/bisq/core/dao/governance/merit/MeritConsensus.java index 29d0a03167b..6ea2c7e0754 100644 --- a/core/src/main/java/bisq/core/dao/governance/merit/MeritConsensus.java +++ b/core/src/main/java/bisq/core/dao/governance/merit/MeritConsensus.java @@ -121,11 +121,11 @@ public static long getWeightedMeritAmount(long amount, int issuanceHeight, int b if (issuanceHeight < 0) throw new IllegalArgumentException("issuanceHeight must not be negative. issuanceHeight=" + issuanceHeight); - // We use a linear function to apply a factor for the issuance amount of 1 if the issuance was recent and 0 + // We use a linear function to apply a factor for the issuance amount of 1 if the issuance was recent and 0 // if the issuance was 2 years old or older. // To avoid rounding issues with double values we multiply initially with a large number and divide at the end - // by that number again. As we multiply the amount in satoshi we get a reasonable good precision even the long - // division is not using rounding. Sticking with long values makes that operation more safe against consensus + // by that number again. As we multiply the amount in satoshis we get a reasonable good precision even the long + // division is not using rounding. Sticking with long values makes that operation safer against consensus // failures causes by rounding differences with double. long maxAge = 2 * blocksPerYear; // maxAge=100 000 (MeritConsensus.BLOCKS_PER_YEAR is 50_000) diff --git a/core/src/main/java/bisq/core/dao/governance/param/Param.java b/core/src/main/java/bisq/core/dao/governance/param/Param.java index f17a0894b90..ec4c7915e9d 100644 --- a/core/src/main/java/bisq/core/dao/governance/param/Param.java +++ b/core/src/main/java/bisq/core/dao/governance/param/Param.java @@ -54,14 +54,14 @@ public enum Param { MIN_MAKER_FEE_BTC("0.00005", ParamType.BTC, 5, 5), // 0.005% of trade amount MIN_TAKER_FEE_BTC("0.00005", ParamType.BTC, 5, 5), - // Fee in BSQ satoshi for a 1 BTC trade. 100 Satoshi = 1 BSQ + // Fee in BSQ satoshis for a 1 BTC trade. 100 satoshis = 1 BSQ // If 1 BTS is 1 USD the fee @5000 USD/BTC is 0.5 USD which is 10% of the BTC fee of 5 USD. // Might need adjustment if BSQ/BTC rate changes. DEFAULT_MAKER_FEE_BSQ("0.50", ParamType.BSQ, 5, 5), // ~ 0.01% of trade amount DEFAULT_TAKER_FEE_BSQ("1.5", ParamType.BSQ, 5, 5), // Min fee is the smallest fee allowed for a trade. If the default fee would be less than min fee the // min fee is used instead. - // 0.03 BSQ (3 satoshi) for a 1 BTC trade. 0.05 USD if 1 BSQ = 1 USD, 10 % of the BTC fee + // 0.03 BSQ (3 satoshis) for a 1 BTC trade. 0.05 USD if 1 BSQ = 1 USD, 10 % of the BTC fee MIN_MAKER_FEE_BSQ("0.03", ParamType.BSQ, 5, 5), // 0.0003%. MIN_TAKER_FEE_BSQ("0.03", ParamType.BSQ, 5, 5), diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/BaseProposalFactory.java b/core/src/main/java/bisq/core/dao/governance/proposal/BaseProposalFactory.java index abb58e32c2d..51ced41991a 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/BaseProposalFactory.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/BaseProposalFactory.java @@ -70,7 +70,7 @@ protected ProposalWithTransaction createProposalWithTransaction(String name, throws ProposalValidationException, InsufficientMoneyException, TxException { this.name = name; this.link = link; - // As we don't know the txId yes we create a temp proposal with txId set to an empty string. + // As we don't know the txId yet we create a temp proposal with txId set to an empty string. R proposal = createProposalWithoutTxId(); proposalValidator.validateDataFields(proposal); Transaction transaction = createTransaction(proposal); diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalListPresentation.java b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalListPresentation.java index 9be6942b6c9..78c10d2fb67 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalListPresentation.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalListPresentation.java @@ -190,7 +190,7 @@ private void updateLists() { // in the list. // If a tx is not found in the daoStateService it can be that it is either unconfirmed or invalid. // To avoid inclusion of invalid txs we add a check for the confidence type PENDING from the bsqWalletService. - // So we only add proposals if they are unconfirmed and therefor not yet parsed. Once confirmed they have to be + // So we only add proposals if they are unconfirmed and therefore not yet parsed. Once confirmed they have to be // found in the daoStateService. List myUnconfirmedProposals = myProposalListService.getList().stream() .filter(p -> !daoStateService.getTx(p.getTxId()).isPresent()) // Tx is still not in our bsq blocks diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java index 6da0d387516..d073d8edeca 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java @@ -159,7 +159,7 @@ public void onAdded(PersistableNetworkPayload payload) { @Override public void onParseBlockCompleteAfterBatchProcessing(Block block) { - // We try to broadcast at any block in the break1 phase. If we have received the data already we do not + // We try to broadcast at any block in the break1 phase. If we have received the data already we do not // broadcast so we do not flood the network. if (periodService.isInPhase(block.getHeight(), DaoPhase.Phase.BREAK1)) { // We only republish if we are completed with parsing old blocks, otherwise we would republish old @@ -171,7 +171,7 @@ public void onParseBlockCompleteAfterBatchProcessing(Block block) { @Override public void onParseBlockChainComplete() { - // Fill the lists with the data we have collected in out stores. + // Fill the lists with the data we have collected in our stores. fillListFromProtectedStore(); fillListFromAppendOnlyDataStore(); } diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetValidator.java b/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetValidator.java index a3712482c98..156e1753c83 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetValidator.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetValidator.java @@ -51,7 +51,7 @@ public void validateDataFields(Proposal proposal) throws ProposalValidationExcep RemoveAssetProposal removeAssetProposal = (RemoveAssetProposal) proposal; notEmpty(removeAssetProposal.getTickerSymbol(), "TickerSymbol must not be empty"); - // We want to avoid that someone cause damage by inserting a super long string. Real ticker symbols + // We want to avoid that someone causes damage by inserting a super long string. Real ticker symbols // are usually very short but we don't want to add additional restrictions here. checkArgument(removeAssetProposal.getTickerSymbol().length() <= 100, "TickerSymbol must not exceed 100 chars"); } catch (ProposalValidationException e) { diff --git a/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultConsensus.java b/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultConsensus.java index 1f0301db8b8..672e4bf75f0 100644 --- a/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultConsensus.java +++ b/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultConsensus.java @@ -65,7 +65,7 @@ public static VoteWithProposalTxIdList decryptVotes(byte[] encryptedVotes, Secre } // We compare first by stake and in case we have multiple entries with same stake we use the - // hex encoded hashOfProposalList for comparision + // hex encoded hashOfProposalList for comparison @Nullable public static byte[] getMajorityHash(List hashWithStakeList) throws VoteResultException.ValidationException, VoteResultException.ConsensusException { diff --git a/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java b/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java index fa464ff8a44..795e3faeca2 100644 --- a/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java +++ b/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java @@ -93,7 +93,7 @@ /** * Calculates the result of the voting at the VoteResult period. - * We take all data from the bitcoin domain and additionally the blindVote list which we received from the p2p network. + * We take all data from the bitcoin domain and additionally the blindVote list which we received from the p2p network. * Due to eventual consistency we use the hash of the data view of the voters (majority by merit+stake). If our local * blindVote list contains the blindVotes used by the voters we can calculate the result, otherwise we need to request * the missing blindVotes from the network. @@ -411,7 +411,7 @@ private BallotList createBallotList(VoteWithProposalTxIdList voteWithProposalTxI if (!missingBallots.isEmpty()) throw new VoteResultException.MissingBallotException(ballots, missingBallots); - // If we received a proposal after we had already voted we consider it as an proposal withhold attack and + // If we received a proposal after we had already voted we consider it as a proposal withhold attack and // treat the proposal as it was voted with a rejected vote. ballotByTxIdMap.entrySet().stream() .filter(e -> !voteByTxIdMap.keySet().contains(e.getKey())) diff --git a/core/src/main/java/bisq/core/dao/governance/votereveal/VoteRevealService.java b/core/src/main/java/bisq/core/dao/governance/votereveal/VoteRevealService.java index de859c88668..8ccc27e36ee 100644 --- a/core/src/main/java/bisq/core/dao/governance/votereveal/VoteRevealService.java +++ b/core/src/main/java/bisq/core/dao/governance/votereveal/VoteRevealService.java @@ -165,9 +165,9 @@ public void onParseBlockCompleteAfterBatchProcessing(Block block) { // Creation of vote reveal tx is done without user activity! // We create automatically the vote reveal tx when we are in the reveal phase of the current cycle when // the blind vote was created in case we have not done it already. - // The voter need to be at least once online in the reveal phase when he has a blind vote created, + // The voter needs to be at least once online in the reveal phase when he has a blind vote created, // otherwise his vote becomes invalid. - // In case the user miss the vote reveal phase an (invalid) vote reveal tx will be created the next time the user is + // In case the user misses the vote reveal phase an (invalid) vote reveal tx will be created the next time the user is // online. That tx only serves the purpose to unlock the stake from the blind vote but it will be ignored for voting. // A blind vote which did not get revealed might still be part of the majority hash calculation as we cannot know // which blind votes might be revealed until the phase is over at the moment when we publish the vote reveal tx. @@ -203,7 +203,7 @@ private void maybeRevealVotes(int chainHeight) { // BSQ because the blind vote tx is already in the snapshot and does not get parsed // again. It would require a reset of the snapshot and parse all blocks again. // As this is an exceptional case we prefer to have a simple solution instead and just - // publish the vote reveal tx but are aware that is is invalid. + // publish the vote reveal tx but are aware that it is invalid. log.warn("We missed the vote reveal phase but publish now the tx to unlock our locked " + "BSQ from the blind vote tx. BlindVoteTxId={}, blockHeight={}", blindVoteTxId, chainHeight); diff --git a/core/src/main/java/bisq/core/dao/monitoring/BlindVoteStateMonitoringService.java b/core/src/main/java/bisq/core/dao/monitoring/BlindVoteStateMonitoringService.java index 01ae89c8521..530b197d728 100644 --- a/core/src/main/java/bisq/core/dao/monitoring/BlindVoteStateMonitoringService.java +++ b/core/src/main/java/bisq/core/dao/monitoring/BlindVoteStateMonitoringService.java @@ -62,7 +62,7 @@ /** * Monitors the BlindVote P2P network payloads with using a hash of a sorted list of BlindVotes from one cycle and - * make it accessible to the network so we can detect quickly if any consensus issue arise. + * make it accessible to the network so we can detect quickly if any consensus issue arises. * We create that hash at the first block of the VoteReveal phase. There is one hash created per cycle. * The hash contains the hash of the previous block so we can ensure the validity of the whole history by * comparing the last block. diff --git a/core/src/main/java/bisq/core/dao/monitoring/DaoStateMonitoringService.java b/core/src/main/java/bisq/core/dao/monitoring/DaoStateMonitoringService.java index 843b2f570d0..c39f8a5ae21 100644 --- a/core/src/main/java/bisq/core/dao/monitoring/DaoStateMonitoringService.java +++ b/core/src/main/java/bisq/core/dao/monitoring/DaoStateMonitoringService.java @@ -69,7 +69,7 @@ import static com.google.common.base.Preconditions.checkArgument; /** - * Monitors the DaoState with using a hash fo the complete daoState and make it accessible to the network + * Monitors the DaoState by using a hash for the complete daoState and make it accessible to the network * so we can detect quickly if any consensus issue arise. * We create that hash after parsing and processing of a block is completed. There is one hash created per block. * The hash contains the hash of the previous block so we can ensure the validity of the whole history by @@ -253,7 +253,7 @@ public void requestHashesFromGenesisBlockHeight(String peersAddress) { } public void applySnapshot(LinkedList persistedDaoStateHashChain) { - // We could got a reset from a reorg, so we clear all and start over from the genesis block. + // We could get a reset from a reorg, so we clear all and start over from the genesis block. daoStateHashChain.clear(); daoStateBlockChain.clear(); daoStateNetworkService.reset(); diff --git a/core/src/main/java/bisq/core/dao/monitoring/ProposalStateMonitoringService.java b/core/src/main/java/bisq/core/dao/monitoring/ProposalStateMonitoringService.java index 9b7863cf734..56581168c08 100644 --- a/core/src/main/java/bisq/core/dao/monitoring/ProposalStateMonitoringService.java +++ b/core/src/main/java/bisq/core/dao/monitoring/ProposalStateMonitoringService.java @@ -62,7 +62,7 @@ /** * Monitors the Proposal P2P network payloads with using a hash of a sorted list of Proposals from one cycle and - * make it accessible to the network so we can detect quickly if any consensus issue arise. + * make it accessible to the network so we can detect quickly if any consensus issue arises. * We create that hash at the first block of the BlindVote phase. There is one hash created per cycle. * The hash contains the hash of the previous block so we can ensure the validity of the whole history by * comparing the last block. diff --git a/core/src/main/java/bisq/core/dao/node/BsqNode.java b/core/src/main/java/bisq/core/dao/node/BsqNode.java index 042bd84ba40..e06be387575 100644 --- a/core/src/main/java/bisq/core/dao/node/BsqNode.java +++ b/core/src/main/java/bisq/core/dao/node/BsqNode.java @@ -237,7 +237,7 @@ protected Optional doParseBlock(RawBlock rawBlock) throws RequiredReorgFr // not connecting from the latest height we had. The list is sorted by height if (!pendingBlocks.isEmpty()) { // We take only first element after sorting (so it is the block with the next height) to avoid that - // we would repeat calls in recursions in case we would iterate the list. + // we would repeat calls in recursions in case we would iterate the list. pendingBlocks.sort(Comparator.comparing(RawBlock::getHeight)); RawBlock nextPending = pendingBlocks.get(0); if (nextPending.getHeight() == daoStateService.getChainHeight() + 1) @@ -247,17 +247,17 @@ protected Optional doParseBlock(RawBlock rawBlock) throws RequiredReorgFr return Optional.of(block); } catch (BlockHeightNotConnectingException e) { // There is no guaranteed order how we receive blocks. We could have received block 102 before 101. - // If block is in future we move the block to teh pendingBlocks list. At next block we look up the + // If block is in the future we move the block to the pendingBlocks list. At next block we look up the // list if there is any potential candidate with the correct height and if so we remove that from that list. int heightForNextBlock = daoStateService.getChainHeight() + 1; if (rawBlock.getHeight() > heightForNextBlock) { if (!pendingBlocks.contains(rawBlock)) { pendingBlocks.add(rawBlock); - log.info("We received an block with a future block height. We store it as pending and try to apply " + + log.info("We received a block with a future block height. We store it as pending and try to apply " + "it at the next block. rawBlock: height/hash={}/{}", rawBlock.getHeight(), rawBlock.getHash()); } else { - log.warn("We received an block with a future block height but we had it already added to our pendingBlocks."); + log.warn("We received a block with a future block height but we had it already added to our pendingBlocks."); } } else if (rawBlock.getHeight() >= daoStateService.getGenesisBlockHeight()) { // We received an older block. We compare if we have it in our chain. diff --git a/core/src/main/java/bisq/core/dao/node/full/FullNode.java b/core/src/main/java/bisq/core/dao/node/full/FullNode.java index 4c455c9e18f..91e9d41362d 100644 --- a/core/src/main/java/bisq/core/dao/node/full/FullNode.java +++ b/core/src/main/java/bisq/core/dao/node/full/FullNode.java @@ -216,8 +216,8 @@ private void parseBlocksOnHeadHeight(int startBlockHeight, int chainHeight) { parseBlocksIfNewBlockAvailable(chainHeight); }, this::handleError); } else { - log.warn("We are trying to start with a block which is above the chain height of bitcoin core. " + - "We need probably wait longer until bitcoin core has fully synced. " + + log.warn("We are trying to start with a block which is above the chain height of Bitcoin Core. " + + "We need probably wait longer until Bitcoin Core has fully synced. " + "We try again after a delay of 1 min."); UserThread.runAfter(() -> requestChainHeadHeightAndParseBlocks(startBlockHeight), 60); } diff --git a/core/src/main/java/bisq/core/dao/node/full/RpcService.java b/core/src/main/java/bisq/core/dao/node/full/RpcService.java index af3c5f86655..d9e2f8ee03b 100644 --- a/core/src/main/java/bisq/core/dao/node/full/RpcService.java +++ b/core/src/main/java/bisq/core/dao/node/full/RpcService.java @@ -155,7 +155,7 @@ void setup(ResultHandler resultHandler, Consumer errorHandler) { this.client = client; } catch (BitcoindException | CommunicationException e) { if (e instanceof CommunicationException) - log.error("Probably Bitcoin core is not running or the rpc port is not set correctly. rpcPort=" + rpcPort); + log.error("Probably Bitcoin Core is not running or the rpc port is not set correctly. rpcPort=" + rpcPort); log.error(e.toString()); e.printStackTrace(); log.error(e.getCause() != null ? e.getCause().toString() : "e.getCause()=null"); diff --git a/core/src/main/java/bisq/core/dao/node/full/network/GetBlocksRequestHandler.java b/core/src/main/java/bisq/core/dao/node/full/network/GetBlocksRequestHandler.java index 1cab318a2bd..08ae5a578a4 100644 --- a/core/src/main/java/bisq/core/dao/node/full/network/GetBlocksRequestHandler.java +++ b/core/src/main/java/bisq/core/dao/node/full/network/GetBlocksRequestHandler.java @@ -44,7 +44,7 @@ import org.jetbrains.annotations.NotNull; /** - * Accepts a GetBlocksRequest from a lite nodes and send back a corresponding GetBlocksResponse. + * Accepts a GetBlocksRequest from a lite node and sends back a corresponding GetBlocksResponse. */ @Slf4j class GetBlocksRequestHandler { diff --git a/core/src/main/java/bisq/core/dao/node/lite/network/RequestBlocksHandler.java b/core/src/main/java/bisq/core/dao/node/lite/network/RequestBlocksHandler.java index a78546e3eac..48c7e15adc0 100644 --- a/core/src/main/java/bisq/core/dao/node/lite/network/RequestBlocksHandler.java +++ b/core/src/main/java/bisq/core/dao/node/lite/network/RequestBlocksHandler.java @@ -113,7 +113,7 @@ public void requestBlocks() { if (timeoutTimer == null) { timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions if (!stopped) { - String errorMessage = "A timeout occurred at sending getBlocksRequest:" + getBlocksRequest + + String errorMessage = "A timeout occurred when sending getBlocksRequest:" + getBlocksRequest + " on peersNodeAddress:" + nodeAddress; log.debug(errorMessage + " / RequestDataHandler=" + RequestBlocksHandler.this); handleFault(errorMessage, nodeAddress, CloseConnectionReason.SEND_MSG_TIMEOUT); @@ -135,7 +135,7 @@ public void onSuccess(Connection connection) { log.info("Sending of GetBlocksRequest message to peer {} succeeded.", nodeAddress.getFullAddress()); } else { log.trace("We have stopped already. We ignore that networkNode.sendMessage.onSuccess call." + - "Might be caused by an previous timeout."); + "Might be caused by a previous timeout."); } } @@ -150,7 +150,7 @@ public void onFailure(@NotNull Throwable throwable) { handleFault(errorMessage, nodeAddress, CloseConnectionReason.SEND_MSG_FAILURE); } else { log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call. " + - "Might be caused by an previous timeout."); + "Might be caused by a previous timeout."); } } }); diff --git a/core/src/main/java/bisq/core/dao/node/parser/BlockParser.java b/core/src/main/java/bisq/core/dao/node/parser/BlockParser.java index f370c1d61cb..859ad34cfa4 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/BlockParser.java +++ b/core/src/main/java/bisq/core/dao/node/parser/BlockParser.java @@ -39,7 +39,7 @@ /** * Parse a rawBlock and creates a block from it with an empty tx list. - * Iterates all rawTx and if the tx is a a BSQ tx it gets added to the tx list. + * Iterates all rawTx and if the tx is a BSQ tx it gets added to the tx list. */ @Slf4j @Immutable @@ -101,7 +101,7 @@ public Block parseBlock(RawBlock rawBlock) throws BlockHashNotConnectingExceptio // Worst case is that all txs in a block are depending on another, so only one get resolved at each iteration. // Min tx size is 189 bytes (normally about 240 bytes), 1 MB can contain max. about 5300 txs (usually 2000). - // Realistically we don't expect more then a few recursive calls. + // Realistically we don't expect more than a few recursive calls. // There are some blocks with testing such dependency chains like block 130768 where at each iteration only // one get resolved. // Lately there is a patter with 24 iterations observed diff --git a/core/src/main/java/bisq/core/dao/node/parser/TempTx.java b/core/src/main/java/bisq/core/dao/node/parser/TempTx.java index 67d6c1c593a..e7bac4d2e34 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TempTx.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TempTx.java @@ -32,7 +32,7 @@ import javax.annotation.Nullable; /** - * Used only only temporary during the transaction parsing process to support mutable data while parsing. + * Used only temporary during the transaction parsing process to support mutable data while parsing. * After parsing it will get cloned to the immutable Tx. * We don't need to implement the ProtoBuffer methods as it is not persisted or sent over the wire. */ diff --git a/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java b/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java index 0a9d09bf34d..4839f48503d 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java @@ -46,10 +46,10 @@ * happen again. * Further (highly unlikely) consequences could be: * If the BSQ output would be sent to a BSQ address the old client would accept that even it is - * invalid according to the new rules. But sending such a output would require a manually crafted tx + * invalid according to the new rules. But sending such an output would require a manually crafted tx * (not possible in the UI). Worst case a not updated user would buy invalid BSQ but that is not possible as we * enforce update to 1.2.0 for trading a few days after release as that release introduced the new trade protocol - * and protection tool. Only of both both traders would have deactivated filter messages they could trade. + * and protection tool. Only if both traders would have deactivated filter messages they could trade. * * Problem description: * We did not apply the check to not allow BSQ outputs after we had detected a BTC output. @@ -63,7 +63,7 @@ * The BSQ was sitting in the BTC wallet so not even visible as BSQ to the user. * If the user would have crafted a custom BSQ tx he could have avoided that the full trade fee was burned. * - * Not an universal rule: + * Not a universal rule: * We cannot enforce the rule that no BSQ output is permitted to all possible transactions because there can be cases * where we need to permit this case. * For instance in case we confiscate a lockupTx we have usually 2 BSQ outputs: The first one is the bond which @@ -191,7 +191,7 @@ void processTxOutput(TempTxOutput tempTxOutput) { availableInputValue -= tempTxOutput.getValue(); // We must not set prohibitMoreBsqOutputs at confiscation transactions as optional - // BSQ change output (output 2) must not be confiscated. + // BSQ change output (output 2) must not be confiscated. tempTxOutput.setTxOutputType(TxOutputType.BTC_OUTPUT); } } @@ -216,7 +216,7 @@ void invalidateUTXOCandidates() { /** * Whether a transaction is a valid unlock bond transaction or not. * - * @param txOutputValue The value of the current output, in satoshi. + * @param txOutputValue The value of the current output, in satoshis. * @param index The index of the output. * @return True if the transaction is an unlock transaction, false otherwise. */ @@ -302,8 +302,8 @@ private boolean isBtcOutputOfBurnFeeTx(TempTxOutput tempTxOutput) { // We need to require one BSQ change output as we could otherwise not be able to distinguish between 2 // structurally same transactions where only the BSQ fee is different. In case of asset listing fee and proof of - // burn it is a user input, so it is not know to the parser, instead we derive the burned fee from the parser. - // In case of proposal fee we could derive it from the params. + // burn it is a user input, so it is not known to the parser, instead we derive the burned fee from the parser. + // In case of proposal fee we could derive it from the params. // Case 1: 10 BSQ fee to burn // In: 17 BSQ @@ -336,7 +336,7 @@ private void handleIssuanceCandidateOutput(TempTxOutput tempTxOutput) { // We do not permit more BSQ outputs after the issuance candidate. prohibitMoreBsqOutputs = true; - // We store the candidate but we don't apply the TxOutputType yet as we need to verify the fee after all + // We store the candidate but we don't apply the TxOutputType yet as we need to verify the fee after all // outputs are parsed and check the phase. The TxParser will do that.... optionalIssuanceCandidate = Optional.of(tempTxOutput); } @@ -386,7 +386,7 @@ private void handleBtcOutput(TempTxOutput txOutput, int index) { prohibitMoreBsqOutputs = true; } else { // If we have BSQ left as fee and we are at the second output it might be a compensation request output. - // We store the candidate but we don't apply the TxOutputType yet as we need to verify the fee after all + // We store the candidate but we don't apply the TxOutputType yet as we need to verify the fee after all // outputs are parsed and check the phase. The TxParser will do that.... if (availableInputValue > 0 && index == 1 && diff --git a/core/src/main/java/bisq/core/dao/node/parser/TxParser.java b/core/src/main/java/bisq/core/dao/node/parser/TxParser.java index 1b518de77d1..c2d38ebebc6 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TxParser.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TxParser.java @@ -265,7 +265,7 @@ private void processIssuance(int blockHeight, TempTx tempTx, long bsqFee) { } else { log.warn("It can be that we have a opReturn which is correct from its structure but the whole tx " + "in not valid as the issuanceCandidate in not there. " + - "As the BSQ fee is set it must be either a buggy tx or an manually crafted invalid tx."); + "As the BSQ fee is set it must be either a buggy tx or a manually crafted invalid tx."); // Even though the request part if invalid the BSQ transfer and change output should still be valid // as long as the BSQ change <= BSQ inputs. // We tolerate such an incorrect tx and do not burn the BSQ @@ -373,7 +373,7 @@ static boolean isTxInvalid(TempTx tempTx, boolean bsqOutputFound, boolean burntB * * @param tempTx The temporary transaction. * @param optionalOpReturnType The optional OP_RETURN type of the transaction. - * @param hasBurntBSQ If the have been remaining value from the inputs which got not spent in outputs. + * @param hasBurntBSQ If there have been remaining value from the inputs which got not spent in outputs. * Might be valid BSQ fees or burned BSQ from an invalid tx. * @return The type of the transaction, if it is relevant to bisq. */ diff --git a/core/src/main/java/bisq/core/dao/state/DaoStateService.java b/core/src/main/java/bisq/core/dao/state/DaoStateService.java index ecb33ae229e..8cbfc5553d6 100644 --- a/core/src/main/java/bisq/core/dao/state/DaoStateService.java +++ b/core/src/main/java/bisq/core/dao/state/DaoStateService.java @@ -238,7 +238,7 @@ public void onParseBlockComplete(Block block) { daoStateListeners.forEach(l -> l.onParseBlockComplete(block)); // We use 2 different handlers as we don't want to update domain listeners during batch processing of all - // blocks as that cause performance issues. In earlier versions when we updated at each block it took + // blocks as that causes performance issues. In earlier versions when we updated at each block it took // 50 sec. for 4000 blocks, after that change it was about 4 sec. // Clients if (parseBlockChainComplete) @@ -652,7 +652,7 @@ public boolean isRejectedIssuanceOutput(TxOutputKey txOutputKey) { // Unlocking - UNLOCK txOutputs that are not yet spendable due to lock time // Unlocked - UNLOCK txOutputs that are spendable since the lock time has passed // LockTime - 0 means that the funds are spendable at the same block of the UNLOCK tx. For the user that is not - // supported as we do not expose unconfirmed BSQ txs so lockTime of 1 is the smallest the use can actually use. + // supported as we do not expose unconfirmed BSQ txs so lockTime of 1 is the smallest the user can actually use. // LockTime public Optional getLockTime(String txId) { @@ -850,7 +850,7 @@ public void confiscateBond(String lockupTxId) { doConfiscateBond(lockupTxId); } else { // We could be more radical here and confiscate the output if it is unspent but lock time is over, - // but its probably better to stick to the rules that confiscation can only happen before lock time + // but it's probably better to stick to the rules that confiscation can only happen before lock time // is over. log.warn("We could not confiscate the bond because the unlock tx was already spent or lock time " + "has exceeded. unlockTxId={}", unlockTxId); diff --git a/core/src/main/java/bisq/core/dao/state/DaoStateStorageService.java b/core/src/main/java/bisq/core/dao/state/DaoStateStorageService.java index 1ab6961a83c..1365de3c64a 100644 --- a/core/src/main/java/bisq/core/dao/state/DaoStateStorageService.java +++ b/core/src/main/java/bisq/core/dao/state/DaoStateStorageService.java @@ -42,7 +42,7 @@ */ @Slf4j public class DaoStateStorageService extends StoreService { - // We needed to rename teh db file as we have a new file structure with the hashChain feature and need to enforce the + // We needed to rename the db file as we have a new file structure with the hashChain feature and need to enforce the // new file to be used. // We can rename to DaoStateStore before mainnet launch again. // Another update due to some data field changes which would cause diff. hashes, so to enforce users to get the new diff --git a/core/src/main/java/bisq/core/dao/state/model/DaoState.java b/core/src/main/java/bisq/core/dao/state/model/DaoState.java index 7d0cf31a66c..0d98cbe996a 100644 --- a/core/src/main/java/bisq/core/dao/state/model/DaoState.java +++ b/core/src/main/java/bisq/core/dao/state/model/DaoState.java @@ -220,7 +220,7 @@ public byte[] getSerializedStateForHashChain() { // earlier blocks is included in the hash. The past blocks cannot be changed anyway when a new block arrives. // Reorgs are handled by rebuilding the hash chain from last snapshot. // Using the full blocks list becomes quite heavy. 7000 blocks are - // about 1.4 MB and creating the hash takes 30 sec. With using just the last block we reduce the time to 7 sec. + // about 1.4 MB and creating the hash takes 30 sec. By using just the last block we reduce the time to 7 sec. return getBsqStateBuilderExcludingBlocks().addBlocks(getBlocks().getLast().toProtoMessage()).build().toByteArray(); } diff --git a/core/src/main/java/bisq/core/dao/state/model/blockchain/BaseTxOutput.java b/core/src/main/java/bisq/core/dao/state/model/blockchain/BaseTxOutput.java index 39c8c223349..2e0cc6a2c33 100644 --- a/core/src/main/java/bisq/core/dao/state/model/blockchain/BaseTxOutput.java +++ b/core/src/main/java/bisq/core/dao/state/model/blockchain/BaseTxOutput.java @@ -44,7 +44,7 @@ public abstract class BaseTxOutput implements ImmutableDaoStateModel { protected final String txId; // Before v0.9.6 it was only set if dumpBlockchainData was set to true but we changed that with 0.9.6 - // so that is is always set. We still need to support it because of backward compatibility. + // so that it is always set. We still need to support it because of backward compatibility. @Nullable protected final PubKeyScript pubKeyScript; // Has about 50 bytes, total size of TxOutput is about 300 bytes. @Nullable diff --git a/core/src/main/java/bisq/core/dao/state/model/blockchain/TxType.java b/core/src/main/java/bisq/core/dao/state/model/blockchain/TxType.java index 21e8f6f1617..ff1f782df94 100644 --- a/core/src/main/java/bisq/core/dao/state/model/blockchain/TxType.java +++ b/core/src/main/java/bisq/core/dao/state/model/blockchain/TxType.java @@ -44,7 +44,7 @@ public enum TxType implements ImmutableDaoStateModel { UNLOCK(true, false), ASSET_LISTING_FEE(true, true), PROOF_OF_BURN(true, true), - IRREGULAR(false, false); // the params are here irrelevant as we can have any tx which violated the rules set to irregular + IRREGULAR(false, false); // the params are irrelevant here as we can have any tx that violated the rules set to irregular /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/core/src/main/java/bisq/core/dao/state/model/governance/BondedRoleType.java b/core/src/main/java/bisq/core/dao/state/model/governance/BondedRoleType.java index 8588394972a..e4211530025 100644 --- a/core/src/main/java/bisq/core/dao/state/model/governance/BondedRoleType.java +++ b/core/src/main/java/bisq/core/dao/state/model/governance/BondedRoleType.java @@ -34,7 +34,7 @@ * the PB serialisation so changes for those would not change the hash for the dao state hash chain. * As the data is not used in consensus critical code yet changing fields can be tolerated. * For mediators and arbitrators we will use automated verification of the bond so there might be issues when we change - * the values. So lets avoid changing anything here beside adding new entries. + * the values. So let's avoid changing anything here beside adding new entries. * */ public enum BondedRoleType { @@ -87,7 +87,7 @@ public enum BondedRoleType { /** * @param requiredBondUnit // requiredBondUnit for lockup tx (will be multiplied with PARAM.BONDED_ROLE_FACTOR for BSQ value) * @param unlockTimeInDays // unlockTime in days - * @param link // Link to Github for role description + * @param link // Link to GitHub for role description * @param allowMultipleHolders // If role can be held by multiple persons (e.g. seed nodes vs. domain name) */ BondedRoleType(long requiredBondUnit, int unlockTimeInDays, String link, boolean allowMultipleHolders) { diff --git a/core/src/main/java/bisq/core/dao/state/model/governance/DaoPhase.java b/core/src/main/java/bisq/core/dao/state/model/governance/DaoPhase.java index 4902c99f708..ccd7091d1b0 100644 --- a/core/src/main/java/bisq/core/dao/state/model/governance/DaoPhase.java +++ b/core/src/main/java/bisq/core/dao/state/model/governance/DaoPhase.java @@ -40,7 +40,7 @@ public class DaoPhase implements PersistablePayload, ImmutableDaoStateModel { /** * Enum for phase of a cycle. * - * We don't want to use a enum with the duration as field because the duration can change by voting and enums + * We don't want to use an enum with the duration as field because the duration can change by voting and enums * should be considered immutable. */ @Immutable diff --git a/core/src/main/java/bisq/core/dao/state/model/governance/Role.java b/core/src/main/java/bisq/core/dao/state/model/governance/Role.java index a133b0b0c89..c0b7079e0c5 100644 --- a/core/src/main/java/bisq/core/dao/state/model/governance/Role.java +++ b/core/src/main/java/bisq/core/dao/state/model/governance/Role.java @@ -48,7 +48,7 @@ public final class Role implements PersistablePayload, NetworkPayload, BondedAss /** * @param name Full name or nickname - * @param link Github account or forum account of user + * @param link GitHub account or forum account of user * @param bondedRoleType BondedRoleType */ public Role(String name, diff --git a/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputListService.java b/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputListService.java index adeef422e8f..e153c2045f3 100644 --- a/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputListService.java +++ b/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputListService.java @@ -69,7 +69,7 @@ public void readPersisted() { /////////////////////////////////////////////////////////////////////////////////////////// /** - * Once a tx gets committed to out BSQ wallet we store the change output for allowing it to be spent in follow-up + * Once a tx gets committed to our BSQ wallet we store the change output for allowing it to be spent in follow-up * transactions. */ public void onCommitTx(Transaction tx, TxType txType, Wallet wallet) { @@ -84,7 +84,7 @@ public void onCommitTx(Transaction tx, TxType txType, Wallet wallet) { case GENESIS: return; case TRANSFER_BSQ: - changeOutputIndex = 1; // output 0 is receivers address + changeOutputIndex = 1; // output 0 is receiver's address break; case PAY_TRADE_FEE: changeOutputIndex = 0; @@ -124,7 +124,7 @@ public void onCommitTx(Transaction tx, TxType txType, Wallet wallet) { // It can be that we don't have a BSQ and a BTC change output. // If no BSQ change but a BTC change the index points to the BTC output and then // we detect that it is not part of our wallet. - // If there is a BSQ change but no BTC change it has not effect as we ignore BTC outputs anyway. + // If there is a BSQ change but no BTC change it has no effect as we ignore BTC outputs anyway. // If both change outputs do not exist then we might point to an index outside // of the list and we return at our scope check. diff --git a/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedTxOutput.java b/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedTxOutput.java index 28aa5250d35..a89bd25479c 100644 --- a/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedTxOutput.java +++ b/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedTxOutput.java @@ -32,8 +32,8 @@ /** * Used for tracking unconfirmed change outputs to allow them to be spent in follow up - * transactions in txType permits it. We can assume the the user is not intending to - * double spend own transactions as well that he does not try to spend a invalid BSQ + * transactions in txType permits it. We can assume that the user is not intending to + * double spend own transactions as well that he does not try to spend an invalid BSQ * output to a BSQ address. * We do not allow spending unconfirmed BSQ outputs received from elsewhere. */ diff --git a/core/src/main/java/bisq/core/filter/Filter.java b/core/src/main/java/bisq/core/filter/Filter.java index 43d366991a1..6c66d8e3dd3 100644 --- a/core/src/main/java/bisq/core/filter/Filter.java +++ b/core/src/main/java/bisq/core/filter/Filter.java @@ -182,8 +182,8 @@ public Filter(List bannedOfferIds, @Override public protobuf.StoragePayload toProtoMessage() { - checkNotNull(signatureAsBase64, "signatureAsBase64 must nto be null"); - checkNotNull(ownerPubKeyBytes, "ownerPubKeyBytes must nto be null"); + checkNotNull(signatureAsBase64, "signatureAsBase64 must not be null"); + checkNotNull(ownerPubKeyBytes, "ownerPubKeyBytes must not be null"); List paymentAccountFilterList = bannedPaymentAccounts.stream() .map(PaymentAccountFilter::toProtoMessage) .collect(Collectors.toList()); diff --git a/core/src/main/java/bisq/core/filter/FilterManager.java b/core/src/main/java/bisq/core/filter/FilterManager.java index 86687d92c37..8cf9f77717d 100644 --- a/core/src/main/java/bisq/core/filter/FilterManager.java +++ b/core/src/main/java/bisq/core/filter/FilterManager.java @@ -169,7 +169,7 @@ public void onNoPeersAvailable() { @Override public void onUpdatedDataReceived() { - // We should have received all data at that point and if the filers was not set we + // We should have received all data at that point and if the filers were not set we // clean up as it might be that we missed the filter remove message if we have not been online. UserThread.runAfter(() -> { if (filterProperty.get() == null) @@ -308,7 +308,7 @@ private boolean verifySignature(Filter filter) { } } - // We dont use full data from Filter as we are only interested in the filter data not the sig and keys + // We don't use full data from Filter as we are only interested in the filter data not the sig and keys private String getHexFromData(Filter filter) { protobuf.Filter.Builder builder = protobuf.Filter.newBuilder() .addAllBannedOfferIds(filter.getBannedOfferIds()) diff --git a/core/src/main/java/bisq/core/locale/BankUtil.java b/core/src/main/java/bisq/core/locale/BankUtil.java index e0c2af0d348..5d2a6c4dcb3 100644 --- a/core/src/main/java/bisq/core/locale/BankUtil.java +++ b/core/src/main/java/bisq/core/locale/BankUtil.java @@ -31,7 +31,7 @@ public class BankUtil { // BankName @SuppressWarnings("SameReturnValue") public static boolean isBankNameRequired(String countryCode) { - // Currently we always return true but lets keep that method to be more flexible in case we what to not show + // Currently we always return true but let's keep that method to be more flexible in case we what to not show // it at some new payment method. return true; /* @@ -89,7 +89,7 @@ public static boolean isBankIdRequired(String countryCode) { public static String getBankIdLabel(String countryCode) { switch (countryCode) { case "CA": - return "Institution Number";// do not translate as it is used in english only + return "Institution Number";// do not translate as it is used in English only case "MX": case "HK": return Res.get("payment.bankCode"); @@ -122,15 +122,15 @@ public static boolean isBranchIdRequired(String countryCode) { public static String getBranchIdLabel(String countryCode) { switch (countryCode) { case "GB": - return "UK sort code"; // do not translate as it is used in english only + return "UK sort code"; // do not translate as it is used in English only case "US": - return "Routing Number"; // do not translate as it is used in english only + return "Routing Number"; // do not translate as it is used in English only case "BR": - return "Código da Agência"; // do not translate as it is used in portuguese only + return "Código da Agência"; // do not translate as it is used in Portuguese only case "AU": - return "BSB code"; // do not translate as it is used in english only + return "BSB code"; // do not translate as it is used in English only case "CA": - return "Transit Number"; // do not translate as it is used in english only + return "Transit Number"; // do not translate as it is used in English only default: return isBranchIdRequired(countryCode) ? Res.get("payment.branchNr") : Res.get("payment.branchNrOptional"); } @@ -157,15 +157,15 @@ public static String getAccountNrLabel(String countryCode) { case "HK": return Res.get("payment.accountNr"); case "NO": - return "Kontonummer"; // do not translate as it is used in norwegian only + return "Kontonummer"; // do not translate as it is used in Norwegian only case "SE": - return "Bankgiro number"; // do not translate as it is used in swedish only + return "Bankgiro number"; // do not translate as it is used in Swedish only case "MX": - return "CLABE"; // do not translate as it is used in spanish only + return "CLABE"; // do not translate as it is used in Spanish only case "CL": - return "Cuenta"; // do not translate as it is used in spanish only + return "Cuenta"; // do not translate as it is used in Spanish only case "AR": - return "Número de cuenta"; // do not translate as it is used in spanish only + return "Número de cuenta"; // do not translate as it is used in Spanish only default: return Res.get("payment.accountNrLabel"); } @@ -221,11 +221,11 @@ public static boolean isHolderIdRequired(String countryCode) { public static String getHolderIdLabel(String countryCode) { switch (countryCode) { case "BR": - return "Cadastro de Pessoas Físicas (CPF)"; // do not translate as it is used in portuguese only + return "Cadastro de Pessoas Físicas (CPF)"; // do not translate as it is used in Portuguese only case "CL": - return "Rol Único Tributario (RUT)"; // do not translate as it is used in spanish only + return "Rol Único Tributario (RUT)"; // do not translate as it is used in Spanish only case "AR": - return "CUIL/CUIT"; // do not translate as it is used in spanish only + return "CUIL/CUIT"; // do not translate as it is used in Spanish only default: return Res.get("payment.personalId"); } diff --git a/core/src/main/java/bisq/core/locale/CurrencyTuple.java b/core/src/main/java/bisq/core/locale/CurrencyTuple.java index e20a15ad032..d644538bffb 100644 --- a/core/src/main/java/bisq/core/locale/CurrencyTuple.java +++ b/core/src/main/java/bisq/core/locale/CurrencyTuple.java @@ -26,7 +26,7 @@ public class CurrencyTuple { public final int precision; // precision 4 is 1/10000 -> 0.0001 is smallest unit public CurrencyTuple(String code, String name) { - // We use Fiat class and there precision is 4 + // We use Fiat class and the precision is 4 // In future we might add custom precision per currency this(code, name, 4); } diff --git a/core/src/main/java/bisq/core/locale/CurrencyUtil.java b/core/src/main/java/bisq/core/locale/CurrencyUtil.java index b98b5b3d893..7030f658d24 100644 --- a/core/src/main/java/bisq/core/locale/CurrencyUtil.java +++ b/core/src/main/java/bisq/core/locale/CurrencyUtil.java @@ -332,7 +332,7 @@ public static Optional getFiatCurrency(String currencyCode) { * * As we use a boolean result for isCryptoCurrency and isFiatCurrency we do not treat missing currencies correctly. * To throw an exception might be an option but that will require quite a lot of code change, so we don't do that - * for the moment, but could be considered for the future. Another maybe better option is to introduce a enum which + * for the moment, but could be considered for the future. Another maybe better option is to introduce an enum which * contains 3 entries (CryptoCurrency, Fiat, Undefined). */ public static boolean isCryptoCurrency(String currencyCode) { @@ -483,7 +483,7 @@ public static Optional findAsset(AssetRegistry assetRegistry, String curr return optionalAsset; } - // If we are in mainnet we need have a mainet asset defined. + // If we are in mainnet we need have a mainnet asset defined. throw new IllegalArgumentException("We are on mainnet and we could not find an asset with network type mainnet"); } diff --git a/core/src/main/java/bisq/core/locale/GlobalSettings.java b/core/src/main/java/bisq/core/locale/GlobalSettings.java index 8e0f86ff4a7..2a4b25116ef 100644 --- a/core/src/main/java/bisq/core/locale/GlobalSettings.java +++ b/core/src/main/java/bisq/core/locale/GlobalSettings.java @@ -34,7 +34,7 @@ public class GlobalSettings { static { locale = Locale.getDefault(); - // On some systems there is not country defined, in that case we use en_US + // On some systems there is no country defined, in that case we use en_US if (locale.getCountry() == null || locale.getCountry().isEmpty()) locale = Locale.US; } diff --git a/core/src/main/java/bisq/core/locale/Res.java b/core/src/main/java/bisq/core/locale/Res.java index c2cd3ac56fd..af208763767 100644 --- a/core/src/main/java/bisq/core/locale/Res.java +++ b/core/src/main/java/bisq/core/locale/Res.java @@ -133,7 +133,7 @@ class UTF8Control extends ResourceBundle.Control { public ResourceBundle newBundle(String baseName, @NotNull Locale locale, @NotNull String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException { - // The below is a copy of the default implementation. + // Below is a copy of the default implementation. final String bundleName = toBundleName(baseName, locale); final String resourceName = toResourceName(bundleName, "properties"); ResourceBundle bundle = null; @@ -152,7 +152,7 @@ public ResourceBundle newBundle(String baseName, @NotNull Locale locale, @NotNul } if (stream != null) { try { - // Only this line is changed to make it to read properties files as UTF-8. + // Only this line is changed to make it read properties files as UTF-8. bundle = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8")); } finally { stream.close(); diff --git a/core/src/main/java/bisq/core/monetary/AltcoinExchangeRate.java b/core/src/main/java/bisq/core/monetary/AltcoinExchangeRate.java index 2894417a5aa..4064c2c2883 100644 --- a/core/src/main/java/bisq/core/monetary/AltcoinExchangeRate.java +++ b/core/src/main/java/bisq/core/monetary/AltcoinExchangeRate.java @@ -55,7 +55,7 @@ public AltcoinExchangeRate(Altcoin altcoin) { } /** - * Convert a coin amount to a altcoin amount using this exchange rate. + * Convert a coin amount to an altcoin amount using this exchange rate. * * @throws ArithmeticException if the converted altcoin amount is too high or too low. */ diff --git a/core/src/main/java/bisq/core/notifications/MobileModel.java b/core/src/main/java/bisq/core/notifications/MobileModel.java index 90532fb6663..acc11f2483c 100644 --- a/core/src/main/java/bisq/core/notifications/MobileModel.java +++ b/core/src/main/java/bisq/core/notifications/MobileModel.java @@ -132,7 +132,7 @@ boolean parseDescriptor(String descriptor) { iPad Pro 10.5 Inch */ // iPhone 6 does not support isContentAvailable, iPhone 6s and 7 does. - // We don't know for other versions, but lets assume all above iPhone 6 are ok. + // We don't know about other versions, but let's assume all above iPhone 6 are ok. if (descriptor != null) { String[] descriptorTokens = descriptor.split(" "); if (descriptorTokens.length >= 1) { diff --git a/core/src/main/java/bisq/core/notifications/alerts/price/PriceAlert.java b/core/src/main/java/bisq/core/notifications/alerts/price/PriceAlert.java index 70c8ac91709..9f7b258d903 100644 --- a/core/src/main/java/bisq/core/notifications/alerts/price/PriceAlert.java +++ b/core/src/main/java/bisq/core/notifications/alerts/price/PriceAlert.java @@ -77,7 +77,7 @@ private void update() { try { mobileNotificationService.sendMessage(message); - // If we got triggered an alert we remove the filter. + // If an alert got triggered we remove the filter. user.removePriceAlertFilter(); } catch (Exception e) { log.error(e.toString()); diff --git a/core/src/main/java/bisq/core/offer/OfferBookService.java b/core/src/main/java/bisq/core/offer/OfferBookService.java index 5ebe152453c..02d33f2f336 100644 --- a/core/src/main/java/bisq/core/offer/OfferBookService.java +++ b/core/src/main/java/bisq/core/offer/OfferBookService.java @@ -241,7 +241,7 @@ private void doDumpStatistics() { offer.getOfferFeePaymentTxId() ); } catch (Throwable t) { - // In case a offer was corrupted with null values we ignore it + // In case an offer was corrupted with null values we ignore it return null; } }) diff --git a/core/src/main/java/bisq/core/offer/OfferPayload.java b/core/src/main/java/bisq/core/offer/OfferPayload.java index ea7ff0406d5..56a990a7df6 100644 --- a/core/src/main/java/bisq/core/offer/OfferPayload.java +++ b/core/src/main/java/bisq/core/offer/OfferPayload.java @@ -147,13 +147,13 @@ public static protobuf.OfferPayload.Direction toProtoMessage(Direction direction // Close offer when certain price is reached private final boolean useAutoClose; // If useReOpenAfterAutoClose=true we re-open a new offer with the remaining funds if the trade amount - // was less then the offer's max. trade amount. + // was less than the offer's max. trade amount. private final boolean useReOpenAfterAutoClose; // Used when useAutoClose is set for canceling the offer when lowerClosePrice is triggered private final long lowerClosePrice; // Used when useAutoClose is set for canceling the offer when upperClosePrice is triggered private final long upperClosePrice; - // Reserved for possible future use to support private trades where the taker need to have an accessKey + // Reserved for possible future use to support private trades where the taker needs to have an accessKey private final boolean isPrivateOffer; @Nullable private final String hashOfChallenge; diff --git a/core/src/main/java/bisq/core/offer/OfferUtil.java b/core/src/main/java/bisq/core/offer/OfferUtil.java index 3e8ee6213f9..bebf49a6210 100644 --- a/core/src/main/java/bisq/core/offer/OfferUtil.java +++ b/core/src/main/java/bisq/core/offer/OfferUtil.java @@ -206,7 +206,7 @@ static Volume getAdjustedFiatVolume(Volume volumeByAmount, int factor) { * {@code price} and {@code maxTradeLimit} and {@code factor}. * * @param amount Bitcoin amount which is a candidate for getting rounded. - * @param price Price used in relation ot that amount. + * @param price Price used in relation to that amount. * @param maxTradeLimit The max. trade limit of the users account, in satoshis. * @return The adjusted amount */ @@ -223,7 +223,7 @@ public static Coin getAdjustedAmountForHalCash(Coin amount, Price price, long ma * {@code price} and {@code maxTradeLimit} and {@code factor}. * * @param amount Bitcoin amount which is a candidate for getting rounded. - * @param price Price used in relation ot that amount. + * @param price Price used in relation to that amount. * @param maxTradeLimit The max. trade limit of the users account, in satoshis. * @param factor The factor used for rounding. E.g. 1 means rounded to units of * 1 EUR, 10 means rounded to 10 EUR, etc. @@ -233,7 +233,7 @@ public static Coin getAdjustedAmountForHalCash(Coin amount, Price price, long ma static Coin getAdjustedAmount(Coin amount, Price price, long maxTradeLimit, int factor) { checkArgument( amount.getValue() >= 10_000, - "amount needs to be above minimum of 10k satoshi" + "amount needs to be above minimum of 10k satoshis" ); checkArgument( factor > 0, @@ -251,7 +251,7 @@ static Coin getAdjustedAmount(Coin amount, Price price, long maxTradeLimit, int // We use 10 000 satoshi as min allowed amount checkArgument( minTradeAmount >= 10_000, - "MinTradeAmount must be at least 10k satoshi" + "MinTradeAmount must be at least 10k satoshis" ); smallestUnitForAmount = Coin.valueOf(Math.max(minTradeAmount, smallestUnitForAmount.value)); // We don't allow smaller amount values than smallestUnitForAmount diff --git a/core/src/main/java/bisq/core/offer/OpenOfferManager.java b/core/src/main/java/bisq/core/offer/OpenOfferManager.java index bc0c3c8fb0e..8407ae433ab 100644 --- a/core/src/main/java/bisq/core/offer/OpenOfferManager.java +++ b/core/src/main/java/bisq/core/offer/OpenOfferManager.java @@ -290,10 +290,10 @@ private void onBootstrapComplete() { // We republish after a bit as it might be that our connected node still has the offer in the data map // but other peers have it already removed because of expired TTL. // Those other not directly connected peers would not get the broadcast of the new offer, as the first - // connected peer (seed node) does nto broadcast if it has the data in the map. + // connected peer (seed node) does not broadcast if it has the data in the map. // To update quickly to the whole network we repeat the republishOffers call after a few seconds when we - // are better connected to the network. There is no guarantee that all peers will receive it but we have - // also our periodic timer, so after that longer interval the offer should be available to all peers. + // are better connected to the network. There is no guarantee that all peers will receive it but we also + // have our periodic timer, so after that longer interval the offer should be available to all peers. if (retryRepublishOffersTimer == null) retryRepublishOffersTimer = UserThread.runAfter(OpenOfferManager.this::republishOffers, REPUBLISH_AGAIN_AT_STARTUP_DELAY_SEC); @@ -847,8 +847,8 @@ private void republishOffer(OpenOffer openOffer) { offerBookService.addOffer(openOffer.getOffer(), () -> { if (!stopped) { - log.debug("Successful added offer to P2P network"); - // Refresh means we send only the dat needed to refresh the TTL (hash, signature and sequence no.) + log.debug("Successfully added offer to P2P network."); + // Refresh means we send only the data needed to refresh the TTL (hash, signature and sequence no.) if (periodicRefreshOffersTimer == null) startPeriodicRefreshOffersTimer(); } else { @@ -857,7 +857,7 @@ private void republishOffer(OpenOffer openOffer) { }, errorMessage -> { if (!stopped) { - log.error("Add offer to P2P network failed. " + errorMessage); + log.error("Adding offer to P2P network failed. " + errorMessage); stopRetryRepublishOffersTimer(); retryRepublishOffersTimer = UserThread.runAfter(OpenOfferManager.this::republishOffers, RETRY_REPUBLISH_DELAY_SEC); diff --git a/core/src/main/java/bisq/core/offer/messages/OfferAvailabilityRequest.java b/core/src/main/java/bisq/core/offer/messages/OfferAvailabilityRequest.java index 704f73c981d..a3cbd1c9d06 100644 --- a/core/src/main/java/bisq/core/offer/messages/OfferAvailabilityRequest.java +++ b/core/src/main/java/bisq/core/offer/messages/OfferAvailabilityRequest.java @@ -32,7 +32,7 @@ import javax.annotation.Nullable; -// We add here the SupportedCapabilitiesMessage interface as that message always predates a direct connection +// Here we add the SupportedCapabilitiesMessage interface as that message always predates a direct connection // to the trading peer @EqualsAndHashCode(callSuper = true) @Value diff --git a/core/src/main/java/bisq/core/offer/messages/OfferMessage.java b/core/src/main/java/bisq/core/offer/messages/OfferMessage.java index a9b0f3d4559..d72fdc4a276 100644 --- a/core/src/main/java/bisq/core/offer/messages/OfferMessage.java +++ b/core/src/main/java/bisq/core/offer/messages/OfferMessage.java @@ -34,7 +34,7 @@ public abstract class OfferMessage extends NetworkEnvelope implements DirectMessage, UidMessage { public final String offerId; - // Added at version 0.7.1. Can be null if we receive the msg from an peer with an older version + // Added in version 0.7.1. Can be null if we receive the msg from a peer with an older version @Nullable protected final String uid; diff --git a/core/src/main/java/bisq/core/offer/placeoffer/tasks/ValidateOffer.java b/core/src/main/java/bisq/core/offer/placeoffer/tasks/ValidateOffer.java index 70701adc79c..05c88acf468 100644 --- a/core/src/main/java/bisq/core/offer/placeoffer/tasks/ValidateOffer.java +++ b/core/src/main/java/bisq/core/offer/placeoffer/tasks/ValidateOffer.java @@ -70,11 +70,11 @@ protected void run() { "sellerSecurityDeposit must be equal to ProposalConsensus.SELLER_SECURITY_DEPOSIT. " + "sellerSecurityDeposit=" + offer.getSellerSecurityDeposit().toFriendlyString());*/ /*checkArgument(offer.getMinAmount().compareTo(ProposalConsensus.getMinTradeAmount()) >= 0, - "MinAmount is less then " + ProposalConsensus.getMinTradeAmount().toFriendlyString());*/ + "MinAmount is less than " + ProposalConsensus.getMinTradeAmount().toFriendlyString());*/ checkArgument(offer.getAmount().compareTo(offer.getPaymentMethod().getMaxTradeLimitAsCoin(offer.getCurrencyCode())) <= 0, - "Amount is larger then " + offer.getPaymentMethod().getMaxTradeLimitAsCoin(offer.getCurrencyCode()).toFriendlyString()); - checkArgument(offer.getAmount().compareTo(offer.getMinAmount()) >= 0, "MinAmount is larger then Amount"); + "Amount is larger than " + offer.getPaymentMethod().getMaxTradeLimitAsCoin(offer.getCurrencyCode()).toFriendlyString()); + checkArgument(offer.getAmount().compareTo(offer.getMinAmount()) >= 0, "MinAmount is larger than Amount"); checkNotNull(offer.getPrice(), "Price is null"); checkArgument(offer.getPrice().isPositive(), diff --git a/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java b/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java index 0772bcb24fc..d4fe6951515 100644 --- a/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java +++ b/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java @@ -71,7 +71,7 @@ public static boolean isAmountValidForOffer(Offer offer, // TODO might be used to show more details if we get payment methods updates with diff. limits public static String getInfoForMismatchingPaymentMethodLimits(Offer offer, PaymentAccount paymentAccount) { - // dont translate atm as it is not used so far in the UI just for logs + // don't translate atm as it is not used so far in the UI just for logs return "Payment methods have different trade limits or trade periods.\n" + "Our local Payment method: " + paymentAccount.getPaymentMethod().toString() + "\n" + "Payment method from offer: " + offer.getPaymentMethod().toString(); diff --git a/core/src/main/java/bisq/core/payment/TradeLimits.java b/core/src/main/java/bisq/core/payment/TradeLimits.java index 62e825e3eee..2d3c5c56884 100644 --- a/core/src/main/java/bisq/core/payment/TradeLimits.java +++ b/core/src/main/java/bisq/core/payment/TradeLimits.java @@ -83,7 +83,7 @@ public long getRoundedRiskBasedTradeLimit(long maxLimit, long riskFactor) { return getFirstMonthRiskBasedTradeLimit(maxLimit, riskFactor) * 4; } - // The first month we allow only 0.25% of he trade limit. We want to ensure that precision is <=4 otherwise we round. + // The first month we allow only 0.25% of the trade limit. We want to ensure that precision is <=4 otherwise we round. /** * @@ -96,7 +96,7 @@ long getFirstMonthRiskBasedTradeLimit(long maxLimit, long riskFactor) { // The first month we use 1/4 of the max limit. We multiply with riskFactor, so 1/ (4 * 8) is smallest limit in // first month of a maxTradeLimitHighRisk method long smallestLimit = maxLimit / (4 * riskFactor); // e.g. 100000000 / 32 = 3125000 - // We want to avoid more then 4 decimal places (100000000 / 32 = 3125000 or 1 BTC / 32 = 0.03125 BTC). + // We want to avoid more than 4 decimal places (100000000 / 32 = 3125000 or 1 BTC / 32 = 0.03125 BTC). // We want rounding to 0.0313 BTC double decimalForm = MathUtils.scaleDownByPowerOf10((double) smallestLimit, 8); double rounded = MathUtils.roundDouble(decimalForm, 4); diff --git a/core/src/main/java/bisq/core/support/SupportType.java b/core/src/main/java/bisq/core/support/SupportType.java index cd10cc024ff..9444e7381d4 100644 --- a/core/src/main/java/bisq/core/support/SupportType.java +++ b/core/src/main/java/bisq/core/support/SupportType.java @@ -20,7 +20,7 @@ import bisq.common.proto.ProtoUtil; public enum SupportType { - ARBITRATION, // Need to be at index 0 to be the fall back for old clients + ARBITRATION, // Need to be at index 0 to be the fallback for old clients MEDIATION, TRADE, REFUND; diff --git a/core/src/main/java/bisq/core/support/dispute/DisputeManager.java b/core/src/main/java/bisq/core/support/dispute/DisputeManager.java index 1edb7cbc3b7..6a4036a18aa 100644 --- a/core/src/main/java/bisq/core/support/dispute/DisputeManager.java +++ b/core/src/main/java/bisq/core/support/dispute/DisputeManager.java @@ -145,7 +145,7 @@ public void addAndPersistChatMessage(ChatMessage message) { if (dispute.getChatMessages().stream().noneMatch(m -> m.getUid().equals(message.getUid()))) { dispute.addAndPersistChatMessage(message); } else { - log.warn("We got a chatMessage what we have already stored. UId = {} TradeId = {}", + log.warn("We got a chatMessage that we have already stored. UId = {} TradeId = {}", message.getUid(), message.getTradeId()); } }); diff --git a/core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentService.java b/core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentService.java index 193ba9a7684..2a5c284f2b4 100644 --- a/core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentService.java +++ b/core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentService.java @@ -110,7 +110,7 @@ public Map getDisputeAgents() { if (!map.containsKey(disputeAgentNodeAddress)) map.put(disputeAgentNodeAddress, disputeAgent); else - log.warn("disputeAgentAddress already exist in disputeAgent map. Seems an disputeAgent object is already registered with the same address."); + log.warn("disputeAgentAddress already exists in disputeAgent map. Seems a disputeAgent object is already registered with the same address."); } return map; } diff --git a/core/src/main/java/bisq/core/support/dispute/arbitration/ArbitrationManager.java b/core/src/main/java/bisq/core/support/dispute/arbitration/ArbitrationManager.java index 233955cfbf2..e063e1c8528 100644 --- a/core/src/main/java/bisq/core/support/dispute/arbitration/ArbitrationManager.java +++ b/core/src/main/java/bisq/core/support/dispute/arbitration/ArbitrationManager.java @@ -207,7 +207,7 @@ public void onDisputeResultMessage(DisputeResultMessage disputeResultMessage) { dispute.setIsClosed(true); if (dispute.disputeResultProperty().get() != null) { - log.warn("We got already a dispute result. That should only happen if a dispute needs to be closed " + + log.warn("We already got a dispute result. That should only happen if a dispute needs to be closed " + "again because the first close did not succeed. TradeId = " + tradeId); } @@ -288,7 +288,7 @@ public void onFailure(TxBroadcastException exception) { success = false; } } else { - log.warn("We got already a payout tx. That might be the case if the other peer did not get the " + + log.warn("We already got a payout tx. That might be the case if the other peer did not get the " + "payout tx and opened a dispute. TradeId = " + tradeId); dispute.setDisputePayoutTxId(payoutTx.getHashAsString()); sendPeerPublishedPayoutTxMessage(payoutTx, dispute, contract); diff --git a/core/src/main/java/bisq/core/support/traderchat/TraderChatManager.java b/core/src/main/java/bisq/core/support/traderchat/TraderChatManager.java index 4f631ef8532..a7c404a5346 100644 --- a/core/src/main/java/bisq/core/support/traderchat/TraderChatManager.java +++ b/core/src/main/java/bisq/core/support/traderchat/TraderChatManager.java @@ -122,7 +122,7 @@ public void addAndPersistChatMessage(ChatMessage message) { } trade.addAndPersistChatMessage(message); } else { - log.warn("Trade got a chatMessage what we have already stored. UId = {} TradeId = {}", + log.warn("Trade got a chatMessage that we have already stored. UId = {} TradeId = {}", message.getUid(), message.getTradeId()); } }); diff --git a/core/src/main/java/bisq/core/trade/Trade.java b/core/src/main/java/bisq/core/trade/Trade.java index 24c82180e1b..f9a6b89d904 100644 --- a/core/src/main/java/bisq/core/trade/Trade.java +++ b/core/src/main/java/bisq/core/trade/Trade.java @@ -685,9 +685,9 @@ public Transaction getDelayedPayoutTx() { return delayedPayoutTx; } - // We don't need to persist the msg as if we dont apply it it will not be removed from the P2P network and we - // will received it again at next startup. Such might happen in edge cases when the user shuts down after we - // received the msb but before the init is called. + // We don't need to persist the msg as if we don't apply it it will not be removed from the P2P network and we + // will receive it again on next startup. This might happen in edge cases when the user shuts down after we + // received the msg but before the init is called. void addDecryptedMessageWithPubKey(DecryptedMessageWithPubKey decryptedMessageWithPubKey) { if (!decryptedMessageWithPubKeySet.contains(decryptedMessageWithPubKey)) { decryptedMessageWithPubKeySet.add(decryptedMessageWithPubKey); diff --git a/core/src/main/java/bisq/core/trade/protocol/SellerAsMakerProtocol.java b/core/src/main/java/bisq/core/trade/protocol/SellerAsMakerProtocol.java index f5090965295..3c6b22c22a6 100644 --- a/core/src/main/java/bisq/core/trade/protocol/SellerAsMakerProtocol.java +++ b/core/src/main/java/bisq/core/trade/protocol/SellerAsMakerProtocol.java @@ -202,7 +202,7 @@ private void handle(CounterCurrencyTransferStartedMessage tradeMessage, NodeAddr // Called from UI /////////////////////////////////////////////////////////////////////////////////////////// - // User clicked the "bank transfer received" button, so we release the funds for pay out + // User clicked the "bank transfer received" button, so we release the funds for payout @Override public void onFiatPaymentReceived(ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) { if (trade.getPayoutTx() == null) { @@ -229,7 +229,7 @@ public void onFiatPaymentReceived(ResultHandler resultHandler, ErrorMessageHandl } else { // we don't set the state as we have already a later phase reached log.info("onFiatPaymentReceived called twice. " + - "That can happen if message did not arrive first time and we send msg again.\n" + + "That can happen if message did not arrive the first time and we send msg again.\n" + "state=" + sellerAsMakerTrade.getState()); TradeTaskRunner taskRunner = new TradeTaskRunner(sellerAsMakerTrade, diff --git a/core/src/main/java/bisq/core/trade/protocol/SellerAsTakerProtocol.java b/core/src/main/java/bisq/core/trade/protocol/SellerAsTakerProtocol.java index fa4c4d3d0c5..9e940b468a7 100644 --- a/core/src/main/java/bisq/core/trade/protocol/SellerAsTakerProtocol.java +++ b/core/src/main/java/bisq/core/trade/protocol/SellerAsTakerProtocol.java @@ -192,7 +192,7 @@ private void handle(CounterCurrencyTransferStartedMessage tradeMessage, NodeAddr // Called from UI /////////////////////////////////////////////////////////////////////////////////////////// - // User clicked the "bank transfer received" button, so we release the funds for pay out + // User clicked the "bank transfer received" button, so we release the funds for payout @Override public void onFiatPaymentReceived(ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) { if (trade.getPayoutTx() == null) { @@ -219,7 +219,7 @@ public void onFiatPaymentReceived(ResultHandler resultHandler, ErrorMessageHandl } else { // we don't set the state as we have already a higher phase reached log.info("onFiatPaymentReceived called twice. " + - "That can happen if message did not arrive first time and we send msg again.\n" + + "That can happen if message did not arrive the first time and we send msg again.\n" + "state=" + sellerAsTakerTrade.getState()); TradeTaskRunner taskRunner = new TradeTaskRunner(sellerAsTakerTrade, diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java b/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java index 2b9010fe653..66738cda282 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java @@ -66,7 +66,7 @@ protected void run() { NodeAddress mediatorNodeAddress = trade.getMediatorNodeAddress(); if (mediatorNodeAddress != null) { - // The first 4 chars are sufficient to identify an mediator. + // The first 4 chars are sufficient to identify a mediator. // For testing with regtest/localhost we use the full address as its localhost and would result in // same values for multiple mediators. NetworkNode networkNode = model.getProcessModel().getP2PService().getNetworkNode(); diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerVerifiesDelayedPayoutTx.java b/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerVerifiesDelayedPayoutTx.java index 3ec30a67786..fb98001183a 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerVerifiesDelayedPayoutTx.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerVerifiesDelayedPayoutTx.java @@ -45,7 +45,7 @@ protected void run() { if (processModel.getTradeWalletService().verifiesDepositTxAndDelayedPayoutTx(depositTx, delayedPayoutTx)) { complete(); } else { - failed("DelayedPayoutTx is not spending correctly depositTx"); + failed("DelayedPayoutTx is not spending depositTx correctly"); } } catch (Throwable t) { failed(t); diff --git a/core/src/main/java/bisq/core/user/Preferences.java b/core/src/main/java/bisq/core/user/Preferences.java index d022eb9dae9..a8933201f2f 100644 --- a/core/src/main/java/bisq/core/user/Preferences.java +++ b/core/src/main/java/bisq/core/user/Preferences.java @@ -261,7 +261,7 @@ public void readPersisted() { baseCurrencyNetwork.isDaoBetaNet() ? BSQ_BETA_NET_EXPLORER : BSQ_TEST_NET_EXPLORER); - // We don't want to pass Preferences to all popups where the dont show again checkbox is used, so we use + // We don't want to pass Preferences to all popups where the don't show again checkbox is used, so we use // that static lookup class to avoid static access to the Preferences directly. DontShowAgainLookup.setPreferences(this); @@ -568,7 +568,7 @@ public void setBridgeAddresses(List bridgeAddresses) { storage.queueUpForSave(prefPayload, 1); } - // Only used from PB but keep it explicit as maybe it get used from the client and then we want to persist + // Only used from PB but keep it explicit as it may be used from the client and then we want to persist public void setPeerTagMap(Map peerTagMap) { prefPayload.setPeerTagMap(peerTagMap); persist(); diff --git a/core/src/main/java/bisq/core/util/ParsingUtils.java b/core/src/main/java/bisq/core/util/ParsingUtils.java index 1be01f71af1..b9910f5fbd8 100644 --- a/core/src/main/java/bisq/core/util/ParsingUtils.java +++ b/core/src/main/java/bisq/core/util/ParsingUtils.java @@ -61,7 +61,7 @@ public static long parsePriceStringToLong(String currencyCode, String amount, in } public static String convertCharsForNumber(String input) { - // Some languages like finnish use the long dash for the minus + // Some languages like Finnish use the long dash for the minus input = input.replace("−", "-"); input = StringUtils.deleteWhitespace(input); return input.replace(",", "."); diff --git a/core/src/main/java/bisq/core/util/coin/BsqFormatter.java b/core/src/main/java/bisq/core/util/coin/BsqFormatter.java index 9a39930b9ba..097550c835e 100644 --- a/core/src/main/java/bisq/core/util/coin/BsqFormatter.java +++ b/core/src/main/java/bisq/core/util/coin/BsqFormatter.java @@ -55,9 +55,9 @@ public class BsqFormatter implements CoinFormatter { private final ImmutableCoinFormatter immutableCoinFormatter; // We don't support localized formatting. Format is always using "." as decimal mark and no grouping separator. - // Input of "," as decimal mark (like in german locale) will be replaced with ".". - // Input of a group separator (1,123,45) lead to an validation error. - // Note: BtcFormat was intended to be used, but it lead to many problems (automatic format to mBit, + // Input of "," as decimal mark (like in German locale) will be replaced with ".". + // Input of a group separator (1,123,45) leads to a validation error. + // Note: BtcFormat was intended to be used, but it leads to many problems (automatic format to mBit, // no way to remove grouping separator). It seems to be not optimal for user input formatting. @Getter private MonetaryFormat monetaryFormat; diff --git a/core/src/test/java/bisq/core/offer/OfferUtilTest.java b/core/src/test/java/bisq/core/offer/OfferUtilTest.java index 9239b20dfa4..2c7093d1ccc 100644 --- a/core/src/test/java/bisq/core/offer/OfferUtilTest.java +++ b/core/src/test/java/bisq/core/offer/OfferUtilTest.java @@ -49,7 +49,7 @@ public void testGetAdjustedAmount() { } catch (IllegalArgumentException iae) { Assert.assertEquals( "Unexpected exception message.", - "amount needs to be above minimum of 10k satoshi", + "amount needs to be above minimum of 10k satoshis", iae.getMessage() ); }