[bisq-network/bisq] [1.2.0] Null pointer exception with ProcessPeerPublishedDelayedPayoutTxMessage when buyer initiates payment and then opens a dispute (#3473)

Devin Bileck notifications at github.com
Fri Oct 25 23:06:27 UTC 2019


### Description

Null pointer exception with ProcessPeerPublishedDelayedPayoutTxMessage when buyer initiates payment and then opens a dispute.

#### Version

release/v1.2.0 branch (commit 05135a500001131cb6aa85360b3d89fc300b3e71)

### Steps to reproduce

I ran into this issue while testing https://github.com/bisq-network/bisq/pull/3464, so the first few steps are identical to that issue.

Preconditions:
- Start with a fresh regtest environment (using the dao-setup.zip file)
- Adjust the delay in MakerSetsLockTime to only 5 blocks to make testing easier
- Change RECIPIENT_BTC_ADDRESS to an address of your local regtest Bitcoin Core node

Steps:
1. Alice creates a buy offer and Bob takes the offer (do not initiate payment).
2. Generate blocks until exceeding the timelock delay period.
3. Restart Bob's client.
4. Alice initiates payment and then opens a dispute.
5. Mediator closes both tickets (seller gets trade amount).
6. Bob clicks on the trade but the mediation result popup doesn't appear. In his log:
```
Oct-25 15:37:59.800 [JavaFX Application Thread] ERROR b.d.m.p.p.TradeSubView: Creating viewClass class bisq.desktop.main.portfolio.pendingtrades.steps.seller.SellerStep3View caused an error trade.getDelayedPayoutTx() must not be null at openMediationResultPopup 
java.lang.NullPointerException: trade.getDelayedPayoutTx() must not be null at openMediationResultPopup
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787)
	at bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView.openMediationResultPopup(TradeStepView.java:533)
	at bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView.updateMediationResultState(TradeStepView.java:482)
	at bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView.updateDisputeState(TradeStepView.java:427)
	at bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView.lambda$registerSubscriptions$4(TradeStepView.java:214)
	at org.fxmisc.easybind.EasyBind.subscribe(EasyBind.java:262)
	at bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView.registerSubscriptions(TradeStepView.java:212)
	at bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView.activate(TradeStepView.java:189)
	at bisq.desktop.main.portfolio.pendingtrades.steps.seller.SellerStep3View.activate(SellerStep3View.java:87)
	at bisq.desktop.main.portfolio.pendingtrades.TradeSubView.createAndAddTradeStepView(TradeSubView.java:147)
	at bisq.desktop.main.portfolio.pendingtrades.TradeSubView.showItem(TradeSubView.java:112)
	at bisq.desktop.main.portfolio.pendingtrades.SellerSubView.onViewStateChanged(SellerSubView.java:98)
	at org.fxmisc.easybind.EasyBind.subscribe(EasyBind.java:262)
	at bisq.desktop.main.portfolio.pendingtrades.SellerSubView.activate(SellerSubView.java:49)
	at bisq.desktop.main.portfolio.pendingtrades.PendingTradesView.lambda$activate$8(PendingTradesView.java:281)
	at org.fxmisc.easybind.EasyBind.subscribe(EasyBind.java:262)
	at bisq.desktop.main.portfolio.pendingtrades.PendingTradesView.activate(PendingTradesView.java:256)
	at bisq.desktop.common.view.ActivatableViewAndModel.lambda$prepareInitialize$0(ActivatableViewAndModel.java:43)
	at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
	at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.base/javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:74)
	at javafx.base/javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102)
	at javafx.graphics/javafx.scene.Node$ReadOnlyObjectWrapperManualFire.fireSuperValueChangedEvent(Node.java:1054)
	at javafx.graphics/javafx.scene.Node.invalidatedScenes(Node.java:1114)
	at javafx.graphics/javafx.scene.Node.setScenes(Node.java:1152)
	at javafx.graphics/javafx.scene.Parent.scenesChanged(Parent.java:776)
	at javafx.graphics/javafx.scene.Node.invalidatedScenes(Node.java:1076)
	at javafx.graphics/javafx.scene.Node.setScenes(Node.java:1152)
	at javafx.graphics/javafx.scene.Parent.scenesChanged(Parent.java:776)
	at javafx.graphics/javafx.scene.Node.invalidatedScenes(Node.java:1076)
	at javafx.graphics/javafx.scene.Node.setScenes(Node.java:1152)
	at javafx.graphics/javafx.scene.Parent.scenesChanged(Parent.java:776)
	at javafx.graphics/javafx.scene.Node.invalidatedScenes(Node.java:1076)
	at javafx.graphics/javafx.scene.Node.setScenes(Node.java:1152)
	at javafx.graphics/javafx.scene.Parent.scenesChanged(Parent.java:776)
	at javafx.graphics/javafx.scene.Node.invalidatedScenes(Node.java:1076)
	at javafx.graphics/javafx.scene.Node.setScenes(Node.java:1152)
	at javafx.graphics/javafx.scene.Parent$2.onChanged(Parent.java:376)
	at javafx.base/com.sun.javafx.collections.TrackableObservableList.lambda$new$0(TrackableObservableList.java:45)
	at javafx.base/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
	at javafx.base/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
	at javafx.base/javafx.collections.ModifiableObservableListBase.setAll(ModifiableObservableListBase.java:90)
	at javafx.base/com.sun.javafx.collections.VetoableListDecorator.setAll(VetoableListDecorator.java:116)
	at javafx.base/com.sun.javafx.collections.VetoableListDecorator.setAll(VetoableListDecorator.java:108)
	at bisq.desktop.main.MainView.lambda$initialize$7(MainView.java:379)
	at bisq.desktop.Navigation.lambda$navigateTo$1(Navigation.java:140)
	at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:804)
	at java.base/java.util.concurrent.CopyOnWriteArraySet.forEach(CopyOnWriteArraySet.java:425)
	at bisq.desktop.Navigation.navigateTo(Navigation.java:140)
	at bisq.desktop.Navigation.navigateTo(Navigation.java:104)
	at bisq.desktop.main.MainView$NavButton.lambda$new$1(MainView.java:827)
	at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8865)
	at javafx.controls/javafx.scene.control.ToggleButton.fire(ToggleButton.java:257)
	at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:206)
	at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
	at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
	at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3876)
	at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1300(Scene.java:3604)
	at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1874)
	at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2613)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433)
	at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
	at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)
	at java.base/java.lang.Thread.run(Thread.java:844)
```
7. Alice clicks on the trade and the mediation result popup appears for her.
8. Alice rejects mediators suggestion and payout is made to the donation address. No error message is shown to Alice, but in her log:
```
Oct-25 15:41:08.286 [JavaFX Application Thread] WARN b.c.t.protocol.TradeProtocol: Received AckMessage with error state for PeerPublishedDelayedPayoutTxMessage from localhost:7777 with tradeId 194360-e675db7a-c5be-465d-b45f-7924366bfc74-120 and errorMessage=An error occurred at task: ProcessPeerPublishedDelayedPayoutTxMessage
Exception: java.lang.NullPointerException 
```

Bob is presented with an error:
![image](https://user-images.githubusercontent.com/603793/67609210-78e8c880-f740-11e9-982c-a46df98cbc87.png)

And in his log:
```
Oct-25 00:27:20.655 [JavaFX Application Thread] INFO b.common.taskrunner.TaskRunner: Run task: ProcessPeerPublishedDelayedPayoutTxMessage 
java.lang.NullPointerException
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
	at bisq.core.trade.protocol.tasks.ProcessPeerPublishedDelayedPayoutTxMessage.run(ProcessPeerPublishedDelayedPayoutTxMessage.java:54)
	at bisq.common.taskrunner.TaskRunner.next(TaskRunner.java:69)
	at bisq.common.taskrunner.TaskRunner.run(TaskRunner.java:60)
	at bisq.core.trade.protocol.TradeProtocol.handle(TradeProtocol.java:228)
	at bisq.core.trade.protocol.TradeProtocol.doHandleDecryptedMessage(TradeProtocol.java:242)
	at bisq.core.trade.protocol.SellerAsTakerProtocol.doHandleDecryptedMessage(SellerAsTakerProtocol.java:252)
	at bisq.core.trade.protocol.TradeProtocol.lambda$new$0(TradeProtocol.java:91)
	at bisq.network.p2p.P2PService.lambda$onMessage$8(P2PService.java:412)
	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:411)
	at bisq.network.p2p.network.NetworkNode.lambda$onMessage$4(NetworkNode.java:357)
	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:357)
	at bisq.network.p2p.network.Connection.lambda$onMessage$5(Connection.java:429)
	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$6(Connection.java:429)
	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)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
	at java.base/java.lang.Thread.run(Thread.java:844)
```

#### Device or machine

Windows 10

-- 
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/issues/3473
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191025/db3110b4/attachment-0001.html>


More information about the bisq-github mailing list