mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-07 14:42:51 -04:00
fix bug with map
This commit is contained in:
parent
e87f99d2a5
commit
b235beb56b
3 changed files with 10 additions and 3 deletions
|
@ -145,9 +145,14 @@ public final class Arbitrator implements PubKeyProtectedExpirablePayload {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Arbitrator{" +
|
return "Arbitrator{" +
|
||||||
"arbitratorAddress='" + arbitratorAddress + '\'' +
|
"arbitratorAddress=" + arbitratorAddress +
|
||||||
", languageCodes=" + languageCodes +
|
", languageCodes=" + languageCodes +
|
||||||
", btcAddress='" + btcAddress + '\'' +
|
", btcAddress='" + btcAddress + '\'' +
|
||||||
|
", registrationDate=" + registrationDate +
|
||||||
|
", btcPubKey.hashCode()=" + Arrays.toString(btcPubKey).hashCode() +
|
||||||
|
", pubKeyRing.hashCode()=" + pubKeyRing.hashCode() +
|
||||||
|
", registrationSignature.hashCode()='" + registrationSignature.hashCode() + '\'' +
|
||||||
|
", registrationPubKey.hashCode()=" + Arrays.toString(registrationPubKey).hashCode() +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,8 @@ import java.util.concurrent.*;
|
||||||
public class Connection implements MessageListener {
|
public class Connection implements MessageListener {
|
||||||
private static final Logger log = LoggerFactory.getLogger(Connection.class);
|
private static final Logger log = LoggerFactory.getLogger(Connection.class);
|
||||||
private static final int MAX_MSG_SIZE = 5 * 1024 * 1024; // 5 MB of compressed data
|
private static final int MAX_MSG_SIZE = 5 * 1024 * 1024; // 5 MB of compressed data
|
||||||
private static final int SOCKET_TIMEOUT = 30 * 60 * 1000; // 30 min.
|
//timeout on blocking Socket operations like ServerSocket.accept() or SocketInputStream.read()
|
||||||
|
private static final int SOCKET_TIMEOUT = 1 * 60 * 1000; // 1 min.
|
||||||
private ConnectionPriority connectionPriority;
|
private ConnectionPriority connectionPriority;
|
||||||
|
|
||||||
public static int getMaxMsgSize() {
|
public static int getMaxMsgSize() {
|
||||||
|
|
|
@ -95,7 +95,8 @@ public class ProtectedExpirableDataStorage implements MessageListener {
|
||||||
// object when we get it sent from new peers, we don’t remove the sequence number from the map.
|
// object when we get it sent from new peers, we don’t remove the sequence number from the map.
|
||||||
// That way a add message for an already expired data will fail because the sequence number
|
// That way a add message for an already expired data will fail because the sequence number
|
||||||
// is equal and not larger.
|
// is equal and not larger.
|
||||||
map.entrySet().stream()
|
Map<ByteArray, ProtectedData> temp = new HashMap<>(map);
|
||||||
|
temp.entrySet().stream()
|
||||||
.filter(entry -> entry.getValue().isExpired())
|
.filter(entry -> entry.getValue().isExpired())
|
||||||
.forEach(entry -> map.remove(entry.getKey()));
|
.forEach(entry -> map.remove(entry.getKey()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue