mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-03 17:40:10 +00:00
arbitrator nacks maker init trade request if trade exists
This commit is contained in:
parent
3b1961fb05
commit
64081b684c
1 changed files with 7 additions and 2 deletions
|
@ -560,7 +560,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||||
// ensure trade does not already exist
|
// ensure trade does not already exist
|
||||||
Optional<Trade> tradeOptional = getOpenTrade(request.getOfferId());
|
Optional<Trade> tradeOptional = getOpenTrade(request.getOfferId());
|
||||||
if (tradeOptional.isPresent()) {
|
if (tradeOptional.isPresent()) {
|
||||||
log.warn("Maker trade already exists with id " + request.getOfferId() + ". This should never happen.");
|
log.warn("Ignoring InitTradeRequest to maker because trade already exists with id " + request.getOfferId() + ". This should never happen.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -657,7 +657,12 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||||
|
|
||||||
// verify request is from taker
|
// verify request is from taker
|
||||||
if (!sender.equals(request.getTakerNodeAddress())) {
|
if (!sender.equals(request.getTakerNodeAddress())) {
|
||||||
|
if (sender.equals(request.getMakerNodeAddress())) {
|
||||||
|
log.warn("Received InitTradeRequest from maker to arbitrator for trade that is already initializing, tradeId={}, sender={}", request.getOfferId(), sender);
|
||||||
|
sendAckMessage(sender, trade.getMaker().getPubKeyRing(), request, false, "Trade is already initializing for " + getClass().getSimpleName() + " " + trade.getId());
|
||||||
|
} else {
|
||||||
log.warn("Ignoring InitTradeRequest from non-taker, tradeId={}, sender={}", request.getOfferId(), sender);
|
log.warn("Ignoring InitTradeRequest from non-taker, tradeId={}, sender={}", request.getOfferId(), sender);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue