Commit Graph

12143 Commits

Author SHA1 Message Date
chimp1984
3987f9cd5a
Fix incorrect getDepositTx calls 2020-09-25 18:16:50 -05:00
chimp1984
95cb3b2710
Fix deposit tx setters 2020-09-25 17:06:13 -05:00
chimp1984
568dcdaad4
Update tasks in debugview 2020-09-25 15:32:49 -05:00
chimp1984
10bedee803
Merge branch 'dispute-agent-branch' into fix-delayed-payout-tx-issues
# Conflicts:
#	core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSetupDepositTxListener.java
2020-09-25 15:03:28 -05:00
chimp1984
423cc7134e
Add changes from merge conflict (class was renamed) 2020-09-25 15:01:20 -05:00
chimp1984
25c4b4d0fc
Merge branch 'master_upstream' into dispute-agent-branch
# Conflicts:
#	core/src/main/java/bisq/core/trade/DelayedPayoutTxValidation.java
2020-09-25 14:53:20 -05:00
chimp1984
8ac468d84f
Commit to trigger travis as it got stuck... 2020-09-25 14:23:06 -05:00
chimp1984
b958c7519b
Add MakerRemovesOpenOffer task.
Removes offer once the taker fee was published. So we ensure that maker fee is not lost if an error happens before that.
2020-09-25 14:17:04 -05:00
chimp1984
f37446b991
Change log level 2020-09-25 09:39:45 -05:00
sqrrm
00ccec80e3
Merge pull request #4553 from oscarguindzberg/fixdoc
DAO setup doc fix
2020-09-25 11:30:24 +02:00
sqrrm
a2a284ef94
Merge pull request #4551 from oscarguindzberg/replaceBitcoinjDeprecated
Replace deprecated bitcoinj methods
2020-09-25 11:29:56 +02:00
chimp1984
f1df52790b
improve trade details window 2020-09-25 00:20:17 -05:00
chimp1984
6f614f4f4c
Set takerFeeTxId and depositTx in trade only once they are published. Before that we keep it temporary in the processModel.
The buyer receives the takerFeeTxId with the frist message, but at the moment it is not published. To reflect that he also keeps it in the process model and
at the next message when the fee tx is published he sets it in the Trade.

Remove
`checkArgument(!walletService.getAddressEntry(id, AddressEntry.Context.MULTI_SIG).isPresent(),
                     "addressEntry must not be set here.");
`
as it causes failure if a taker takes same offer after certain error conditions again.
2020-09-25 00:19:43 -05:00
chimp1984
7167e2a8bd
Add check if trade has been paid out for button disable state 2020-09-24 21:10:02 -05:00
chimp1984
b494434623
Add warn icon next to trash icon. Show popup with info about the problem and instructions.
Set trash button disabled if the tx chain is valid to avoid that users move to failed while trade is valid to be completed.

Contract: Add isMyRoleMaker method
Trade: Add hasErrorMessage and isTxChainInvalid methods
2020-09-24 21:07:40 -05:00
chimp1984
f6eefef1ae
Remove handling of failed trades. If a trade is in an invalid state (tx missing) or has an error message set we show in the pending trades view a red trash icon for moving the trade to failed trades.
The info icon next to the trade ID is then a warning icon (should be red but css is not my best friend) and if opening trade details window we also color the missing txs red with a warn icon and tooltip.
When clicking the trash button a popup is displayed with detail info.
At failed trades there is a "undo" icon for reverting the trade back to pending (if user wants to open mediation, etc).

All the automatic handling of the failed trades and popups are removed as it never worked well and just confused users...

In next commits we will add more instructions what a user should/can do for diff. error cases.

TradeManger:
- Remove all the failed checks at initPendingTrade.
- Remove tradesWithoutDepositTx
- Remove tradesForStatistics as it was never read
- Remove cleanUpAddressEntries
- Rename addTradeToClosedTrades to onTradeCompleted

