[bisq-network/bisq] Add mediation support (#3221)

Christoph Atteneder notifications at github.com
Wed Sep 11 12:46:14 UTC 2019


### Scenario
Buyer opens dispute with old client version and receives payout
--Given Alice as buyer (maker), Bob as seller (taker), and arbitrator are online
--And Alice is running an old client version (v1.1.5)
--And Bob is running the current client release version (1.1.6)
--And Alice has published a buy offer

I've set `private static final Date REQUIRE_UPDATE_DATE = Utilities.getUTCDate(2019, GregorianCalendar.SEPTEMBER, 12);` and `private static final Date MEDIATION_ACTIVATED_DATE = Utilities.getUTCDate(2019, GregorianCalendar.SEPTEMBER, 12);`. This should be the case when we release 1.1.6 and mediation is not activated and no update is required for trading yet.

When Bob tries to take the offer from Alice, Alice sees following error message
![Bildschirmfoto 2019-09-11 um 14 13 42](https://user-images.githubusercontent.com/170962/64697428-1e9dec00-d4a1-11e9-9060-c98798db1999.png)
```
java.lang.NullPointerException: mediator must not be null
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787)
	at bisq.core.trade.Trade.setMediatorNodeAddress(Trade.java:702)
	at bisq.core.trade.protocol.tasks.maker.MakerProcessPayDepositRequest.run(MakerProcessPayDepositRequest.java:80)
	at bisq.common.taskrunner.TaskRunner.next(TaskRunner.java:69)
	at bisq.common.taskrunner.TaskRunner.run(TaskRunner.java:60)
	at bisq.core.trade.protocol.BuyerAsMakerProtocol.handleTakeOfferRequest(BuyerAsMakerProtocol.java:143)
	at bisq.core.trade.BuyerAsMakerTrade.handleTakeOfferRequest(BuyerAsMakerTrade.java:104)
	at bisq.core.trade.TradeManager.handlePayDepositRequest(TradeManager.java:346)
	at bisq.core.trade.TradeManager.lambda$new$0(TradeManager.java:180)
	at bisq.network.p2p.P2PService.lambda$onMessage$8(P2PService.java:410)
	at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:804)
	at java.base/java.util.concurrent.CopyOnWriteArraySet.forEach(CopyOnWriteArraySet.java:425)
	at bisq.network.p2p.P2PService.onMessage(P2PService.java:409)
	at bisq.network.p2p.network.NetworkNode.lambda$onMessage$4(NetworkNode.java:344)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
	at bisq.network.p2p.network.NetworkNode.onMessage(NetworkNode.java:344)
	at bisq.network.p2p.network.Connection.lambda$onMessage$4(Connection.java:428)
	at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:804)
	at java.base/java.util.concurrent.CopyOnWriteArraySet.forEach(CopyOnWriteArraySet.java:425)
	at bisq.network.p2p.network.Connection.lambda$onMessage$5(Connection.java:428)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
```
I was surprised that we had some mediator code in our old version already 🤔 
During the time of creating the offer there was already a mediator and an arbitrator registered. When the mediator from the offer taker is is checked against the local selected mediators it returns null. That is because it tries to check for `localhost:9223` in my case, but it isn't an accepted mediator for Alice. Alice has only the arbitrator `localhost:9222` as mediator selected. So I have the feeling we might run into some issues during this first grace period until updating is required, if mediators are already registered during that time.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3221#issuecomment-530363862
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190911/04c93996/attachment-0001.html>


More information about the bisq-github mailing list