Skip to content

Commit

Permalink
Merge pull request #5679 from jmacxx/fix_deposit_received_from_networ…
Browse files Browse the repository at this point in the history
…k_issue

Fix failed trade / missing payment information
  • Loading branch information
ripcurlx committed Sep 6, 2021
2 parents 5595f7d + 74f7061 commit e8f417f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/src/main/java/bisq/core/trade/protocol/BuyerProtocol.java
Expand Up @@ -93,21 +93,22 @@ public void onMailboxMessage(TradeMessage message, NodeAddress peer) {

protected abstract void handle(DelayedPayoutTxSignatureRequest message, NodeAddress peer);

// The DepositTxAndDelayedPayoutTxMessage is a mailbox message as earlier we use only the deposit tx which can
// be also with from the network once published.
// The DepositTxAndDelayedPayoutTxMessage is a mailbox message. Earlier we used only the deposit tx which can
// be set also when received by the network once published by the peer so that message was not mandatory and could
// have arrived as mailbox message.
// Now we send the delayed payout tx as well and with that this message is mandatory for continuing the protocol.
// We do not support mailbox message handling during the take offer process as it is expected that both peers
// are online.
// For backward compatibility and extra resilience we still keep DepositTxAndDelayedPayoutTxMessage as a
// mailbox message but the stored in mailbox case is not expected and the seller would try to send the message again
// in the hope to reach the buyer directly.
// in the hope to reach the buyer directly in case of network issues.
protected void handle(DepositTxAndDelayedPayoutTxMessage message, NodeAddress peer) {
expect(anyPhase(Trade.Phase.TAKER_FEE_PUBLISHED, Trade.Phase.DEPOSIT_PUBLISHED)
.with(message)
.from(peer)
.preCondition(trade.getDepositTx() == null || trade.getDelayedPayoutTx() == null,
.preCondition(trade.getDepositTx() == null || processModel.getTradingPeer().getPaymentAccountPayload() == null,
() -> {
log.warn("We with a DepositTxAndDelayedPayoutTxMessage but we have already processed the deposit and " +
log.warn("We received a DepositTxAndDelayedPayoutTxMessage but we have already processed the deposit and " +
"delayed payout tx so we ignore the message. This can happen if the ACK message to the peer did not " +
"arrive and the peer repeats sending us the message. We send another ACK msg.");
stopTimeout();
Expand Down

0 comments on commit e8f417f

Please sign in to comment.