Use tempTradingPeerNodeAddress if the trade doesn't have a trading peer set yet

This should fix the errors on the maker side when there's a disagreement
about market price.

Fixes #2910
Fixes #2924
This commit is contained in:
a123b 2019-06-28 13:05:53 +02:00
parent e13faba79a
commit affa1b16fa

View file

@ -198,7 +198,9 @@ public abstract class TradeProtocol {
tradeId,
result,
errorMessage);
final NodeAddress peersNodeAddress = trade.getTradingPeerNodeAddress();
// If there was an error during offer verification, the tradingPeerNodeAddress of the trade might not be set yet.
// We can find the peer's node address in the processModel's tempTradingPeerNodeAddress in that case.
final NodeAddress peersNodeAddress = trade.getTradingPeerNodeAddress() != null ? trade.getTradingPeerNodeAddress() : processModel.getTempTradingPeerNodeAddress();
log.info("Send AckMessage for {} to peer {}. tradeId={}, sourceUid={}",
ackMessage.getSourceMsgClassName(), peersNodeAddress, tradeId, sourceUid);
String finalSourceUid = sourceUid;