From 5a47ebbadcbb444fb1af18fc3c7383ac7ea33343 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Tue, 19 Apr 2016 18:17:49 +0200 Subject: [PATCH] add comments --- core/src/main/java/io/bitsquare/locale/CurrencyUtil.java | 2 -- network/src/main/java/io/bitsquare/p2p/P2PService.java | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/io/bitsquare/locale/CurrencyUtil.java b/core/src/main/java/io/bitsquare/locale/CurrencyUtil.java index 63ddafa52e..b59c35cf90 100644 --- a/core/src/main/java/io/bitsquare/locale/CurrencyUtil.java +++ b/core/src/main/java/io/bitsquare/locale/CurrencyUtil.java @@ -105,8 +105,6 @@ public class CurrencyUtil { result.add(new CryptoCurrency("BTS", "BitShares")); result.add(new CryptoCurrency("XCP", "Counterparty")); result.add(new CryptoCurrency("XRP", "Ripple")); - result.add(new CryptoCurrency("QRK", "Quark")); - result.add(new CryptoCurrency("WDC", "WorldCoin")); // Unfortunately we cannot support CryptoNote coins yet as there is no way to proof the transaction. Payment ID helps only locate the tx but the // arbitrator cannot see if the receiving key matches the receivers address. They might add support for exposing the tx key, but that is not diff --git a/network/src/main/java/io/bitsquare/p2p/P2PService.java b/network/src/main/java/io/bitsquare/p2p/P2PService.java index a8e9eee7c3..ec70e7de18 100644 --- a/network/src/main/java/io/bitsquare/p2p/P2PService.java +++ b/network/src/main/java/io/bitsquare/p2p/P2PService.java @@ -554,6 +554,8 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis @Override public void onBroadcastedToFirstPeer(BroadcastMessage message) { + // The reason for that check was to separate different callback for different send calls. + // We only want to notify our sendMailboxMessageListener for the calls he is interested in. if (message instanceof AddDataMessage && ((AddDataMessage) message).protectedStorageEntry.equals(protectedMailboxStorageEntry)) { sendMailboxMessageListener.onStoredInMailbox(); @@ -568,12 +570,15 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis @Override public void onBroadcastFailed(String errorMessage) { - //sendMailboxMessageListener.onFault("Broadcast completed without any successful broadcast"); + // TODO investigate why not sending sendMailboxMessageListener.onFault. Related probably + // to the logic from BroadcastHandler.sendToPeer } }; boolean result = p2PDataStorage.add(protectedMailboxStorageEntry, networkNode.getNodeAddress(), listener, true); if (!result) { //TODO remove and add again with a delay to ensure the data will be broadcasted + // The p2PDataStorage.remove makes probably sense but need to be analysed more. + // Don't change that if it is not 100% clear. sendMailboxMessageListener.onFault("Data already exists in our local database"); boolean removeResult = p2PDataStorage.remove(protectedMailboxStorageEntry, networkNode.getNodeAddress(), true); log.debug("remove result=" + removeResult);