Commit Graph

592 Commits

Author SHA1 Message Date
chimp1984
f10d2318f3
Log when we remove expired entries 2020-11-12 15:58:56 -05:00
chimp1984
ac955e1875
Reduce TTL for ack and mailbox messages 2020-11-12 15:58:55 -05:00
chimp1984
ab5645b864
Fix issue with getting complete handler called twice from P2PService
We used a delegate method in P2PService for calling readPersisted on p2PDataStorage and peerManager.
This was from old times when those classed have not been injected classes. The complete handlers got
called from both p2PDataStorage and peerManager but we counted only P2PService as host, so the
countdown completed before the last host was really completed, leading to a nullpointer in
MainView (not always).

We removed now PersistedDataHost interface from P2PService and use P2PDataStorage and PeerManager to be added to hosts.
2020-11-03 13:01:35 -05:00
chimp1984
4161ecf239
Fix bugs with reading historical data
- Use fileName not getFileName() in readHistoricalStoreFromResources
- use complete handler once reading of all historical data is completed where we
build the ImmutableMaps and complete the readFromResources method
2020-11-03 11:48:58 -05:00
Christoph Atteneder
9da7100ef2
Merge pull request #4734 from chimp1984/show-past-deviation-in-monitor
Show past deviation in monitor
2020-11-03 09:03:14 +01:00
sqrrm
f03be6ad3d
Merge pull request #4628 from chimp1984/improve-read-file-handling
Use a thread in PersistenceManager for reading persisted files instead of using threads in client code
2020-11-02 17:36:21 +01:00
chimp1984
baaa100c01
Reset NumAllConnectionsLostEvents once we sent it to inventory monitor 2020-10-31 11:23:24 -05:00
chimp1984
0c4eb14077
Only log and increase numAllConnectionsLostEvents if we have not called shutDown
We also do not call listeners in that case as some listeners have some restart routines
on that event which is not what we want at shut down
2020-10-23 01:17:34 -05:00
chimp1984
5bdc5abe34
Add numAllConnectionsLostEvents 2020-10-23 01:17:34 -05:00
chimp1984
8c156eb5bf
Add peakNumConnections 2020-10-23 01:17:34 -05:00
chimp1984
1b83083ade
Add nodes from mike
Various improvements...
2020-10-23 01:17:33 -05:00
chimp1984
9dab186086
Move inventory package to core as we want to include other domain data as well like DAO state
Add more data to inventory map and change type of value to String.
2020-10-23 01:17:32 -05:00
chimp1984
55b693e295
Make config nullable and extract methods where config is used and apply default value in case config is not set. 2020-10-23 01:17:32 -05:00
chimp1984
c0f981ad1d
Fix incorrect shutdown behaviour
Delay the boolean property setter as otherwise our listener might never
get triggered if property is set synchronously before listener registration.
Remove shutdown thread.
Cancel future in case tor is not created yet.
2020-10-23 00:30:29 -05:00
chimp1984
68583d86ee
Remove mapping to user thread in client code
Add synchronous methods for tests. They new async methods lead to failing tests.
It could be probably fixed, but its quite an effort... Don't like to add code just for
tests but on the other hand, maybe those methods might be useful for other use cases as well.
2020-10-21 14:45:40 -05:00
chimp1984
01ab16abe5
Reformat 2020-10-21 13:41:50 -05:00
chimp1984
8baf34a643
Fix missing params 2020-10-21 13:41:50 -05:00
chimp1984
3f4d6e6f23
Use a thread in PersistenceManager for reading persisted files instead of using thread in client code
Before we use a thread in readFromResources and readAllPersisted. To avoid that client code need to deal with
threading we moved that to the PersistenceManager and changed the API accordingly so it will not return the persisted object but calls a consumer once it is completed with reading.
2020-10-21 13:41:50 -05:00
chimp1984
927004b4be
Rename HISTORY to HISTORICAL_RESOURCE_FILE_VERSION_TAGS to make its usage more clear 2020-10-20 22:08:18 -05:00
chimp1984
6b4d77fb1b
Handle Capabilities for encrypted messages (offer availibility request/response)
We did check in Connection for SupportedCapabilitiesMessage and if a message is of that type we set the capability.
But encrypted messages are wrapped in a PrefixedSealedAndSignedMessage so the payload is not visible as SupportedCapabilitiesMessage without decrypting it.
We need to call maybeHandleSupportedCapabilitiesMessage at decrypting the message. We do that only for direct messages not for mailbox messages as we likely do not have a connection open to the peer in that case (otherwise it would not be a mailbox msg) and as we don't have the connection available (we get is as AddDataMessage broadcast from an peer, so could could not apply it to the Connection of the sender.
2020-10-16 11:07:36 -05:00
Christoph Atteneder
4e2e523beb
Update data stores for v1.4.0 2020-10-15 13:21:46 +02:00
sqrrm
c41bfd7164
Merge pull request #4643 from chimp1984/add-get-inventory-msg
Add GetInventory messages
2020-10-14 12:22:00 +02:00
chimp1984
32b953b61a
Improve GetInventoryRequester and GetInventoryRequestManager 2020-10-14 02:37:00 -05:00
chimp1984
5f9d3d1f0d
Add GetInventory messages
This will be used for monitoring seed nodes.
Instead of requesting all data (we cannot request all in fact as it is too large)
we request the number of items the node has.

