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 shortcut to move failed trade to pending trades #3809

Closed
wants to merge 1 commit into from

Conversation

sqrrm
Copy link
Member

@sqrrm sqrrm commented Dec 19, 2019

Looking at #3764 and #3794 to see how to unlock the funds and get to arbitration. This PR adds a shortcut (ctrl+y, same as moving it from pending to failed) to move back the trade from failed trades to pending trades.

Testing

I have run this in regtest.

  1. Old trades I had in failed (I don't know their history or how they got there), moved to pending and opening a dispute works. Nothing to pay out as they didn't have any locked funds.
  2. Created a trade, took it to mediation, closed the popup and moved trade to failed (with ctrl+y). Moved it back to pending trades (ctrl+y). Waited until time locked tx could be broadcast and opened a dispute. Worked as a normal dispute with refund agent.

@sqrrm sqrrm requested a review from ripcurlx as a code owner December 19, 2019 13:34
@chimp1984
Copy link
Contributor

Old trades I had in failed (I don't know their history or how they got there), moved to pending and opening a dispute works. Nothing to pay out as they didn't have any locked funds.

If there is no deposit tx I think it does not make any sense to use mediation. Normal support needs to handle such cases. Mediators should not be used for such cases.

@chimp1984
Copy link
Contributor

A motivation why to not let it to mediation was also to avoid that invalid txs, spead around by making invalid payouts which will further "infect" new offeers/trades. We had cases where the payout was an invalid tx and the utxo was used as inout for the next offers/trades. Enabling mediation for trades where the deposit tx is not valid/not existing will re-open that risk again.

Copy link
Contributor

@chimp1984 chimp1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK, see comments...

I think if we allow that it must check the deposit tx, if it is null there is no reason why to open mediation. If it is another reason (e.g. we received an error from BitcoinJ that tx was invalid) we have to check for that as well to avoid that a invalid tx spread further by causing a invalid payout from mediator.

@@ -74,4 +74,7 @@ private void applyList() {
list.sort((o1, o2) -> o2.getTrade().getDate().compareTo(o1.getTrade().getDate()));
}

public void unfailTrade(Trade trade) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would find a name like "revertFailedTradeToPending" more clear.

@sqrrm
Copy link
Member Author

sqrrm commented Dec 19, 2019

NACK, see comments...

I think if we allow that it must check the deposit tx, if it is null there is no reason why to open mediation. If it is another reason (e.g. we received an error from BitcoinJ that tx was invalid) we have to check for that as well to avoid that a invalid tx spread further by causing a invalid payout from mediator.

Do you think it's worth continuing this effort to unfail (or revertToPending if you prefer) trades or should we scrap it? Have you seen trades with actual locked funds from the NTP end up in failed trades? Anything related to old trade protocol doesn't seem worth the risk, and I agree that users should not open disputes for failed trades with with deposit tx.

@chimp1984
Copy link
Contributor

I have not seen any 'valid" case so far. Only screwed up cases with update to 1.2. I would suggest to wait until we are shure that it is needed on some case, but even then we should rather fix the reason why it was moved to failed trades.

@sqrrm
Copy link
Member Author

sqrrm commented Dec 19, 2019

I will close this PR since there might be more drawbacks than benefits from the sound of it.

@sqrrm sqrrm closed this Dec 19, 2019
@wiz
Copy link
Member

wiz commented Dec 20, 2019

Request to re-open this PR. I am helping a user who needs this exact use case. His trade got moved to failed trades, but somehow the TX got confirmed later and he needs to move it back now and complete the trade.

@chimp1984
Copy link
Contributor

@wiz Tell the user to PM me n keybase, I will help him. We should not add hacks to the software for exceptional bugs which are often already fixed (if not we should find out what caused it and fix it). I just improved the handling for failed trades with a new PR. We get into weird "endless loops" situations when software tries to move to failed trades and a shortcut allows to move it back....

@wiz
Copy link
Member

wiz commented Dec 25, 2019

@chimp1984 I respectfully disagree because if the trade state == DEPOSIT_CONFIRMED then there cannot be an endless loop, right? Today I needed to use this patch to fix my own trade so I think it is needed, we can just add some sanity to checks to prevent the "endless loops" situation you describe

@wiz
Copy link
Member

wiz commented Mar 4, 2020

@chimp1984 this issue of "how do I move a failed trade back to open trades" is now a FAQ in our support questions - we really need this PR. to be clear this PR is missing the critical part of re-associating the wallet private key with the trade ID.

@wiz
Copy link
Member

wiz commented Apr 9, 2020

@chimp1984 @sqrrm @ripcurlx we need this patch now, more than ever. many many users who upgraded to v1.3.0 have funds locked up and are waiting for instructions how to move the failed trades back to pending trades

@sqrrm sqrrm deleted the unfail-trade branch April 12, 2020 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants