mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-24 06:49:31 -05:00
fix npe cleaning up arbitrator's mailbox messages
This commit is contained in:
parent
ad77912171
commit
022028bb41
@ -17,7 +17,6 @@
|
||||
|
||||
package haveno.core.trade;
|
||||
|
||||
import haveno.common.crypto.PubKeyRing;
|
||||
import haveno.common.proto.network.NetworkEnvelope;
|
||||
import haveno.core.trade.messages.TradeMessage;
|
||||
import haveno.network.p2p.AckMessage;
|
||||
@ -116,15 +115,6 @@ public class CleanupMailboxMessagesService {
|
||||
}
|
||||
|
||||
private boolean isPubKeyValid(DecryptedMessageWithPubKey decryptedMessageWithPubKey, Trade trade) {
|
||||
// We can only validate the peers pubKey if we have it already. If we are the taker we get it from the offer
|
||||
// Otherwise it depends on the state of the trade protocol if we have received the peers pubKeyRing already.
|
||||
PubKeyRing peersPubKeyRing = trade.getTradePeer().getPubKeyRing();
|
||||
boolean isValid = true;
|
||||
if (peersPubKeyRing != null &&
|
||||
!decryptedMessageWithPubKey.getSignaturePubKey().equals(peersPubKeyRing.getSignaturePubKey())) {
|
||||
isValid = false;
|
||||
log.warn("SignaturePubKey in decryptedMessageWithPubKey does not match the SignaturePubKey we have set for our trading peer.");
|
||||
}
|
||||
return isValid;
|
||||
return trade.getProtocol().isPubKeyValid(decryptedMessageWithPubKey);
|
||||
}
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ public abstract class TradeProtocol implements DecryptedDirectMessageListener, D
|
||||
return peer.getPubKeyRing();
|
||||
}
|
||||
|
||||
private boolean isPubKeyValid(DecryptedMessageWithPubKey message) {
|
||||
public boolean isPubKeyValid(DecryptedMessageWithPubKey message) {
|
||||
if (this instanceof ArbitratorProtocol) {
|
||||
|
||||
// valid if traders unknown
|
||||
|
Loading…
Reference in New Issue
Block a user