Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for disputes for donation address #4136

Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions core/src/main/java/bisq/core/support/dispute/Dispute.java
Expand Up @@ -275,10 +275,7 @@ public static Dispute fromProto(protobuf.Dispute proto, CoreProtoResolver corePr
dispute.setDelayedPayoutTxId(delayedPayoutTxId);
}

String donationAddressOfDelayedPayoutTx = proto.getDonationAddressOfDelayedPayoutTx();
if (!donationAddressOfDelayedPayoutTx.isEmpty()) {
dispute.setDonationAddressOfDelayedPayoutTx(donationAddressOfDelayedPayoutTx);
}
dispute.setDonationAddressOfDelayedPayoutTx(ProtoUtil.stringOrNullFromProto(proto.getDonationAddressOfDelayedPayoutTx()));

return dispute;
}
Expand Down
Expand Up @@ -376,7 +376,7 @@ protected void onPeerOpenedDisputeMessage(PeerOpenedDisputeMessage peerOpenedDis
String donationAddressOfDelayedPayoutTx = dispute.getDonationAddressOfDelayedPayoutTx();
if (donationAddressOfDelayedPayoutTx != null) {
checkArgument(address.toString().equals(donationAddressOfDelayedPayoutTx),
"donationAddressOfDelayedPayoutTx from peers dispute must match own address");
"donationAddressOfDelayedPayoutTx from peers dispute must match address used in delayedPayoutTx");
}

if (!isAgent(dispute)) {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Expand Up @@ -216,6 +216,7 @@ shared.refundAgent=Arbitrator
shared.refundAgentForSupportStaff=Refund agent
shared.delayedPayoutTxId=Delayed payout transaction ID
shared.donationAddressOfDelayedPayoutTx=Donation address of delayed payout transaction
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.


####################################################################
Expand Down
Expand Up @@ -231,7 +231,7 @@ public void activate() {
if (DevEnv.isDevMode()) {
UserThread.runAfter(() -> {
amount.set("0.001");
price.set("50000"); // for CNY
price.set("0.0001"); // for BSQ
minAmount.set(amount.get());
onFocusOutPriceAsPercentageTextField(true, false);
applyMakerFee();
Expand Down
Expand Up @@ -737,7 +737,7 @@ private void doClose(Button closeTicketButton) {
text += Res.get("disputeSummaryWindow.close.nextStepsForRefundAgentArbitration");
}

disputeManager.sendDisputeResultMessage(disputeResult, dispute, text);
checkNotNull(getDisputeManager(dispute)).sendDisputeResultMessage(disputeResult, dispute, text);

if (peersDisputeOptional.isPresent() && !peersDisputeOptional.get().isClosed() && !DevEnv.isDevMode()) {
UserThread.runAfter(() -> new Popup()
Expand Down
Expand Up @@ -48,6 +48,7 @@
public abstract class DisputeAgentView extends DisputeView {

private final DaoFacade daoFacade;
private ListChangeListener<Dispute> disputesWithInvalidDonationAddressListener;

public DisputeAgentView(DisputeManager<? extends DisputeList<? extends DisputeList>> disputeManager,
KeyRing keyRing,
Expand Down Expand Up @@ -80,7 +81,7 @@ public void initialize() {
filterBox.setVisible(true);
filterBox.setManaged(true);

ListChangeListener<Dispute> disputesWithInvalidDonationAddressListener = c -> {
disputesWithInvalidDonationAddressListener = c -> {
c.next();
if (c.wasAdded()) {
c.getAddedSubList().forEach(dispute -> {
Expand All @@ -92,9 +93,20 @@ public void initialize() {
});
}
};
}

@Override
protected void activate() {
super.activate();
disputeManager.getDisputesWithInvalidDonationAddress().addListener(disputesWithInvalidDonationAddressListener);
}

@Override
protected void deactivate() {
super.deactivate();
disputeManager.getDisputesWithInvalidDonationAddress().removeListener(disputesWithInvalidDonationAddressListener);
}

@Override
protected void applyFilteredListPredicate(String filterString) {
// If in arbitrator view we must only display disputes where we are selected as arbitrator (must not receive others anyway)
Expand Down
Expand Up @@ -67,7 +67,9 @@ public ArbitratorView(ArbitrationManager arbitrationManager,
AccountAgeWitnessService accountAgeWitnessService,
@Named(Config.USE_DEV_PRIVILEGE_KEYS) boolean useDevPrivilegeKeys,
DaoFacade daoFacade,
SignPaymentAccountsWindow signPaymentAccountsWindow) {
SignPaymentAccountsWindow signPaymentAccountsWindow,
SignSpecificWitnessWindow signSpecificWitnessWindow,
SignUnsignedPubKeysWindow signUnsignedPubKeysWindow) {
super(arbitrationManager,
keyRing,
tradeManager,
Expand Down