Commit Graph

12689 Commits

Author SHA1 Message Date
chimp1984
213050c3d1
Add filter for excluding null objects 2020-10-08 18:49:14 -05:00
chimp1984
fa374b99fb
Do conversion in a thread to not block UI thread. takes about 4 seconds on my machine.
Add shutdown method to TradeStatisticsConverter and call it via TradeStatisticsManager. Now as we have a reference to TradeStatisticsConverter in we don't need the hack anymore in applyInjector.
Set log level for com.neemre.btcdcli4j.core.client.ClientConfigurator to error as there is an expected warn log because of the outdated version.
2020-10-08 18:49:14 -05:00
chimp1984
f56fe42ae1
Add injector.getInstance(TradeStatisticsConverter.class) to BisqExecutable to enforce inclusion.
Cleanups, renamings
2020-10-08 18:49:14 -05:00
chimp1984
9016cb6c32
Prune mediator and refund agent entries for all entries beside the last 100 we use for the selection algorithm. 2020-10-08 18:49:14 -05:00
chimp1984
b14266d815
Remove resource file 2020-10-08 18:49:14 -05:00
chimp1984
6766835af6
Use TradeStatistics3 in protobuf file 2020-10-08 18:49:14 -05:00
chimp1984
0e70a99c42
Adjust tests, remove tests which do not make sense anymore 2020-10-08 18:49:13 -05:00
chimp1984
52be126667
Apply TradeStatistics3 to client classes 2020-10-08 18:49:13 -05:00
chimp1984
c4a4c878b8
Apply TradeStatistics3 to TradeStatisticsManager and some related classes 2020-10-08 18:48:52 -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
6d43c09b33
Delete TradeStatistics (version 1) 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
a522d0ade9
Refactor: Rename class 2020-10-08 18:48:17 -05:00
chimp1984
b75aa6771f
Refactor: Move class 2020-10-08 18:48:17 -05:00
chimp1984
406bcfb064
Remove PublishTradeStatistics from buyer protocol
We let seller publish trade stats to avoid those issues with duplicated entries as trade date is different.
We could fix that to use the same trade date,  but it seems to be not needed that both traders are publishing and the
risk if a trade stat does not get successfully published does not cause real problems.
There is guarantee anyway that the data is broadcast even if both do it.

In case we still want to do it from both sides we need to use the sellers trade date which is exchanged early in the trade
protocol but yet not further used beside for account age check.
2020-10-08 18:48:17 -05:00
chimp1984
00bed02839
Add TradeStatistics3 and related classes
Add TRADE_STATISTICS_3 Capability
Add TradeStatistics3 to proto resolvers
Make message TradeStatistics2 deprecated
2020-10-08 18:48:17 -05:00
chimp1984
6e3fdbc96a
Apply codacy suggestions 2020-10-08 18:23:04 -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
cf0693098f
Update common/src/main/java/bisq/common/app/Capability.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
chimp1984
25bfe2d6ad
Add findPeersCapabilities method
Impl. applyCapabilities

Cleanups
2020-10-08 18:23:02 -05:00
chimp1984
7af16d7af3
Add getDateAsLong method, add setter for capabilities 2020-10-08 18:23:01 -05:00
chimp1984
186a9d670d
Add findPeersCapabilities method 2020-10-08 18:23:01 -05:00
chimp1984
765f9ea940
Apply code inspection suggestions
The check for AckMessage is not needed anymore as we remove the interface from AckMessage
2020-10-08 18:23:01 -05:00
chimp1984
2523c2e914
Use getSingleThreadListeningExecutor, cleanups 2020-10-08 18:23:01 -05:00
chimp1984
bf659a1e6d
Pass supportedCapabilities to PeerManager. Not further processed yet, will be done in next commits
Cleanups
2020-10-08 18:23:01 -05:00
chimp1984
1c07be0507
Use only node address for equals and hashcode
Make capabilities final

If capability changes we would have had duplicate entries
2020-10-08 18:23:01 -05:00
chimp1984
17974f3dcc
Refactor: move SupportedCapabilitiesMessage handling code out to a method
Return early
2020-10-08 18:23:01 -05:00
chimp1984
9821dd6271
Clear capabilitiesListeners at shutdown
Improve logs
2020-10-08 18:23:01 -05:00
chimp1984
8aec306159
Remove verification for address prefix
Set address prefix to empty bytes in case we know that peer has capability (updated version)
Batch process mailbox messages in a thread.
Refactor handling of mailbox messages
2020-10-08 18:23:01 -05:00
chimp1984
40f9cfb7c5
Add methods for getting peers capabilities 2020-10-08 18:23:00 -05:00
chimp1984
6f7dfcf4ef
Make onRemoved default in interface 2020-10-08 18:23:00 -05:00
chimp1984
e73a4b4ae4
Cleanups
Remove debug log, remove annotation
2020-10-08 18:23:00 -05:00