mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-05-02 14:46:22 -04:00
fix bug with map
This commit is contained in:
parent
e87f99d2a5
commit
b235beb56b
3 changed files with 10 additions and 3 deletions
|
@ -30,7 +30,8 @@ import java.util.concurrent.*;
|
|||
public class Connection implements MessageListener {
|
||||
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 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;
|
||||
|
||||
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.
|
||||
// That way a add message for an already expired data will fail because the sequence number
|
||||
// is equal and not larger.
|
||||
map.entrySet().stream()
|
||||
Map<ByteArray, ProtectedData> temp = new HashMap<>(map);
|
||||
temp.entrySet().stream()
|
||||
.filter(entry -> entry.getValue().isExpired())
|
||||
.forEach(entry -> map.remove(entry.getKey()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue