Refactoring: rename, cleanups

This commit is contained in:
chimp1984 2020-09-22 19:35:24 -05:00
parent 4b7307e07f
commit 8ce5ebadea
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
2 changed files with 4 additions and 11 deletions

View File

@ -47,7 +47,7 @@ public class SellerSendsDepositTxAndDelayedPayoutTxMessage extends SendMailboxMe
private static final int MAX_RESEND_ATTEMPTS = 7;
private int delayInSec = 4;
private int resendCounter = 0;
private DepositTxAndDelayedPayoutTxMessage depositTxAndDelayedPayoutTxMessage;
private DepositTxAndDelayedPayoutTxMessage message;
private ChangeListener<MessageState> listener;
private Timer timer;
@ -57,20 +57,20 @@ public class SellerSendsDepositTxAndDelayedPayoutTxMessage extends SendMailboxMe
@Override
protected TradeMessage getMessage(String tradeId) {
if (depositTxAndDelayedPayoutTxMessage == null) {
if (message == null) {
// We do not use a real unique ID here as we want to be able to re-send the exact same message in case the
// peer does not respond with an ACK msg in a certain time interval. To avoid that we get dangling mailbox
// messages where only the one which gets processed by the peer would be removed we use the same uid. All
// other data stays the same when we re-send the message at any time later.
String deterministicId = tradeId + processModel.getMyNodeAddress().getFullAddress();
depositTxAndDelayedPayoutTxMessage = new DepositTxAndDelayedPayoutTxMessage(
message = new DepositTxAndDelayedPayoutTxMessage(
deterministicId,
processModel.getOfferId(),
processModel.getMyNodeAddress(),
checkNotNull(trade.getDepositTx()).bitcoinSerialize(),
checkNotNull(trade.getDelayedPayoutTx()).bitcoinSerialize());
}
return depositTxAndDelayedPayoutTxMessage;
return message;
}
@Override

View File

@ -513,20 +513,13 @@ public class BuyerStep2View extends TradeStepView {
}
private void confirmPaymentStarted() {
// confirmButton.setDisable(true);
busyAnimation.play();
statusLabel.setText(Res.get("shared.sendingConfirmation"));
if (trade.isFiatSent())
trade.setState(Trade.State.DEPOSIT_CONFIRMED_IN_BLOCK_CHAIN);
model.dataModel.onPaymentStarted(() -> {
// In case the first send failed we got the support button displayed.
// If it succeeds at a second try we remove the support button again.
//TODO check for support. in case of a dispute we dont want to hide the button
//if (notificationGroup != null)
// notificationGroup.setButtonVisible(false);
}, errorMessage -> {
// confirmButton.setDisable(false);
busyAnimation.stop();
new Popup().warning(Res.get("popup.warning.sendMsgFailed")).show();
});