This code will not have any impact atm. It will be triggered once a new monitor module gets added which
will send the GetInventoryRequest to the seeds.
2020-10-13 23:30:39 -05:00
chimp1984
cc5bdfaf9c
Change data response behaviour
Add DateSortedTruncatablePayload interface for TradeStatistics2

We check first if we need to truncate dateSortedTruncatablePayloads, if so we have sorted by date and truncate in the way that we receive the most recent data. We define the maxItems in the class implementing the interface (3000 for trade stats).
Later we apply the maxEntries check the combined list and if we need to truncate here as well (10 000) we have added the dateSortedTruncatablePayloads at the end so those will get truncated with higher prio.

There is also a bit wrong handling in the previous code that we check for max limits before the shouldTransmitPayloadToPeer filter. Should be fixed in another PR for master...
2020-10-13 20:31:09 -05:00
chimp1984
30c77aa419
Update resource file.
Number of objects is 24 more then with 1.3.9. Seems there are still either a few duplicate
with some diverging data which should not be different or that our old code to filter
duplicates had some issues. But a difference of 24 out of 75 000 object can be ignored IMO.
2020-10-13 11:31:54 -05:00
chimp1984
68a10cf5a1
Remove comment line 2020-10-08 18:51:24 -05:00
chimp1984
e95ab2a0b4
Add resource file for 1.4.0 (should be updated at release time) 2020-10-08 18:49:15 -05:00
chimp1984
b14266d815
Remove resource file 2020-10-08 18:49:14 -05:00
chimp1984
98207518d6
We "hack" TradeStatistics2StorageService to fulfill our needs:
1. We do not want that initial data request/response use old trades statistics for excluded key hashes.
Thats why we return an empty map in getMap.
2. We do not read resource file as we have removed that.
3. We do not persist as we convert the existing data and re-publish as new data, or at startup we convert the old data to the new one and then delete the file.
2020-10-08 18:48:52 -05:00
chimp1984
b2665bdd2c
let seller publish trade statistics only if peer is updated user. If not the peer will publish only. 2020-10-08 18:48:52 -05:00
chimp1984
4f685f8f4b
When updating the capability from a reported peer we check if the reported one has higher capabilities, otherwise we ignore it. 2020-10-08 18:23:04 -05:00
chimp1984
c8feef150e
Apply code review suggestions
Fix incorrectly commented out code (was for dev testing commented out)
2020-10-08 18:23:04 -05:00
chimp1984
c88bc1c99c
Use custom class MailboxItem instead of Tuple
Rename mailboxMap to mailboxItemsByUid
2020-10-08 18:23:04 -05:00
chimp1984
447235c2af
Dont reassign param 2020-10-08 18:23:03 -05:00
chimp1984
f53290b817
Copy peers in a new hashset to avoid concurrent modification exc at serialisation
Remove final
Cleanups
2020-10-08 18:23:03 -05:00
chimp1984
c7f23e8deb
Do not log size as we don't want to call potentially expensive toProtoMessage method 2020-10-08 18:23:03 -05:00
chimp1984
b748bffbfe
Add isPresent check 2020-10-08 18:23:03 -05:00
chimp1984
f36a17389e
Fix incorrect collection used in == 1 check 2020-10-08 18:23:03 -05:00
chimp1984
2fd010498d
Decrease failedConnectionAttempts onConnection
Rename method
2020-10-08 18:23:03 -05:00
chimp1984
351db88992
Use a hashset instead of list to avoid duplicates. Filter out my own node from persisted peers.
Remove log in DisputeAgentManager which gets called repeatedly
2020-10-08 18:23:03 -05:00
chimp1984
cfda0aff68
Fix tests 2020-10-08 18:23:03 -05:00
chimp1984
31ce5ccf67
Use connection.getPeersNodeAddressOptional().isPresent() instead of connection.hasPeersNodeAddress() which does the same internally 2020-10-08 18:23:03 -05:00
chimp1984
0686079946
Refactor: Rename method 2020-10-08 18:23:02 -05:00
chimp1984
ed960aba3f
Refactor: Rearrange code, remove unused methods, renamings (no functional change) 2020-10-08 18:23:02 -05:00
chimp1984
4575516d19
Refactor: Return early 2020-10-08 18:23:02 -05:00
chimp1984
31e7e26557
Fix incorrect handling of decryptedEntries size 2020-10-08 18:23:02 -05:00
chimp1984
983f610e73
Update p2p/src/main/java/bisq/network/p2p/network/Connection.java
Co-authored-by: sqrrm <sqrrm@users.noreply.github.com>
2020-10-08 18:23:02 -05:00
chimp1984
bf674ea0cf
Use getPersistedPeers for peerList.getList() calls
Rename getOptionalPersistedPeer to findPersistedPeer
Improve getConnectedReportedPeers method
2020-10-08 18:23:02 -05:00
chimp1984
25526750a8
Replace persistedPeers with peerList 2020-10-08 18:23:02 -05:00