TxIdTextField accepts a null for tx ID and shows then red colored N/A and a warning icon.
HyperlinkWithIcon exposed the icon to be accessible for style change.
DebugWindow was updated for one variation of the trade protocol (other is missing still).
Trade detail window show now always all 4 mandatory txs.
Beside that this commit has some cleanups and null pointer fixes (when testing error scenarios i got those NP).
2020-09-24 19:47:12 -05:00
chimp1984
03023567a8
Fix potential bug with peers pub key check. Use new isPubKeyValid method to avoid code duplication.
Before we did not apply messages if the peers key was null which can be the case at protocol start for maker side (takers key is not set yet). Makers key is in offer and available from the start.

Fix incorrect setPubKeyRing call in BuyerAsTakerProtocol and BuyerProtocol. Only taker can set it from offer. This bug was introduce in past commits of this branch.

Move FluentProtocol to own class file
Close open offer in task instead at state listener
Remove state listener
Remove default timeout as not used anymore
Add onWithdrawCompleted method to clean up when trade completed
Rearrange code in TradeProtocol
Rename doHandleDecryptedMessage to onTradeMessage
Rename doApplyMailboxTradeMessage to onMailboxMessage
2020-09-23 22:24:45 -05:00
chimp1984
f059f08b27
Refactor: Rearrange methods 2020-09-23 19:56:41 -05:00
chimp1984
9644920a52
Refactor: Move mediation code to new class 2020-09-23 19:52:24 -05:00
chimp1984
8847f4b13d
Refactor: Rename createTrade to getNewTrade
Move some code to caller method
2020-09-23 19:35:19 -05:00
chimp1984
99afe23de6
Refactor: Rename takeAvailableOffer to onTakeOffer 2020-09-23 19:29:29 -05:00
chimp1984
a2e0ec4d2e
Change SellerProtocol from interface to abstract class
Move all common code of seller protocol classes to SellerProtocol
2020-09-23 19:26:49 -05:00
chimp1984
e59b5b3cf5
Change BuyerProtocol from interface to abstract class
Move all common code of buyer protocol classes to BuyerProtocol
2020-09-23 17:20:10 -05:00
chimp1984
cdbd6cdfa8
Redesigned fluent API again...
Move code duplication to Buyer protocol
2020-09-23 16:21:29 -05:00
chimp1984
54d625e564
Add run method to accept runnable which is execute before run tasks
Add isValid method in FluentProcess
Add more logs if invalid
Add toString

Refactor:
- Remove custom trade fields and use trade from base class instead
2020-09-23 13:08:26 -05:00
chimp1984
968a6df550
Refactor: Rename run to runTasks 2020-09-23 12:50:22 -05:00
chimp1984
9505179bed
Use FluentProcess for boilerplate code (WIP - some custom code is commented out atm, will be fixed in follow up commits)
Add setTaskRunner method
Add addTasks method
Add run method
2020-09-23 12:49:42 -05:00
chimp1984
faf07f623f
Refactor: Rename fromAny to expectedPhases 2020-09-23 12:14:40 -05:00
chimp1984
d91e44c9ab
Refactor: Rename from to expectedPhase 2020-09-23 12:14:18 -05:00
chimp1984
3f80d1b1ea
Refactor: Rename condition to preCondition 2020-09-23 12:13:07 -05:00
chimp1984
2b53312af9
Various improvements
- Add time outs per request/response cycle.
- Use custom timeouts
- Stop timeout if condition not met
- Allow multiple condition calls (all need to be true)
- Move  processModel.setTradeMessage(tradeMessage); and processModel.setTempTradingPeerNodeAddress(peerNodeAddress); calls to FluentProcess
- Add Validator.isTradeIdValid method
- Replace Validator.checkTradeId(processModel.getOfferId(), tradeMessage); by isTradeIdValid in FluentProcess
- Add DisputeEvent
- Derive info string from message or event at handleTaskRunnerSuccess
- Add from method
- Add withTimeout method
- Add BuyerEvent.STARTUP
- Rename onMessage to on
- Rename onEvent to on
- Rename tradeMesage to message
- Rename sener/peerNodeAddress to peer
2020-09-23 12:07:38 -05:00
sqrrm
9ca3c8bded
Merge pull request #4549 from oscarguindzberg/fixlog
Fix logging message
2020-09-23 16:57:27 +02:00
chimp1984
de008457cb
Remove empty file (from merge) 2020-09-23 08:28:04 -05:00
chimp1984
0fa45650b6
Merge branch 'dispute-agent-branch' into wip-merge-tradeprot
# Conflicts:
#	core/src/main/java/bisq/core/trade/DelayedPayoutTxValidation.java
#	core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep1View.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java
2020-09-23 08:27:09 -05:00
chimp1984
6fa2225b65
Use fluent interface for checking state and conditions 2020-09-23 01:48:02 -05:00
chimp1984
7c6f0ac9b2
Use ifInPhase APi for testing expected phase(s)
Add ifInPhase method to allow alternative phases. We can have parallel branches how we reach a new state, e.g. receiving the tx from network or receiving it from the peer. no guarantee which will happen first.

