Commit graph

10185 commits

Author SHA1 Message Date
Julian Knutsen
931c1f47b4
[TESTS] Allow remove() verification to be more flexible
Now that we have introduced remove-before-add, we need a way
to validate that the SequenceNumberMap was written, but nothing
else. Add this feature to the validation path.
2019-11-22 08:16:02 -08:00
Justin Carter
d4e7f86ff6
Use generic javax imports for DI 2019-11-22 14:50:21 +01:00
Justin Carter
035dc4bb2a
Remove @FxmlView from abstract view classes 2019-11-22 14:38:41 +01:00
lukasz
fbfda8e151
Split EmptyWalletWindow into BsqEmptyWalletWindow and BtcEmptyWalletWindow 2019-11-22 14:21:48 +01:00
Christoph Atteneder
d12a4049ad
Merge pull request #3659 from rex4539/typos
Fix some even more typos
2019-11-22 14:12:29 +01:00
Christoph Atteneder
c0108b83af
Merge pull request #3655 from lusarz/refactor-offer-view
Refactor OfferView constructor
2019-11-22 14:11:49 +01:00
Christoph Atteneder
cb2093a54c
Merge pull request #3654 from lusarz/refactor-use-inject
Use dependency injection in FilterWindow and SendAlertMessageWindow
2019-11-22 14:10:35 +01:00
Christoph Atteneder
8ffc4b0a24
Merge pull request #3653 from lusarz/refactor-send-private-notification
Remove redundant interfaces from SendPrivateNotificationWindow
2019-11-22 14:08:39 +01:00
Dimitris Apostolou
a718c885fc
Fix typos 2019-11-22 14:05:50 +02:00
Christoph Atteneder
0ac6bf1307
Only allow seller side to sign accounts
This prevents a scammer to use publicly known account details
(without being in control of the account) as a seller to get
signed by a buyer. The money received in the seller account might
not be detected by the legitimate owner and/or the money not sent back.
30 days later the scammer could use this signed account as seed to peer sign other stolen accounts.
2019-11-22 11:32:43 +01:00
Christoph Atteneder
46ce873b01
Add additional trade amount limit for trades that qualify for account signing
Should make it easier to detect by a stolen bank account owner as buyer that an outgoing transactions is taking place.
2019-11-22 11:26:46 +01:00
Christoph Atteneder
90bf1388da
Merge pull request #3658 from bodymindarts/missing-annotations
Add missing @Named annotations for CoinFormatter injection
2019-11-22 11:11:12 +01:00
Justin Carter
88d031fdd3
Add missing @Named annotations for CoinFormatter injection 2019-11-22 11:02:40 +01:00
Christoph Atteneder
f48f9244e0
Merge pull request #3647 from rex4539/more-typos
Fix some more typos and cleanup
2019-11-21 15:16:57 +01:00
lukasz
8917df94ee
Refactor OfferView constructor 2019-11-21 15:16:38 +01:00
lukasz
f3622c280b
Use dependency injection in FilterWindow and SendAlertMessageWindow 2019-11-21 11:48:29 +01:00
lukasz
e23ad9eb71
Remove redundant interfaces from SendPrivateNotificationWindow 2019-11-21 11:28:22 +01:00
Dimitris Apostolou
594fc08035
Fix typos and cleanup 2019-11-21 11:17:48 +02:00
Christoph Atteneder
02d521aeb1
Merge pull request #3651 from stejbac/ungenerify-popup-class
Un-generify Popup class
2019-11-21 10:04:38 +01:00
Christoph Atteneder
871051f8fb
Merge pull request #3643 from rex4539/fix-typos
Fix typos and cleanup
2019-11-21 09:53:26 +01:00
Christoph Atteneder
42dfc6a158
Get monitor up to speed again (#3633)
* Updated price node list for monitor

* Price monitor is more resilient against timeouts

Recenty, a price node got removed. Unfortunately, this node
has been the first in the list of configured price nodes in
the monitor configuration.

A misplaced catch block caused the loop to stop instead of
trying the next configured price node in the list.

* Monitor selects a price node randomly

Up until now, the monitor always chose the price nodes
in their configured order. This resulted in querying
always the same node and thus, create a bigger system
load for this very node. Only in case of a failure,
the monitor moved on to another node.

Shuffling the list of nodes prior to querying provides
at least some load balancing for the price nodes.

* Fixed monitor market API query

The format of the market API response changed. Formerly,
there has been one line, now it is pretty print json.

* Add RefundAgent messages to monitor

Add the relatively new RefundAgent message to the monitor.

* Adjust monitor timeout

Observed, that a timeout of one minute works better than
the original 90 seconds.
2019-11-21 09:42:40 +01:00
Christoph Atteneder
a77c09bcc1
Remove redundant interfaces from FilterWindow and SendAlertMessageWindow (#3617)
* Refactor FilterWindow - remove redundant interfaces

* Refactor SendAlertMessageWindow - remove redundant interfaces
2019-11-21 09:32:57 +01:00
Julian Knutsen
372c26de74
Implement remove-before-add message sequence behavior
It is possible to receive a RemoveData or RemoveMailboxData message
before the relevant AddData, but the current code does not handle
it.

This results in internal state updates and signal handler's being called
when an Add is received with a lower sequence number than a previously
seen Remove.

Minor test validation changes to allow tests to specify that only the
SequenceNumberMap should be written during an operation.
2019-11-20 16:31:56 -08:00
Julian Knutsen
526aee5ed4
[TESTS] Allow tests to validate SequenceNumberMap write separately
In order to implement remove-before-add behavior, we need a way to
verify that the SequenceNumberMap was the only item updated.
2019-11-20 16:31:56 -08:00
Devin Bileck
e99d450725
Update based on review feedback
Mock the SeedNodeRepository superclass, thus eliminating the dependency
to core.
2019-11-20 16:29:06 -08:00
Julian Knutsen
793e84d888
[DEAD CODE] Remove getProtectedDataStoreMap
The only user has been migrated to getMap(). Delete it so future
development doesn't have the same 20-byte vs 32-byte key issue.
2019-11-20 16:23:41 -08:00
Julian Knutsen
455f7d2689
[BUGFIX] Use 32-byte key in requestData path
Addresses the second half of #3629 by using the HashMap, not the
protectedDataStore to generate the known keys in the requestData path.

This won't have any bandwidth reduction until all seednodes have the
update and only have the 32-byte key in their HashMap.

fixes #3629
2019-11-20 16:20:38 -08:00
Julian Knutsen
e212240b88
[BUGFIX] Reconstruct HashMap using 32-byte key
Addresses the first half of #3629 by ensuring that the reconstructed
HashMap always has the 32-byte key for each payload.

It turns out, the TempProposalStore persists the ProtectedStorageEntrys
on-disk as a List and doesn't persist the key at all. Then, on
reconstruction, it creates the 20-byte key for its internal map.

The fix is to update the TempProposalStore to use the 32-byte key instead.
This means that all writes, reads, and reconstrution of the TempProposalStore
uses the 32-byte key which matches perfectly with the in-memory map
of the P2PDataStorage that expects 32-byte keys.

Important to note that until all seednodes receive this update, nodes
will continue to have both the 20-byte and 32-byte keys in their HashMap.
2019-11-20 16:15:52 -08:00
Steven Barclay
a26366ee0d
Un-generify Popup class
Remove the type parameter from Popup<T>, as it appears to have never
been used or set anywhere in the code. (This mainly involves replacing a
lot of "new Popup<>" occurrences.)
2019-11-20 21:27:11 +00:00
Dimitris Apostolou
587b55d37b
Fix typos and cleanup 2019-11-20 22:56:19 +02:00
Florian Reimair
ab214d3fe7
Merge pull request #3637 from rex4539/fix-typos
Fix typos and cleanup in documentation
2019-11-20 10:44:44 +01:00
Christoph Atteneder
928b35c7d3
Merge pull request #3635 from cbeams/upgrade-shadow-plugin
Upgrade Gradle Shadow plugin from 4.0.2 => 5.2.0
2019-11-20 10:43:45 +01:00
Florian Reimair
f6740d06a0
Merge pull request #3585 from blabno/sort-gradle-witness
Sort existing gradle-witness.gradle
2019-11-20 10:37:50 +01:00
Florian Reimair
8025cc10a1
Merge pull request #3634 from bodymindarts/coin-formatter-interface
Coin formatter interface
2019-11-20 10:28:35 +01:00
Christoph Atteneder
778e9b2b79
Implement installation path check on Windows (#3642)
* Implement installation path check on Windows

Prior to starting the installation, check if the install location
contains special characters and if so use a different default install
location as well as display a prompt to the user providing additional
details.

This is in response to #3605, for which a proper solution has yet to be
found.

* Ensure the destination location dialog is always shown

This resolves #552

* Show the Welcome dialog

Rather then potentially being greeted with the newly implemented
prompt on the destination location dialog if they have special
characters in their install path, greet the user with the Welcome
dialog when they initially launch the installer.

* Reorder/group setup items logically
2019-11-20 10:22:23 +01:00
Devin Bileck
446c80291c
Reorder/group setup items logically 2019-11-20 00:58:55 -08:00
Devin Bileck
33c611c8cc
Show the Welcome dialog
Rather then potentially being greeted with the newly implemented
prompt on the destination location dialog if they have special
characters in their install path, greet the user with the Welcome
dialog when they initially launch the installer.
2019-11-20 00:56:54 -08:00
Devin Bileck
eba7fddc0f
Ensure the destination location dialog is always shown
This resolves #552
2019-11-20 00:45:45 -08:00
Devin Bileck
0ea11ebc46
Implement installation path check on Windows
Prior to starting the installation, check if the install location
contains special characters and if so use a different default install
location as well as display a prompt to the user providing additional
details.

This is in response to #3605, for which a proper solution has yet to be
found.
2019-11-20 00:39:52 -08:00
Dimitris Apostolou
ce8804b418
Fix typos and cleanup 2019-11-20 01:24:48 +02:00
Julian Knutsen
849155a92a
[TESTS] Regression test for #3629
Write a test that shows the incorrect behavior for #3629, the hashmap
is rebuilt from disk using the 20-byte key instead of the 32-byte key.
2019-11-19 12:39:43 -08:00
lusarz
2f6589b5e5
Refactor SendAlertMessageWindow - remove redundant interfaces 2019-11-19 18:50:21 +01:00
lusarz
ba0437e6b0
Refactor FilterWindow - remove redundant interfaces 2019-11-19 18:50:17 +01:00
Chris Beams
1a2461fcdf
Upgrade Gradle Shadow plugin from 4.0.2 => 5.2.0
After the upgrade from Gradle 4.10.2 to 5.6.4 in commit 5fe71fa0a,
all of Bisq's shadowJar tasks started failing Gradle's incremental build
checks. This meant that repeated invocations of `gradle build` went from
a handful of seconds to more than a minute, because shadowJar tasks had
to be re-executed on every build.

For example, with --info enabled, one would see entries like this in the
build output:

    > Task :seednode:shadowJar
    Custom actions are attached to task ':seednode:shadowJar'.
    Caching disabled for task ':seednode:shadowJar' because:
      Caching has not been enabled for the task
    Task ':seednode:shadowJar' is not up-to-date because:
      Output property 'archiveFile' file [...]libs/seednode.jar has changed.

This problem was solved by in johnrengelman/shadow#524 and made
available in the project's recent 5.0.2 release. This patch simply bumps
the shadow plugin version to that value, and gets us back to snappy
incremental builds, e.g.:

    $ gradle build

    BUILD SUCCESSFUL in 7s
2019-11-19 18:05:14 +01:00
Julian Knutsen
a8139f3a04
Remove HashmapChangedListener::onBatch operations
Now that the only user of this interface has been removed, go ahead
and delete it. This is a partial revert of
f5d75c4f60 that includes the code that was
added into ProposalService that subscribed to the P2PDataStore.
2019-11-19 08:37:40 -08:00
Julian Knutsen
a50e59f7eb
ProposalService::onProtectedDataRemoved signals listeners once on batch removes
#3143 identified an issue that tempProposals listeners were being
signaled once for each item that was removed during the P2PDataStore
operation that expired old TempProposal objects. Some of the listeners
are very expensive (ProposalListPresentation::updateLists()) which results
in large UI performance issues.

Now that the infrastructure is in place to receive updates from the
P2PDataStore in a batch, the ProposalService can apply all of the removes
received from the P2PDataStore at once. This results in only 1 onChanged()
callback for each listener.

The end result is that updateLists() is only called once and the performance
problems are reduced.

This removes the need for #3148 and those interfaces will be removed in
the next patch.
2019-11-19 08:37:39 -08:00
Julian Knutsen
eae641ee73
Update removeExpiredEntries to remove all items in a batch
This will cause HashMapChangedListeners to receive just one onRemoved()
call for the expire work instead of multiple onRemoved() calls for each
item.

This required a bit of updating for the remove validation in tests so
that it correctly compares onRemoved with multiple items.
2019-11-19 08:37:39 -08:00
Julian Knutsen
489b25aa13
Change removeFromMapAndDataStore to signal listeners at the end in a batch
All current users still call this one-at-a-time. But, it gives the ability
for the expire code path to remove in a batch.
2019-11-19 08:37:38 -08:00
Julian Knutsen
4f08588717
[REFACTOR] removeFromMapAndDataStore can operate on Collections
Minor performance overhead for constructing MapEntry and Collections
of one element, but keeps the code cleaner and all removes can still
use the same logic to remove from map, delete from data store, signal
listeners, etc.

The MapEntry type is used instead of Pair since it will require less
operations when this is eventually used in the removeExpiredEntries path.
2019-11-19 08:37:38 -08:00
Julian Knutsen
b281566e14
[REFACTOR] HashMapListener::onAdded/onRemoved
Previously, this interface was called each time an item was changed. This
required listeners to understand performance implications of multiple
adds or removes in a short time span.

Instead, give each listener the ability to process a list of added or
removed entrys which can help them avoid performance issues.

This patch is just a refactor. Each listener is called once for each
ProtectedStorageEntry. Future patches will change this.
2019-11-19 08:37:38 -08:00