mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-20 10:22:18 +01:00
handle stopTimer at end of tasks
This commit is contained in:
parent
66ecf2c74a
commit
a46cb5317e
@ -365,7 +365,7 @@ createOffer.useLowerValue=Yes, use my lower value
|
||||
createOffer.priceOutSideOfDeviation=The price you have entered is outside the max. allowed deviation from the market price.\nThe max. allowed deviation is {0} and can be adjusted in the preferences.
|
||||
createOffer.changePrice=Change price
|
||||
createOffer.tac=With placing that offer I agree to trade with any trader who fulfills the conditions as defined above.
|
||||
createOffer.currencyForFee=Currency for maker fee
|
||||
createOffer.currencyForFee=Maker fee
|
||||
createOffer.feeCurrencyAndDeposit=Set fee currency and security deposit
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@ import com.google.inject.Inject;
|
||||
import io.bisq.common.handlers.ExceptionHandler;
|
||||
import io.bisq.common.handlers.ResultHandler;
|
||||
import io.bisq.common.locale.Res;
|
||||
import io.bisq.core.app.BisqEnvironment;
|
||||
import io.bisq.core.crypto.ScryptUtil;
|
||||
import org.bitcoinj.crypto.KeyCrypter;
|
||||
import org.bitcoinj.crypto.KeyCrypterScrypt;
|
||||
@ -68,10 +69,12 @@ public class WalletsManager {
|
||||
}
|
||||
|
||||
public String getWalletsAsString(boolean includePrivKeys) {
|
||||
return Res.getBaseCurrencyCode() + " Wallet:\n" +
|
||||
btcWalletService.getWalletAsString(includePrivKeys) +
|
||||
"\n\nBSQ Wallet:\n" +
|
||||
bsqWalletService.getWalletAsString(includePrivKeys);
|
||||
final String baseCurrencyWalletDetails = Res.getBaseCurrencyCode() + " Wallet:\n" +
|
||||
btcWalletService.getWalletAsString(includePrivKeys);
|
||||
final String bsqWalletDetails = BisqEnvironment.isBaseCurrencySupportingBsq() ?
|
||||
"\n\nBSQ Wallet:\n" + bsqWalletService.getWalletAsString(includePrivKeys) :
|
||||
"";
|
||||
return baseCurrencyWalletDetails + bsqWalletDetails;
|
||||
}
|
||||
|
||||
public void restoreSeedWords(@Nullable DeterministicSeed seed, ResultHandler resultHandler, ExceptionHandler exceptionHandler) {
|
||||
@ -87,11 +90,11 @@ public class WalletsManager {
|
||||
}
|
||||
|
||||
public boolean areWalletsEncrypted() {
|
||||
return btcWalletService.isEncrypted() && bsqWalletService.isEncrypted();
|
||||
return btcWalletService.isEncrypted() && (!BisqEnvironment.isBaseCurrencySupportingBsq() || bsqWalletService.isEncrypted());
|
||||
}
|
||||
|
||||
public boolean areWalletsAvailable() {
|
||||
return btcWalletService.isWalletReady() && bsqWalletService.isWalletReady();
|
||||
return btcWalletService.isWalletReady() && (!BisqEnvironment.isBaseCurrencySupportingBsq() || bsqWalletService.isWalletReady());
|
||||
}
|
||||
|
||||
public KeyCrypterScrypt getKeyCrypterScrypt() {
|
||||
|
@ -131,12 +131,14 @@ public class BuyerAsMakerProtocol extends TradeProtocol implements BuyerProtocol
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void handle(DepositTxPublishedMessage tradeMessage, NodeAddress peerNodeAddress) {
|
||||
stopTimeout();
|
||||
processModel.setTradeMessage(tradeMessage);
|
||||
processModel.setTempTradingPeerNodeAddress(peerNodeAddress);
|
||||
|
||||
TradeTaskRunner taskRunner = new TradeTaskRunner(buyerAsMakerTrade,
|
||||
() -> handleTaskRunnerSuccess("handle DepositTxPublishedMessage"),
|
||||
() -> {
|
||||
stopTimeout();
|
||||
handleTaskRunnerSuccess("handle DepositTxPublishedMessage");
|
||||
},
|
||||
this::handleTaskRunnerFault);
|
||||
taskRunner.addTasks(MakerProcessDepositTxPublishedMessage.class,
|
||||
MakerVerifyTakerAccount.class,
|
||||
|
@ -112,12 +112,14 @@ public class BuyerAsTakerProtocol extends TradeProtocol implements BuyerProtocol
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void handle(PublishDepositTxRequest tradeMessage, NodeAddress sender) {
|
||||
stopTimeout();
|
||||
processModel.setTradeMessage(tradeMessage);
|
||||
processModel.setTempTradingPeerNodeAddress(sender);
|
||||
|
||||
TradeTaskRunner taskRunner = new TradeTaskRunner(buyerAsTakerTrade,
|
||||
() -> handleTaskRunnerSuccess("PublishDepositTxRequest"),
|
||||
() -> {
|
||||
stopTimeout();
|
||||
handleTaskRunnerSuccess("PublishDepositTxRequest");
|
||||
},
|
||||
this::handleTaskRunnerFault);
|
||||
taskRunner.addTasks(
|
||||
TakerProcessPublishDepositTxRequest.class,
|
||||
|
@ -122,12 +122,14 @@ public class SellerAsMakerProtocol extends TradeProtocol implements SellerProtoc
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void handle(DepositTxPublishedMessage tradeMessage, NodeAddress sender) {
|
||||
stopTimeout();
|
||||
processModel.setTradeMessage(tradeMessage);
|
||||
processModel.setTempTradingPeerNodeAddress(sender);
|
||||
|
||||
TradeTaskRunner taskRunner = new TradeTaskRunner(sellerAsMakerTrade,
|
||||
() -> handleTaskRunnerSuccess("DepositTxPublishedMessage"),
|
||||
() -> {
|
||||
stopTimeout();
|
||||
handleTaskRunnerSuccess("DepositTxPublishedMessage");
|
||||
},
|
||||
this::handleTaskRunnerFault);
|
||||
|
||||
taskRunner.addTasks(MakerProcessDepositTxPublishedMessage.class,
|
||||
|
@ -106,13 +106,14 @@ public class SellerAsTakerProtocol extends TradeProtocol implements SellerProtoc
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void handle(PublishDepositTxRequest tradeMessage, NodeAddress sender) {
|
||||
log.debug("handle RequestPayDepositMessage");
|
||||
stopTimeout();
|
||||
processModel.setTradeMessage(tradeMessage);
|
||||
processModel.setTempTradingPeerNodeAddress(sender);
|
||||
|
||||
TradeTaskRunner taskRunner = new TradeTaskRunner(sellerAsTakerTrade,
|
||||
() -> handleTaskRunnerSuccess("PayDepositRequest"),
|
||||
() -> {
|
||||
stopTimeout();
|
||||
handleTaskRunnerSuccess("PublishDepositTxRequest");
|
||||
},
|
||||
this::handleTaskRunnerFault);
|
||||
|
||||
taskRunner.addTasks(
|
||||
|
@ -110,7 +110,7 @@ public abstract class TradeProtocol {
|
||||
stopTimeout();
|
||||
|
||||
timeoutTimer = UserThread.runAfter(() -> {
|
||||
log.error("Timeout reached. TradeID=" + trade.getId());
|
||||
log.error("Timeout reached. TradeID={}, state={}", trade.getId(), trade.stateProperty().get());
|
||||
trade.setErrorMessage("A timeout occurred.");
|
||||
cleanupTradableOnFault();
|
||||
cleanup();
|
||||
|
Loading…
Reference in New Issue
Block a user