forked from bisq-network/bisq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add keyboard shortcut for trade process refresh, fix bisq-network#3905
Trades have been getting stuck in the `Wait for payment` state, perhaps due to lost mailbox messages, but it's hard to know for sure. There is currently no way to get out of this state except going to mediation. With ctrl+R the seller can ask the buyer to refresh the current trade state and the buyer will resend the `CounterCurrencyTransferStartedMessage` if they are in the phase FIAT_SENT.
- Loading branch information
Showing
7 changed files
with
185 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
core/src/main/java/bisq/core/trade/messages/RefreshTradeStateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* This file is part of Bisq. | ||
* | ||
* Bisq is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* Bisq is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public | ||
* License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package bisq.core.trade.messages; | ||
|
||
import bisq.network.p2p.MailboxMessage; | ||
import bisq.network.p2p.NodeAddress; | ||
|
||
import bisq.common.app.Version; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Value; | ||
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Value | ||
public class RefreshTradeStateRequest extends TradeMessage implements MailboxMessage { | ||
private final NodeAddress senderNodeAddress; | ||
|
||
public RefreshTradeStateRequest(String uid, | ||
String tradeId, | ||
NodeAddress senderNodeAddress) { | ||
this(Version.getP2PMessageVersion(), | ||
uid, | ||
tradeId, | ||
senderNodeAddress); | ||
} | ||
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////// | ||
// PROTO BUFFER | ||
/////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
private RefreshTradeStateRequest(int messageVersion, | ||
String uid, | ||
String tradeId, | ||
NodeAddress senderNodeAddress) { | ||
super(messageVersion, tradeId, uid); | ||
this.senderNodeAddress = senderNodeAddress; | ||
} | ||
|
||
@Override | ||
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() { | ||
final protobuf.RefreshTradeStateRequest.Builder builder = protobuf.RefreshTradeStateRequest.newBuilder(); | ||
builder.setUid(uid) | ||
.setTradeId(tradeId) | ||
.setSenderNodeAddress(senderNodeAddress.toProtoMessage()); | ||
return getNetworkEnvelopeBuilder().setRefreshTradeStateRequest(builder).build(); | ||
} | ||
|
||
public static RefreshTradeStateRequest fromProto(protobuf.RefreshTradeStateRequest proto, int messageVersion) { | ||
return new RefreshTradeStateRequest(messageVersion, | ||
proto.getUid(), | ||
proto.getTradeId(), | ||
NodeAddress.fromProto(proto.getSenderNodeAddress())); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "RefreshTradeStateRequest{" + | ||
"\n senderNodeAddress=" + senderNodeAddress + | ||
"\n} " + super.toString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters