Duplicated check when sending direct message, check remote and local addresses

This commit is contained in:
Ivan Vilata-i-Balaguer 2016-04-15 13:23:25 +02:00
parent 0e5426e1ac
commit 5e8731bb6e

View file

@ -397,9 +397,9 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
private void doSendEncryptedDirectMessage(@NotNull NodeAddress peersNodeAddress, PubKeyRing pubKeyRing, DirectMessage message,
SendDirectMessageListener sendDirectMessageListener) {
Log.traceCall();
checkNotNull(networkNode.getNodeAddress(), "My node address must not be null at doSendEncryptedDirectMessage");
checkNotNull(peersNodeAddress, "Peer node address must not be null at doSendEncryptedDirectMessage");
checkArgument(optionalEncryptionService.isPresent(), "EncryptionService not set. Seems that is called on a seed node which must not happen.");
checkNotNull(networkNode.getNodeAddress(), "networkNode.getNodeAddress() must not be null.");
checkNotNull(networkNode.getNodeAddress(), "My node address must not be null at doSendEncryptedDirectMessage");
try {
log.info("\n\nEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n" +
"Encrypt message:\nmessage={}"