Skip to content

Commit

Permalink
Fix typos and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rex4539 committed Nov 20, 2019
1 parent ab214d3 commit 587b55d
Show file tree
Hide file tree
Showing 87 changed files with 177 additions and 177 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/app/BisqExecutable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/bisq/core/app/BisqSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")));
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/app/SetupUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/btc/BitcoinModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/bisq/core/btc/model/AddressEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1110,7 +1110,7 @@ private SendRequest getSendRequestForMultipleAddresses(Set<String> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.


Expand Down Expand Up @@ -437,7 +437,7 @@ private PreparedDepositTxAndMakerInputs makerCreatesDepositTx(boolean makerIsBuy
List<TransactionInput> 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)
Expand All @@ -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));

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
Loading

0 comments on commit 587b55d

Please sign in to comment.