Allow phase transition to skip a future phase as we have phases only relevant for one role. This is not good for treading it as a state machine state, we need to redesign the state/phase handling...
2020-09-22 21:09:09 -05:00
chimp1984
48241af316
Change isTradeInPhase APi to fluent interface with ifInPhase 2020-09-22 20:18:59 -05:00
chimp1984
5f8f30a8b3
Add BuyerSendCounterCurrencyTransferStartedMessage as second optional task instead of starting a new task runner 2020-09-22 19:53:19 -05:00
chimp1984
1abe6adac6
Remove empty tasks. 2020-09-22 19:40:15 -05:00
chimp1984
8ce5ebadea
Refactoring: rename, cleanups 2020-09-22 19:35:24 -05:00
chimp1984
4b7307e07f
Add checks for state at handle CounterCurrencyTransferStartedMessage
Add ApplyFilter task
2020-09-22 19:35:01 -05:00
chimp1984
c7e0c51875
Use same model as in SellerSendsDepositTxAndDelayedPayoutTxMessage
Reason: the other model was already tested quite a lot and seems to work correctly.
We gain a lot of resiliance with min. costs (repeated mailbox messages - as they are the same
they will not cause higher number of msg, just a bit more traffic)
2020-09-22 19:34:14 -05:00
chimp1984
96221317e2
Change order of tasks
Call BuyerSetupPayoutTxListener before BuyerSendCounterCurrencyTransferStartedMessage
We will change BuyerSendCounterCurrencyTransferStartedMessage so that it
does not complete until the message has been ACKed by the peer.
It is more transparent to leave the task uncompleted and if it is the last task we dont have issues.
The caller would not get the result handler called though until all is completed. But the result handler in the UI was anyway empty.
2020-09-22 19:01:51 -05:00
chimp1984
b13e1a3edb
Resend DepositTxAndDelayedPayoutTxMessage at
SellerSendsDepositTxAndDelayedPayoutTxMessage if no ACK received

Add checks for valid trade state transitions
2020-09-22 18:50:45 -05:00
chimp1984
2b747cc323
Don't return null if name is null by try to use UNDEFINED. Only if that is not present we return null 2020-09-22 18:48:47 -05:00
Oscar Guindzberg
abcd065325
DAO setup doc fix
Stress a full dao seed node is required to run lite nodes.
2020-09-22 15:24:23 -03:00
Oscar Guindzberg
59124e3e33
Replace deprecated bitcoinj methods
Replace output.getAddressFromP2PKHScript() and
output.getAddressFromP2SH() with
output.getScriptPubKey().getToAddress()
2020-09-22 14:55:47 -03:00
Oscar Guindzberg
c1c9ff3de8
Fix logging message 2020-09-22 14:07:31 -03:00
Christoph Atteneder
e3b3c625b3
Merge pull request #4548 from ghubstan/use-legacyaddress-frombase58
Remove unused, broken accessor
2020-09-22 16:32:50 +02:00
Christoph Atteneder
71373741da
Merge pull request #4547 from wiz/reduce-logging-for-statsnode
Set btcdcli4j loglevel to WARN for statsnode entrypoint, fixes #4537
2020-09-22 16:24:20 +02:00