Commit Graph

1624 Commits

Author SHA1 Message Date
Steven Barclay
a71f1e7e3f
Make UserThread::runAfter* methods thread safe
The runAfter* methods delegate to UITimer::run(Later|Periodically) in
the case of the desktop application. These use the JavaFX TimeLine API
(via bisq.common.reactfx.FXTimer) to schedule future events. However,
this API isn't thread safe and isn't meant to be called outside the FX
application thread. This causes occasional misfirings and out-of-order
scheduling when UserThread::runAfter is called outside the user thread.

Make the UITimer::run* methods safe to call from any thread by checking
we are in the application thread and delegating to UserThread::execute
otherwise. This also improves consistency between the contracts of the
runAfter* and execute methods. As the former has many call sites, this
is safer than trying to track down all the non-thread-safe uses.

(The Timer used in the headless app already appears to be thread-safe.)

This fixes #4055 (Bisq sometimes fails to prompt user for password to
unlock wallet), caused by out-of-order scheduling of the execute and
runAfter tasks in the WalletConfig.onSetupCompleted anonymous class
method in bisq.core.btc.setup.WalletsSetup.initialize.

Also prevent an exception caused by non-thread-safe calls into JavaFX
during the shutdown of OpenOfferManager, which was uncovered by the
above, by adding a missing UserThread::execute call.
2020-04-06 13:52:33 +08:00
sqrrm
d0a8890c09
Merge pull request #4093 from jmacxx/fix_dust_wallet
Prevent dust outputs from being created during withdraw from wallet
2020-04-03 15:56:05 +02:00
Christoph Atteneder
a96bfd431d
Merge pull request #4060 from ghubstan/avoid-standby-mode
Improve AvoidStandyModeService
2020-04-01 11:21:32 +02:00
sqrrm
55048dc4a3
Add vwap bsq price (#4098)
* Remove unused code

* Add VWAP calculation for USD/BSQ price

* Remove unused argument
2020-03-31 16:34:14 +02:00
Christoph Atteneder
9891e58f2c
Merge pull request #4047 from freimair/graceful_shutdown
Added graceful shutdown hook
2020-03-31 15:20:58 +02:00
jmacxx
f1de079901
Change wording of the dust informative message per review by m52go
Moved message text into displaystrings.properties
2020-03-30 21:09:19 -05:00
jmacxx
ea8b327f7b
Change the constant used to determine what amount is considered dust
Now using `Restrictions.getMinNonDustOutput()` which equates to 546 sats
2020-03-29 18:23:48 -05:00
jmacxx
378c57492b
Address issues raised in review by sqrrm on 2020-03-26
- added a comment describing the `removeDust` method and its effects.
- use more descriptive variable names.
- made the logging more verbose to help log readers.
- use a constant for the dust limit
- add a notice to the user when dust is padded to the fee
2020-03-28 21:22:40 -05:00
Florian Reimair
0fb4f13319
Fix closing the app by gui exit
Before, the graceful shutdown procedures have been executed in the
user thread. However, the sync mechanics for connections/offers
caused a lockup, as some little parts of the code do execute on the
user thread as well.
2020-03-28 11:27:37 +01:00
Christoph Atteneder
b321cd9272
Merge pull request #4046 from stejbac/add-faster-payments-holder-name
Add holder name for new Faster Payments accounts
2020-03-27 10:03:47 +01:00
Steven Barclay
d84130ff5b
Improve popup text + layout of Faster Payments buyer form fields
Display the account number on the same row as the sort code in the trade
step view, to prevent scrolling with the extra name field (as suggested
in the code review).

(This also affects the layout of old accounts without the extra field.)

Also apply the suggested popup text simplifications.
2020-03-27 16:08:21 +08:00
sqrrm
427d581f27
Merge pull request #4090 from ripcurlx/stake-validation-issue
Only use InputValidation when formatting voting stake
2020-03-26 17:29:22 +01:00
Steven Barclay
a957fb167a
Add popup to advise user to recreate Faster Payments account
Open an info popup in the take/create offer view, upon choosing to take
or make a new offer, to instruct the user to recreate their old Faster
Payments account with an owner full name (and preserved salt). Also show
the popup upon manual selection of any old (i.e. missing full name)
Faster Payments account from the trading account combo box, analogously
to the ClearXchange (Zelle) warning popup logic.

(Also eliminate slight differences between the private
'maybeShow[ClearXchange|FasterPayments]Warning' methods in TakeOfferView
and MutableOfferView, to make the code easier to deduplicate in future.)
2020-03-25 17:48:06 +08:00
jmacxx
057e2c5e7c
Remove dust outputs created during withdraw from wallet
This change fixes an issue whereby dust change outputs are
inadvertently created when users make withdrawals from their
wallets.  (Funds -> Send Funds)

The solution taken here is to detect a dust TXO during the withdrawal
fee estimation process and add that amount to the fee thus eliminating
the dust output.

For example if the user has 1 BTC and goes to withdraw 0.99999900 BTC
it will detect a change TXO of 100 sats which is below the dust limit,
increase the fee by 100 sats and therefore withdraw 1 BTC.

This fix only applies to user withdrawals from their wallet.  Other
use cases such as P2P trading, deposits and fees will be handled
separately.

Related to #4039
2020-03-24 09:23:58 -05:00
Christoph Atteneder
37751c74c4
Make prompt text readable in dark mode 2020-03-24 12:53:11 +01:00
Christoph Atteneder
557ec7f449
Merge pull request #4025 from stejbac/make-persistence-thread-safe
Make serialisation in FileManager::saveToFile thread-safe
2020-03-23 13:49:27 +01:00
Christoph Atteneder
83d588d374
Only use InputValidation when formatting voting stake 2020-03-23 11:04:27 +01:00
sqrrm
7056cffdc6
Merge pull request #4077 from ripcurlx/handle-unsupported-payment-methods
Improve handling of filtered offers and unsupported payment methods
2020-03-19 11:55:32 +01:00
Christoph Atteneder
290bd6ed42
Filter out banned offers completely to prevent any unexpected error by offer misconfigurations 2020-03-19 10:10:01 +01:00
Christoph Atteneder
b39cdbab1f
Improve messaging layout 2020-03-19 09:38:19 +01:00
Christoph Atteneder
89cfb34b8d
Merge pull request #4031 from jmacxx/fix_resize_issue_4030
Size the offer book on window activation
2020-03-18 14:44:06 +01:00
Christoph Atteneder
d9b54224c0
Merge pull request #4068 from jmacxx/fix_column_sort_range
Sorting order of offers appropriately by min/max range
2020-03-18 14:42:58 +01:00
jmacxx
d4dae4b6b1
Sort order of offers appropriately by min/max range
This change fixes an issue with sorting the offer list when the amount
is shown as a range.  In OfferBookView::activate() we add a listener
for the sortTypeProperty on amountColumn and volumeColumn. When the
sortType is changed we set the comparator to be the approprate property
of the Offer; either getAmount/getMinAmount; getVolume/getMinVolume.

Fixes #3818
2020-03-18 07:09:18 -05:00
jmacxx
02d37b7042
Size the offer book on window activation
Currently the offer book tables are only being sized when the window
proportions change. However if the window is made bigger before the
offer book is opened, then the tables are not resized from their
default.

Other windows (for example Market -> Trades) solve this by make a
sizing call in the activate method.  In order to do this the sizing
code is separated into a layout method where it can be called from
both activate and the existing heightProperty listener. The same
approach is taken here.

Fixes #4030
2020-03-18 07:03:20 -05:00
sqrrm
deb3f658f5
Merge pull request #4075 from bisq-network/release/v1.2.9
Merge v1.2.9 release branch back to master
2020-03-17 14:56:11 +01:00
Christoph Atteneder
0c874b04d7
Revert to SNAPSHOT version 2020-03-17 14:44:25 +01:00
Dominykas Mostauskis
af03629882
Revert to only check local BTC node's port
Testing showed that the new mechanic for checking a local BTC node's
configuration is unstable. This commit reverts to just checking if the
relevant port is open. The recent refactoring and centralization of
logic is still in place.
2020-03-16 15:04:08 +01:00
Dominykas Mostauskis
4d9d06e25b
Revert to only check local BTC node's port
Testing showed that the new mechanic for checking a local BTC node's
configuration is unstable. This commit reverts to just checking if the
relevant port is open. The recent refactoring and centralization of
logic is still in place.
2020-03-16 11:57:28 +01:00
ghubstan
c0f9073698
Improve AvoidStandyModeService
This change substitutes use of memory efficient, OS supplied sleep/suspend
inhibitor utilties for the silent audio file player on Linux, merges
OSXStandbyModeDisabler functionality into AvoidStandyModeService, and
removes that class.

This change also stops Bisq from running the audio file on OSX;  it is
currently running both caffeinate and the silent audio file, and the avoid
standby mode button in the the OSX settings view is currently toggling
the audio player on and off, but not caffeinate.  (The only way to shut
down caffeinate is by shutting down Bisq.)

The OSX avoid standby mode button button has not been hidden so a cached
'do not avoid standby mode' preference does not leave the user stuck without
a caffeinate service the next time they start Bisq. (They can use it to
turn caffeinate on, but it can't be used to turn it off without shutting
down Bisq too.)

The avoid standy mode button is now displayed on Linux because the native
inhibitor can be toggled on and off.

There is no change to the avoid shutdown service on Windows and Unix.
2020-03-13 15:19:19 -03:00
Christoph Atteneder
066614f966
Bump version number for v1.2.9 2020-03-13 17:16:09 +01:00
Christoph Atteneder
96934d9107
Merge pull request #4048 from freimair/reduce_ram
Limit system ram to 4GB
2020-03-12 10:30:42 +01:00
Florian Reimair
f127c28d1d
Limit for bisq-desktop only 2020-03-11 16:38:52 +01:00
Steven Barclay
a829969089
Add holder name for new Faster Payments accounts
Use excludeFromJsonDataMap to add an optional owner full name property
to Faster Payments (GBP) accounts, without affecting the trade JSON
contract (for backwards compatibility). This is to fix #3976, that some
banks have started checking the recipient name.

Make the name a non-optional field for _new_ accounts, but display the
details for old Faster Payments accounts in exactly the same way as
before, only showing the extra field in the info popup, account and
trade step views when it is present.

Also update the now misleading payment instructions in the buyer popup.
TODO: Update translations (which probably aren't needed anyway).
2020-03-11 19:15:12 +08:00
Christoph Atteneder
dfba2103ab
Bump version number to v1.2.8 2020-03-10 09:17:21 +01:00
Christoph Atteneder
dc583d1a37
Merge pull request #4035 from stejbac/speed-up-dao-state-monitor-view-load
Speed up DAO state monitor view load
2020-03-10 09:05:44 +01:00
Steven Barclay
91fa07343c
Add UserThreadMappedPersistableEnvelope for greater explicitness
Make the default toPersistableMessage() method of PersistableEnvelope
simply delegate to Proto.toProtoMessage for speed, so that stores can
explicitly implement (Threaded|UserThreadMapped)PersistableEnvelope if
they actually need concurrency control.

As part of this, make PeerList implement PersistableEnvelope directly
instead of extending PersistableList, as it is non-critical & cloned on
the user thread prior to storage anyway, so doesn't need be thread-safe.
In this way, only PaymentAccountList & small DAO-related stores extend
PersistableList, so they can all be made user-thread-mapped.

After this change, the only concrete store classes not implementing
(Threaded|UserThreadMapped)PersistableEnvelope are:

  AccountAgeWitness, BlindVotePayload, ProposalPayload, SignedWitness,
  TradeStatistics2, NavigationPath & PeerList

The first five appear to erroneously implement PersistableEnvelope and
can be cleaned up in a separate commit. The last two are non-critical.

(Make NavigationPath.path an immutable list, for slightly better thread
safety anyway - that way it will never be observed half-constructed.)
2020-03-10 12:05:33 +08:00
Steven Barclay
c261933928
Compute height cells lazily to speed up DaoStateMonitorView
Avoid a bottleneck computing the cycle index & calling 'Res.get(..)' for
every block since genesis in the DAO state monitor view, when building
the DaoStateBlockListItem objects, by making the 'height' field lazy. To
do this, pass the cycle index into the constructor using an IntSupplier
and make the height a memoised 'Supplier<String>' with a custom getter.

Also add a unit test to check that the auto-generated equals & hashCode
methods still work as expected, as it isn't totally clear what Lombok
would do when a field type differs from its getter return type.
2020-03-09 15:35:44 +08:00
Steven Barclay
6ef6bf24d9
Avoid raw use of Overlay<T> 2020-03-06 17:03:55 +08:00
Dominykas Mostauskis
2105b219c9
Changes to local BTC node info in Settings 2020-03-03 18:50:44 +01:00
Christoph Atteneder
fa56b91f6d
Revert "Vote Reveal - Silent Fail" 2020-02-28 16:01:03 +01:00
sqrrm
1d1cba1e4d
Merge pull request #3982 from dmos62/local-btc-node-configuration-check
Add local Bitcoin node configuration detection
2020-02-27 15:29:49 +01:00
sqrrm
ad3da4b701
Merge pull request #4009 from ripcurlx/fix-snapshot-version-for-rpm-builds
Handle SNAPSHOT versioning differently for rpm packages
2020-02-27 10:53:57 +01:00
Chris Beams
c1a99ccc55
Polish LocalBitcoinNode method names and visibility
- Rename #willUse => #shouldBeUsed
 - Rename #willIgnore => #shouldBeIgnored
 - Reduce visibility of methods where appropriate
 - Edit Javadoc typos and use @link syntax where appropriate
2020-02-27 09:35:36 +01:00
Chris Beams
b93ca2b2b1
Polish formatting 2020-02-26 21:24:38 +01:00
Christoph Atteneder
a6d874c3c1
Merge pull request #3758 from bisq-3408/master
Vote Reveal - Silent Fail
2020-02-26 12:53:03 +01:00
Christoph Atteneder
bf592f363b
Merge pull request #4008 from beingindot/tableview-checkbox-issue
Tableview multiple rows checkbox column issue
2020-02-26 10:11:03 +01:00
Christoph Atteneder
3b1a1f289b
Handle SNAPSHOT versioning different for rpm packages
Fixes #4006.
2020-02-26 09:49:06 +01:00
Dominykas Mostauskis
6b4878ada8
Centralize some of local BTC node logic
Introduces LocalBitcoinNode::willUse and ::willIgnore to move logic that
was previously littered throughout the codebase into one place. Also,
changes the usages of LocalBitcoinNode to be more precise, specifying
which of these questions are being asked:

- "is there a local BTC node" (isDetected);
- "is it well configured" (isWellConfigured and isUsable);
- "will we ignore a local BTC node even if we found a usable one"
  (willIgnore);
- "is there a usable local BTC node and will we use it" (willUse).

These changes make related logic much easier to maintain and to read.
2020-02-25 15:56:02 +01:00
Dominykas Mostauskis
0bbbe8c1e9
Perform checks automatically on first query
It's quite amazing how obvious this was, yet I missed it for such a long
time. Simplifies usage of LocalBitcoinNode and its internals even more
so. Fixes #4005. The way we structured LocalBitcoinNode was as if the
detection checks were expensive, but they're not. Previously, in some
cases we would notice that a local BTC node wouldn't be used even if it
was detected, so we would skip these checks. This optimization now
doesn't happen. It might be reimplemented in a coming change where more
local BTC node logic is moved into LocalBitcoinNode, but, even if it's
not, this check is fairly cheap. A notable exception is if the local BTC
node is not responding, which would cause us to wait for a timeout, but
if that is the case the mentioned optimization wouldn't help (most of
the time).
2020-02-25 14:04:34 +01:00
beingindot
48877517d6
Tableview multiple rows checkbox column issue
As mentioned in the issue #3984, Have created lot of buy/sell offers
with different currencies spanning across around 30+ offers
so that we need to use scroll bar in my open offers and able to
recreate the issue.
2020-02-25 16:23:42 +05:30