mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Refactor: return early
This commit is contained in:
parent
8d866d5d06
commit
a9802e60cd
@ -493,8 +493,16 @@ public class MailboxMessageService implements SetupListener, RequestDataManager.
|
||||
private void addMailboxData(MailboxStoragePayload expirableMailboxStoragePayload,
|
||||
PublicKey receiversPublicKey,
|
||||
SendMailboxMessageListener sendMailboxMessageListener) {
|
||||
if (isBootstrapped) {
|
||||
if (!networkNode.getAllConnections().isEmpty()) {
|
||||
if (!isBootstrapped) {
|
||||
throw new NetworkNotReadyException();
|
||||
}
|
||||
|
||||
if (networkNode.getAllConnections().isEmpty()) {
|
||||
sendMailboxMessageListener.onFault("There are no P2P network nodes connected. " +
|
||||
"Please check your internet connection.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
ProtectedMailboxStorageEntry protectedMailboxStorageEntry = p2PDataStorage.getMailboxDataWithSignedSeqNr(
|
||||
expirableMailboxStoragePayload,
|
||||
@ -532,13 +540,6 @@ public class MailboxMessageService implements SetupListener, RequestDataManager.
|
||||
} catch (CryptoException e) {
|
||||
log.error("Signing at getMailboxDataWithSignedSeqNr failed.");
|
||||
}
|
||||
} else {
|
||||
sendMailboxMessageListener.onFault("There are no P2P network nodes connected. " +
|
||||
"Please check your internet connection.");
|
||||
}
|
||||
} else {
|
||||
throw new NetworkNotReadyException();
|
||||
}
|
||||
}
|
||||
|
||||
private void removeMailboxEntryFromNetwork(ProtectedMailboxStorageEntry protectedMailboxStorageEntry) {
|
||||
|
Loading…
Reference in New Issue
Block a user