mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-10 15:40:22 -04:00
Cleanups, better logging
This commit is contained in:
parent
348dfb47b3
commit
23b1adbe7e
6 changed files with 15 additions and 51 deletions
|
@ -216,7 +216,7 @@ public final class Offer implements PubKeyProtectedExpirablePayload {
|
|||
availabilityProtocol.cancel();
|
||||
log.error(errorMessage);
|
||||
});
|
||||
availabilityProtocol.checkOfferAvailability();
|
||||
availabilityProtocol.sendOfferAvailabilityRequest();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -38,4 +38,12 @@ public abstract class OfferMessage implements MailMessage {
|
|||
public int networkId() {
|
||||
return networkId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OfferMessage{" +
|
||||
"networkId=" + networkId +
|
||||
", offerId='" + offerId + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.trade.protocol.availability.tasks;
|
||||
|
||||
import io.bitsquare.common.taskrunner.Task;
|
||||
import io.bitsquare.common.taskrunner.TaskRunner;
|
||||
import io.bitsquare.trade.protocol.availability.OfferAvailabilityModel;
|
||||
|
||||
public class GetPeerAddress extends Task<OfferAvailabilityModel> {
|
||||
|
||||
public GetPeerAddress(TaskRunner taskHandler, OfferAvailabilityModel model) {
|
||||
super(taskHandler, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run() {
|
||||
try {
|
||||
runInterceptHook();
|
||||
model.setPeerAddress(model.offer.getOffererAddress());
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
model.offer.setErrorMessage("An error occurred.\n" +
|
||||
"Error message:\n"
|
||||
+ t.getMessage());
|
||||
|
||||
failed(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -148,8 +148,9 @@ public class BitsquareApp extends Application {
|
|||
|
||||
// configure the system tray
|
||||
SystemTray systemTray = SystemTray.create(primaryStage, shutDownHandler);
|
||||
primaryStage.setOnCloseRequest(e -> {
|
||||
e.consume();
|
||||
|
||||
primaryStage.setOnCloseRequest(event -> {
|
||||
event.consume();
|
||||
if (BitsquareApp.IS_RELEASE_VERSION)
|
||||
stop(); // systemTray.hideStage(); TODO issues with some linux systems (https://github.com/bitsquare/bitsquare/issues/350)
|
||||
else
|
||||
|
|
|
@ -21,7 +21,6 @@ import io.bitsquare.common.taskrunner.Task;
|
|||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.InitializableView;
|
||||
import io.bitsquare.trade.protocol.availability.OfferAvailabilityProtocol;
|
||||
import io.bitsquare.trade.protocol.availability.tasks.GetPeerAddress;
|
||||
import io.bitsquare.trade.protocol.availability.tasks.ProcessOfferAvailabilityResponse;
|
||||
import io.bitsquare.trade.protocol.availability.tasks.SendOfferAvailabilityRequest;
|
||||
import io.bitsquare.trade.protocol.placeoffer.PlaceOfferProtocol;
|
||||
|
@ -65,7 +64,6 @@ public class DebugView extends InitializableView {
|
|||
final ObservableList<Class> items1 = FXCollections.observableArrayList(Arrays.asList(
|
||||
/*---- Protocol ----*/
|
||||
OfferAvailabilityProtocol.class,
|
||||
GetPeerAddress.class,
|
||||
SendOfferAvailabilityRequest.class,
|
||||
ProcessOfferAvailabilityResponse.class,
|
||||
Boolean.class, /* used as seperator*/
|
||||
|
|
|
@ -340,7 +340,9 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
|||
// That is used as protection against eclipse attacks.
|
||||
connection.setConnectionPriority(ConnectionPriority.DIRECT_MSG);
|
||||
|
||||
log.info("Received SealedAndSignedMessage and decrypted it: " + decryptedMsgWithPubKey);
|
||||
log.info("\n\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n" +
|
||||
"Received SealedAndSignedMessage and decrypted it.\ndecryptedMsgWithPubKey={}"
|
||||
+ "\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", decryptedMsgWithPubKey);
|
||||
connection.getPeerAddressOptional().ifPresent(peerAddresses ->
|
||||
decryptedMailListeners.stream().forEach(
|
||||
e -> e.onMailMessage(decryptedMsgWithPubKey, peerAddresses)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue